How do I get SpamAssassin to run faster?
Use [http://www.spamassassin.org/full/3.0.x/dist/spamd/README spamd].
Ensure you are not using a locale that uses UTF-8; UTF-8 character sets have higher overhead for text-processing applications: Utf8Performance
If you are using network tests, install a local DNS server (BIND named, for example) on the same host to cache responses, and set the /etc/resolv.conf file to use that instead of one on another machine.
Consider turning off network tests, and running with "-L", if you can afford a drop in accuracy. (This is not a very good option for most people though.)
Examine the custom rule set files you use.
- Avoid large rule sets, those over 100k or 150k in size. The more rules you have, the slower SA will run.
- Pick rule set files that are more productive. In the SARE families published by Bob Menschel, use files 0 and 1 for productivity / efficiency, and avoid files 2 and 3.
- Remove and re-add rule set files one at a time, and check performance after each change. If one rule set file causes a huge change in performance, take appropriate action.
Examine the custom rules you create. Regular expressions with lots of flexibility use lots of resources. Avoid body rules that use "+" or "*" attributes.