There are a lot of sa-learn processes active slowing down the server until it becomes unresponsive. How can I fix this?

Overview

High server load and system unresponsiveness may occur when multiple sa-learn processes run concurrently. This behavior is typically triggered by configuration issues within SpamAssassin or Dovecot, causing the real-time spam learning sieve filter to enter a loop while attempting to train on email messages.

Immediate Mitigation Steps

To restore normal server performance, execute the following commands to halt the process loop:

  1. Stop the Dovecot service:
    systemctl stop dovecot
  2. Terminate all active sa-learn processes to reduce system load:
    pkill -f sa-learn

Note: Do not restart the Dovecot service until you have applied one of the resolution steps outlined below.

Alternative Configurations

If immediate mitigation is insufficient, adjust the spam training methodology through the Warden interface to prevent real-time processing loops.

Disable Real-Time Learning

Navigate to Warden -> Settings -> Learning Settings -> Sieve learning. Uncheck the Use IMAP sieve learning option and save your changes.

Enable Scheduled Training

As an alternative to real-time processing, configure nightly training by navigating to Warden -> Settings -> Training Settings and enabling the scheduled job.

Traning Settings

Troubleshooting

Address the underlying configuration issue to prevent recurrence. After implementing your chosen resolution, restart the Dovecot service:

systemctl start dovecot

SpamAssassin Configuration Validation

Verify that the SpamAssassin configuration contains no syntax or logical errors by running the following command. A successful execution will return no output:

spamassassin --lint

Dovecot Mailbox Cache Limit Exceeded

This issue may also occur if mailbox dovecot.index.cache files exceed the default 512MB limit enforced by Warden. To resolve this, increase the vsz_limit parameter as documented in the following knowledge base article:

https://www.danami.com/clients/knowledgebase/193/When-logging-into-webmail-you-are-unable-to-read-email.-How-can-I-fix-the-error-Out-of-memory-service-imap--vsz_limitequals512-MB--you-may-need-to-increase-it-in-the-maillog.html

  • sa-learn, server load
  • 3 Users Found This Useful
Was this answer helpful?

Related Articles

How can I fix the error: Host '127.0.0.1' is not allowed to connect to this MariaDB server?

Overview This article provides resolution steps for the MariaDB connection error Host...

How can I fix the error: Parse error at /etc/clamav/clamd.conf Unknown option ScanImage?

Overview The clamav-daemon.service may fail to start due to unrecognized configuration...

How can I fix the error: The domain limit of this license key has been reached?

Overview The Admin and Pro editions of Danami products enforce a maximum domain limit within the...

After upgrading from Centos 7 to AlmaLinux 8 Amavis is treating mail with low scores as spam. How can I fix this?

Overview Following an upgrade from CentOS 7 to AlmaLinux 8, Amavis may incorrectly classify...