I am using Postfix as my MTA and iRedAPD as my greylisting plugin in an 8-core machine. I receive more than 10 simultaneous connections at times to my MTA and noticed that SPF checks are done sequentially for each incoming connection. (If two connections have MAIL FROM domain as a.com and b.com, b.com's SPF record is validated only after a.com's SPF validation is completed.)
Ideally, I expected SPF DNS queries for multiple connections will be mixed if they are processed concurrently (since it's an I/O bound job) but this did not seem to be the case.
Looking at the code, I found that iRedAPD creates a new _asyncchat server for every incoming connection which gives me the impression that it should support concurrent processing. I know it uses asyncore module which is by default single-threaded. So, using multiple cores even if they are available is out of the question.
But even if it's single-threaded, since SPF processing involves I/O operations, there should be a context switch achieving concurrency. But I observed sequential lookups in every case. To further diagnose this issue, I created a dynamic DNS server with Python and introduced a delay for SPF queries before sending a response (ideally, this delay should force a switch if concurrency is available). Still, the lookups were made sequentially.
Can anyone tell me if there is anything I'm missing or is it the expected behaviour of iRedAPD?
I am using Postfix as my MTA and iRedAPD as my greylisting plugin in an 8-core machine. I receive more than 10 simultaneous connections at times to my MTA and noticed that SPF checks are done sequentially for each incoming connection. (
If two connections have MAIL FROM domain as a.com and b.com, b.com's SPF record is validated only after a.com's SPF validation is completed.
)Ideally, I expected SPF DNS queries for multiple connections will be mixed if they are processed concurrently (since it's an I/O bound job) but this did not seem to be the case.
Looking at the code, I found that iRedAPD creates a new _asyncchat server for every incoming connection which gives me the impression that it should support concurrent processing. I know it uses asyncore module which is by default single-threaded. So, using multiple cores even if they are available is out of the question.
But even if it's single-threaded, since SPF processing involves I/O operations, there should be a context switch achieving concurrency. But I observed sequential lookups in every case. To further diagnose this issue, I created a dynamic DNS server with Python and introduced a delay for SPF queries before sending a response (ideally, this delay should force a switch if concurrency is available). Still, the lookups were made sequentially.
Can anyone tell me if there is anything I'm missing or is it the expected behaviour of iRedAPD?