1

On one of our debian squeeze servers, we use a setup of postfix + amavis + dovecot as mailserver. Spamassassin is part of amavis.

Once a day, the process "sa-learn" is started. It is part of spamassassin, training the bayesian filter for it. A good thing, but unfortunately, it exhausts the servers ressources dramatically - the load goes up from 0.5 to 12, the server becomes unresponsive. I have to kill the sa-learn process.

What can I do about it? Is there any chance to make sa-learn behave nice? If there isn't, where can I disable sa-learn? (I did not find any cron start script - the only reference to sa-learn I found is in /usr/sbin/amavisd-new-cronjob, which I commented out with no effect.

2 Answers 2

2

I had a similar issue with response time, until I found out that the SpamAssassin database requires some minimal ongoing maintenance. Are you issuing

sa-learn --force-expire

on a daily basis? It could be that a lack of maintenance has made the database unweildy and it needs to be "trimmed up a bit". Try placing it in a daily cron job and see if the response is better on the next sa-learn run.

2
  • I'm having the same issue. After running this command it took 6 seconds to get the following result: 120598 entries kept, 163338 deleted. token frequency: 1-occurrence tokens: 15.88% token frequency: less than 8 occurrences: 54.11%. Still have to find out if it actually solves my issues but in my case my system could delay for a good 30 seconds.
    – Htbaa
    Feb 6, 2017 at 12:25
  • Just a small update to my previous comment. It does help having run this command. My server still delays from time to time but it seems to be a lot less than before. Maybe I should run sa-learn less frequently and maybe only at night.
    – Htbaa
    Feb 7, 2017 at 11:06
0

I don't think you'd want to disable sa-learn. I'd go this way:

  • Find out how sa-learn gets called (crontab -l, grep -r -i sa-learn /etc/*)
  • Start sa-learn with nice and monitor the load
2
  • Thank you. But I could not find any reference to sa-learn anywhere in /etc/, unfortunately. The only reference I could grep was in /usr/sbin/amavisd-new-cronjob, commenting out did not disable sa-learn.
    – Steffen
    Mar 10, 2011 at 14:01
  • Look in /etc/cron.daily. It may be called from an sa-update script
    – Alex
    Mar 25, 2011 at 17:45

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .