Not quite true, one can set smtpd_policy_service_request_limit to 1 and have
a new connection for each request.
But even if you don't and you keep using the same connection, Postfix is
still not giving the next request before receiving the answer of the
previous request. This is not strange, if you talk over the same pipe,
Postfix could never know to what request the answer belongs to, cause we're
talking over 1 pipeline / socket. So with this design, it's not strange that
Postfix wants an answer before sending the next request.



-----Original Message-----
From: owner-postfix-us...@postfix.org
[mailto:owner-postfix-us...@postfix.org] On Behalf Of Noel Jones
Sent: vrijdag 26 februari 2016 18:04
To: postfix-users@postfix.org
Subject: Re: Postfix & check_policyd_service no concurrent connections?

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

Reply via email to