Re: Excessive threads in opendkim-2.2.2 on Solaris 10

From: Jose-Marcio Martins da Cruz <Jose-Marcio.Martins_at_mines-paristech.fr>
Date: Wed, 26 Jan 2011 15:50:29 +0100

Gary Mills wrote:
> On Wed, Jan 26, 2011 at 10:58:39AM +0100, Jose-Marcio Martins da Cruz wrote:
>> Murray S. Kucherawy wrote:

>>
>> One workaround is the libmilter with a pool of workers. Libmilter creates a
>> small number of threads at start-up and allocates a thread to handle one
>> sendmail command, instead of creating one thread per SMTP client. This
>> means a new thread will be created only it the filter effectively need a
>> new thread to handle a sendmail command, not a new SMTP client.
>
> Is this feature recommended for opendkim?

This doesn't depend on which milter you're using. (Well, I'm the author of this patch. 8-)

It's recommended if your server handle many connections simultaneously. Roughly speaking, the mean
number of threads in the traditionnal libmilter is :

        N = connection rate * mean connection time.

If your server handles, say, 10 connections per second and each connection lasts for, say, 10
seconds, the mean number of threads will be 100. If you consider that most of the time these threads
will be idle, say 95 %, the number of thread with this alternative will be reduced by 20 - so 5 threads.

It's also recommended if you have other milters doing heavy processing (e.g. content checking), they
will increase the connection time, so the mean number of threads in the filter... In this case, it's
better to use this in all milters.

> There's a symbol `_FFR_WORKERS_POOL' in sendmail's libmilter
> directory. Is that it? I don't see any documentation for it.

Yes, that's it. It's allways considered as FFR (so no doc), but I'm using this since, I think, 2004
(under Solaris). But you should use the libmilter which come with sendmail 8.14.4, which corrects
all known bugs.

The idea is explained here :
    http://j-chkmail.ensmp.fr/libmilter/workermilter.pdf

> We've been doing that since sendmail-8.12.11. For more recent
> versions, it's done this way:
>
> APPENDDEF(`conf_libmilter_ENVDEF', `-DSM_CONF_POLL')

Yes, you're right. Either way, if you define _FFR_USE_POLL, SM_CONF_POLL will be implicitly defined.

-- 
  ---------------------------------------------------------------
  Jose Marcio MARTINS DA CRUZ           http://j-chkmail.ensmp.fr
  Ecole des Mines de Paris
  60, bd Saint Michel                      75272 - PARIS CEDEX 06
  mailto:Jose-Marcio.Martins_at_mines-paristech.fr
Received on Wed Jan 26 2011 - 17:08:45 PST

This archive was generated by hypermail 2.2.0+W3C-0.50 : Wed Jan 26 2011 - 21:50:01 PST