On Fri, 23 Sep 2005, Lefteris Tsintjelis wrote:
> I see a lot of forking ever since I switched to 3.1. Is there a
> way to tell the maximum and the average number of forks reached?

I'm afraid I don't know what `the maximum and the average number of
forks reached' means. Maxima and minima are set by the --max-children,
--min-children, --max-spare, and --min-spare options to spamd: see the
spamd manpage.

To see how many forks and cleanups of spamd children there have been,
grep for 'spamd.*handled cleanup of child' and
`spamd.*server successfully spawned' in the spamd syslog.

> If so, would it be more efficient in terms of speed to switch
> back to the old method or the difference is really negligible
> up to a certain number of forks?

Unix systems are optimized for *fast* forking. My P233 Linux box can do
hundreds of do-nothing forks per second, and the 1.3GHz Athlon across
the room is quite capable of a thousand a second.

Compared to the overhead of spam scanning, forks are nearly free,
especially when you consider that in a mail spike or lengthy flood
children will get forked once and then left to chew as hard as possible
until the load reduces, when the excess will get zapped again.

Round-robining is much, *much* less efficient, because the working sets
of all children will have to be kept swapped in as long as any mail
flows (even if you have more children running than the load requires),
and because the dcache will be constantly thrashing between the working
sets of all those processes. (This latter effect might be considered
marginal, but in heavy mail flows, it is quite noticeable. Main memory
is *slow* compared to cache --- and, of course, the disk is far slower
yet. The disk that you will be hitting much sooner if you use round-
robin because its use of virtual memory is so bad.)

Round-robining is still there as an option, but mainly because the
preforking code is seemingly not quite bug-free everywhere yet (there
are still strange intermittent problems being reported by a few people).

-- 
`One cannot, after all, be expected to read every single word
 of a book whose author one wishes to insult.' --- Richard Dawkins

Reply via email to