Hello.

I'm curious as to how one might limit the number of simultaneous
spamassassin processes.

I run spamassassin as a procmail filter. It's a fine program, except
when I have a bunch of messages waiting. In that case, here's what
happens.

1. I type `fetchmail'. Fetchmail starts downloading ~50 messages.

2. As fetchmail runs, sendmail spawns procmail processes, which spawn
   spamassassin processes.

3. About halfway through the mail transfer, the number of processes
   hits a critical point and the system runs out of memory, starts
   thrashing the swap partition, and remains wedged for about 20
   minutes.

4. Eventually, the spamassassins finish, and the system responds to
   input again.

Is there any way to rate-limit spamassassin spawning? I thought about
ulimiting the sendmail daemon and its children, but that seems
heavy-handed. I could renice the processes, but this is a memory
problem, not a CPU-time problem.

I know that exim has a limit-simultaneous-deliveries setting, which,
when cranked down to 10, prevented the thrashing, but meant that mail
delivery was very slow, as messages after the first ten were dumped in
the queue to wait for the next run (the same happened to the next
batch, of which the first ten were delivered, and so on). I eventually
gave up using Exim because I missed DSN support.

Would spamc/spamd respond better to an inrush of mail? Or is there a
switch to flip to make procmail or sendmail process the mail serially
-- not by re-queuing it, but by using some form of locking such that
when one spamassassin terminates, another is immediately started?

Thanks,

--Joe
   

Attachment: msg07051/pgp00000.pgp
Description: PGP signature

Reply via email to