How can I optimize the performance of Amavis for processing large volumes of email?

Optimize the Number of Amavis Processes

How fast Amavis can process email is directly tied to Max servers option under Warden -> Settings -> Filter Settings. More information:

Enable a Local Caching DNS Resolver

You can speed up DNS queries used by Amavis by enabling a local caching DNS resolver. More information:

Enable the Redis Storage Engine

For very high volume servers we recommend switching from the default MySQL storage back end used for anti-spam Bayes learning to the Redis back end. More information:

Enable the plugin

This plugin will compile the SpamAssassin rules into native-code in order to provide significant speedups in rule evaluation. More information:

Whitelist Specific Senders

If you have certain senders that are sending out large amounts of email (newsletters) then you can exclude them from anti-spam or anti-virus scanning under Warden -> Settings -> Policy Banks. More information:

Disable the TxRep plugin (optional)

If your server processes a lot of email and your MySQL/MariaDB is overloaded you may want to disable the TxRep plugin as it will add about 10 additional DB queries per email and will slow down the the anti-spam learning (Amavis will still perform well with it disabled). You can disable it under Warden -> Settings -> Plugin Settings -> uncheck the TxRep checkbox and press the update button to apply the changes.

Optimize MySQL/MariaDB

Optimizing MySQL is outside the scope of this article but we recommend that advanced users use the MySQL tuner script from the link below.

To download and run the MySQLTuner script (MySQL should have not been restarted in a few days otherwise you will not get accurate results):

wget -O
wget -O basic_passwords.txt
wget -O vulnerabilities.csv
chmod +x

Viewing the Processing Time

To view how long a message took to be processed by Amavis go to Warden -> Logs -> Message log and click on the plus icon next to an entry. The processing time will be listed at the end on the message (in milliseconds).

  • optimize, performance
  • 0 Users Found This Useful
Was this answer helpful?

Related Articles

How do I fix the error: Mysql Server has gone away?

When looking at the mail log of the server you see this log entry from Amavis: Aug 3 01:00:20...

What changes does Warden make to the postfix configuration files to enable Amavis?

Important Warden will configure postfix differently depending if you selected to install the...

How hard is it to uninstall if I do not require Warden Anti-spam and Virus Protection any more?

Uninstalling Warden is as easy as going to Extensions -> My Extensions -> Warden Anti-spam...

How can I fix the error: host[] said: 552 5.3.4 Declared message size (1208029 B) exceeds size limit for recipient?

You can set the message size limit for Amavis under Settings -> Policy Settings -> Misc...

How do I fix the error: Unit is masked. when trying to start SpamAssassin?

You should not try to start the SpamAssassin service. Warden disables (masks) the SpamAssassin...