Fixing spamassassin high load problems on Ensim.

Friday, May 16, 2008 11:58
Posted in category Linux

If you are running one or more Ensim (for Linux) servers,  every now and then you might experience high CPU loads caused by a spamd process. This could mean that the datafiles spamassassin uses for a specific user are getting to big, or that one of them is corrupt.

This can easily be fixed.
Check what file or user is causing this high load by checking the open files of the spamd process in question. First use ‘top’ to see what the process id of the spamd process causing the problem is:

[pid] 22302     15   0 32140  26m 2312 S   100  0.7   0:00.33 spamd

Then, list the open files of that process id:

lsof -p [pid]

In the output, you will a few lines like this one;

spamd   18766    22302   11u   REG        8,3   651264  64784618 /home/virtual/site[id]/fst/home/[user]/.spamassassin/bayes_seen
lsof: no pwd entry for UID 22302
spamd   18766    22302   13uW  REG        8,3     1050  64784616 /home/virtual/site[id]/fst/home/[user]/.spamassassin/bayes.mutex
lsof: no pwd entry for UID 22302
spamd   18766    22302   14u   REG        8,3  5332992  64784630 /home/virtual/site[id]/fst/home/[user]/.spamassassin/bayes_toks

Enter the following commands:

chroot /home/virtual/site[id]/fst
cd /home/[user]/
sa-learn --dump magic
sa-learn --sync -D
sa-learn --dump magic

Now restart spamassassin.

That should fix the problem!

You can leave a response, or trackback from your own site.

Leave a Reply

You must be logged in to post a comment.