The Curious Website Designer

Amavis /Clamd Using CPU 100%

Posted by The Curious Website Designer | Posted on Tue 13 Feb 2018

Amavis /Clamd Using CPU 100%

When my server load was running high for a long time I could see from the list of running processes that amavis / clamd were hogging the CPU time.

Researching the problem on the internet gave few clues as to what the problem was and more importantly, what was the fix.

Here's what did it for me.

It turned out to be a simple solution really:

# systemctl stop clamd.service
# rm -f /var/run/clamd.amavisd/clamd.sock
# systemctl start clamd.service

 

It seems that clamd was unable to open the appropriate socket. I guess removing the file clamd.sock allowed it to find an available one.

If that doesn't work, check the postfix log for clues as to why Clamd might be misbehaving. The file can be found by using the following command in PuTTY:

# tail -100 /var/log/maillog | grep clamd

 

The maillog file contains entries relating to Postfix, Opendkim, Spamassassin and Amavis as well as Clamd.The grep element of the above command filters all log entries that contain the string 'clamd' so it's easier to find the cause of the problem.

 

 

Tags: high server load, amavis, clamd, clamav, server load