> so you are running 30 per child and 6 children?  180 total.  how many
messages a day are you handling.  I upped my children from 5 to 15 thinking
that would help but it hasn't.  I was thinking of taken connections down to
5 or 6 on 15 children.  maybe I have it backwards?  I don't have anything
else running on this computer at all so I was thinking I wanted to use up
all the memory with children. is that off?

30 connections on 6 children is a reasonable number for many smaller sites,
the type that average probably less than 10K mails/day, at a guess.  It
should work reasonably well on the typical system with at least 500MB of
memory and a 500MHz or faster processor.

With a slower processor, or certainly with less memory, you might want to
take the number of children down, and possibly the number of connections.

Simple description on how this stuff works:

spamd fires off some number of children determined by -m, with the default
of 5.

Each child takes some amount of memory.  This is typically 30-60MB *per
child* depending on the number of rules files you have.  It will start a bit
smaller than that, and will typically grow over the first dozen or so mails.

If you have a lot of rules so your spamd children are taking 60MB each, 5 *
60 = 300MB.  You better have a 512MB system or larger or you will be in heap
big trouble.  Even at 30MB, 30 * 5 = 150MB.  This would probably work in a
256M system, but maybe not.  You might want -m 3 or so in this case.

Each child will process --max-conn-per-child messages before it dies and a
new child is created in its place.  If all mail was pretty much the same,
and if the children did nothing but process mail, this really shouldn't
matter.

But the real fact is that all mail isn't the same.  Some are very large.
They should be limited to 250K or so, but some programs like qmail don't
necessarily limit the mail size in the standard configuration.

It is NOT a direct relation from mail size to spamd child size!  A 250KB
mail might easily crank a child up to 250MB!

Once the child gets big, it just stays that way.  If you feed large mails to
SA, you cen get some really fat children.  5 children at 250MB each aren't
going to fit well in a 512MB system.

If you only let each child process a few messages before dying, if it
happens to process one large message and gets big, it will only stay big for
a few messages before going away.  Chances are relatively small that all the
children will manage to get fat at the same time, so you will probably
survive just fine.  With a large value of max con per child (like the
default) it is pretty easy to get all the children fat at once.

Spamd children also do other things than just process mail.  Like doing
database expiration runs.  These tend to get the children very fat,
especially have you have a database that has somehow gotten out of control.
Again, this causes Bad Things(tm) if it happens to a lot of the children at
once.

        Loren

Reply via email to