MailScanner memory spikes

Edward L. Hannaford elhannaford at PSFINC.COM
Thu Oct 23 22:33:40 IST 2003

I'm monitoring MailScanner with mailscanner-mrtg and I've seen some odd behavior:

1) About every 12 hours the server (wagate) shows a memory usage and CPU utilization spike.  The spike lasts for ~ 15 minutes, during which incoming email stacks up.  Afterwards, memory usage plummets, CPU utilization returns to normal, and MailScanner quickly processes the awaiting email.

This was causing severe problems before I reduced the number of MailScanner children to 1.  The server would use up all of its available RAM (512 MB) and slow to a crawl.  SpamAssassin would start timing out.  Email was still processed but very, vveerryy slowly.  I wound up having to move the email flow to an alternate server until wagate returned to normal.

A couple of days ago I managed to stick around until the server started "wigging out" (~ 6:00 P.M.).  Top reported that MailScanner was the CPU hog culprit.

The server is currently functional with only 1 child, however the memory/CPU spike is still present; it just doesn't disable the server anymore.  Any ideas what might cause this?

2) I have MailScanner configured to only run 1 child.  Normally ps ax | grep MailScanner only shows 2 copies running (one parent and one child).  However, every so often a third copy launches.  The third copy doesn't show up in maillog and seems to launch and die quickly (except when the server slows to a crawl).  What is this third copy doing there?

I have, BTW, disabled the mailscanner-mrtg function that watches for MailScanner processes and (re)launches them if they're missing.

-Edward L. Hannaford

More information about the MailScanner mailing list