At 10:40 PM 11/23/03, you wrote:
Dear list...

(See what happens when I get a question answered?  I come up with
more...)

Is there (I hope!!!) a way to tell spamd not to accept connections if
the system load is at or above a certain threshold?  (i.e. if the system
load is currently 30, don't spawn anymore spamd processes)?

I have a recurring problem where if a server craps out ('cause it's old
and tired, but the owner won't replace/ upgrade it) and I restart it,
the mail out there that queued up while it was down immediately starts
flowing in and crushes the server (and, yes, the server is definitely
underpowered for the volume of mail it's trying to handle - it's a P3
733/256Mb processing upwards of 15-25k messages per day with 1000+ local
mailboxes, often in waves where several hundred users will
simultaneously receive the same message).  I have Sendmail configured to
refuse incoming connections when the load hits 10, but that doesn't stop
the messages that pushed the load up that high from being fed to SA, and
subsequently sending the load to 115+ (!) and going until the server
runs out of swap space and dies (or effectively dies, as all it's
services are no longer able to respond, including console) or I manage
to race to my computer and pull a "The Net" sequel while I madly try to
type faster than the load spools up.
You can limit the number of Spamassassin spamd processes by specifying
the -m argument from the spamd man page:

-m number, --max-children=number
           Specify a maximum number of children to spawn. Spamd will wait
           until another child finishes before forking again. Meanwhile,
           incoming connections will be queued.

           Please note that there is a OS specific maximum of connections that
           can be queued (Try "perl -MSocket -e'print SOMAXCONN'" to find this
           maximum). Also, this option causes spamd to create an extra pipe
           for each child.

Now pick some number for this value, look at the average memory being used
by a spamd process on your machine and divide 256M by that number and it
will give you an approx. upper limit for the value of M assuming nothing else
on the machine.  (Assuming about 25M per spamd process and 256M/25M = 10)
Since there are other things on the machine like sendmail, try something
lower say between 4 - 8, then carefully watch the memory utilization and
adjust accordingly.

Memory is cheap and provided it is not also short on CPU
it is likely that more memory would be useful for that machine providing
it will take more.

Regards,
Lyle Evans
[EMAIL PROTECTED]
rackmount brackets for many networking equipment chassis
http://www.rackears.com




------------------------------------------------------- This SF.net email is sponsored by: SF.net Giveback Program. Does SourceForge.net help you be more productive? Does it help you create better code? SHARE THE LOVE, and help us help YOU! Click Here: http://sourceforge.net/donate/ _______________________________________________ Spamassassin-talk mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/spamassassin-talk

Reply via email to