my mail server is drowning

Julian Field mailscanner at
Wed May 7 07:59:53 IST 2003

1) switch off bayes support in SpamAssassin
2) reduce number of children to 2
3) temporarily try f-prot instead of sophossavi
4) get rid of your auto-whitelist completely

If you are doing lots of paging, then memory is surely your problem, not
CPU. Context switching on SPARC architectures is quite an expensive
operation, so if it is spending 30% of its CPU doing nothing other than
context-switching, you have already lost most of 1 CPU. You need to get the
paging figure down.

One other alternative which might be worth it as a temporary test, is to
use an Intel box instead of a SPARC one. You can still run Solaris on it,
no problem, but context switching is a lot cheaper on Intel than SPARC.

At 20:28 06/05/2003, you wrote:
>Setup: Sun E220R (2 450 MHZ CPUS, 2 GB memory), Solaris 8,
>MailScanner-4.20-3, sophos 3.69, sophosavi, sendmail 8.12.9,
>spamassassin 2.53 (bayes learning on).  Other stuff running
>on the box: qpopper 4.0.5, mailman 2.1.2.
>Problem: It can't keep up with the mail traffic.  We get roughly
>25K messages a day.  I didn't really have this problem until after
>sophos 3.67 came out, it has been getting worse even with sophossavi.
>A backlog forms in in the morning and the box can't keep up
>during the day.  Right now (1:30 PM), I've got slightly more than 1000
>messages waiting on MailScanner.  My system load (uptime load)
>is a steady a steady 10 to 12, sar shows roughly 70% usr, 30% sys
>with no idle.  vmstat shows that the system is doing memory paging
>like crazy (pi=5K).  Iostat is not outrageous on anything, so the issue
>seems to be lack of CPU.
>"top" shows that MailScanner is a real heavyweight on memory usage.
>Each process is roughly 40M is size, with most of that resident in
>memory.  The only other heavy memory user is named (170 to 190 MB).
>I've tried tuning MS by changing the number of emails per scan (25 to 100),
>the number of children (4 to 10, currently running 6).  Nothing helps.
>It takes MS several minutes to chomp on 100 messages -- time enough for
>100 more messages to roll in.
>Any suggestions for tuning?  Any ideas why MS takes so much memory?
>Is this related to the bayes learning in SA?  I've noticed that the
>files in /var/spool/spamassassin are big:
>-rw-r--r--   1 root     daemon   1335296 May  6 13:49 auto-whitelist
>-rw-------   1 root     daemon       112 May  6 13:49 bayes.lock
>-rw-------   1 root     daemon        98 May  6 13:49 bayes.lock.emerald.14132
>-rw-------   1 root     daemon     45468 May  6 13:49 bayes_journal
>-rw-------   1 root     daemon        54 May  6 13:49 bayes_msgcount
>-rw-r--r--   1 root     daemon   10559488 May  6 13:49 bayes_seen
>-rw-------   1 root     daemon   7700480 May  6 13:49 bayes_toks
>and that lsof shows me that bayes_seen and bayes_toks files are used
>by MS processes.  Maybe the size of these files related to the memory
>usage of MS?
>--- Jeff Earickson
>     Colby College

Julian Field
MailScanner thanks transtec Computers for their support

More information about the MailScanner mailing list