On 2/26/2016 10:31 AM, saskia101 wrote: > I guess there's still a problem... At least messages are now send faster than > 1 per second through the policy daemon, but still Postfix is not treating > the policy daemon as multi threaded. > > Postfix seems to wait until he got is "action=" answer, before sending a new > request. Even if I send back the instance id, or even all variables, > together with my action= reply, it still waits for the answer before sending > the next one. > > So Postfix is multithreading, I got many smtpd processes running, but no > matter how wonderful I try to write my policy daemon, it will always slow > down Postfix cause I'm receiving the requests 1 by 1. > > Do I miss something or if not, are there plans to have Postfix send multiple > policy requests at once, just at the rate as they come in; so for each smtpd > process a policy request at the same rate as Postfix can handle incoming > messages? >
Postfix does not make a new policy service connection for each incoming message. That would be very inefficient. Each smtpd process makes one connection to the policy service and keeps that connection open for the life of the process, either $max_use or $max_idle. The policy service is expected to handle multiple requests in sequence, and not close the connection until after postfix closes the connection. Anything else is an error and will slow things down considerably. You should end up with about the same number of connections as there are active smtpd processes, with new connections happening only when expired smtpd processes are replaced. -- Noel Jones