2014-06-27 07:12:04 UTC
attached is a patch which adds the following configuration options
The first one will make the sleep(1) in attr_clnt_request configurable.
(line with comment /* XXX make configurable */)
In anvil_clnt.c and tls_mgr.c, where attr_clnt is also used, the current default 1 is used.
For check_policy_service (smtpd_check.c) the configuration parameter is used.
The second one will cause postfix to disconnect after the specified
amount of requests made over a policyd connection.
If set to 0 it will be disabled (default and current behaviour).
Also statically set to 0 in anvil_clnt.c and tls_mgr.c and configurable
for check_policy_service (smtpd_check.c).
I wrote this patch because I implemented a prefork policyd with
perl/Net::Server. So my policyd needs one process per connection.
For a test scenario I need to use multiple check_policy_service checks.
The number of connections will grow with smtpd processes * number of
For this reason I configured my policyd to close the connection after
each request. The documentations says that postfix will reconnect, but
it doesn't mention that it'll sleep(1) before reconnecting.
So it did not perform very well.
The max_keepalive options allows me to set this parameter to the same
value in postfix and the policyd. Then both will drop the connection
after a specified number of requests per connection.
The best solution would be if postfix itself could do some multiplexing
and use a single policyd connection for multiple smtpd like proxymap
does for eg. database tables. Is such a feature planed?
Do you think it would be hard to implement such a feature?