ClamAV: Eating memory and stopping mail traffic

Discussion in 'Installation/Configuration' started by Quasdunk, Oct 13, 2012.

  1. Quasdunk

    Quasdunk New Member

    My server (ISPConfig 3, Ubuntu Server 12.04 LTS) has been running for nearly a month now, an I've encountered some issues:
    From time to time the server would stop delivering emails. At first I did not suspect anything special, but it happened three times now, so I had a closer look at my logs. Here's what /var/log/mail.err says:

    So I got a little worried - killing processes and not reaching the DB is not what you want to see in a log. So I had a look at the /var/log/syslog and noticed, that it had something to do with the memory:
    So, as far as I understand, the ClamAV processes require too much memory. The server begins to swap the leaking memory and as soon as it runs out of space it starts killing the most "greedy" processes. Among ClamAV that also includes mysql - so my mailserver (dovecot) stops working and queues everything until I restart the server. But even after a restart it doesn't take a minute to fill 850-900MB of memory - what the...?
    I have 1GB + 512MB swap, which actually should be quite decent for a web-application with ~700-1000 visitors and 70-100 emails per day - shouldn't it? The CPU rarely touches the 10%-mark.

    Running ps aux revealed the following (noteworthy) results:

    So the amavis-processes are consuming abot 30% of my memory, which seem way too much.

    Is that normal?
    Is it required for ISPConfig to work (I couldn't find an option to switch it off...)
    If it is, would it be a bad idea to disable/uninstall ClamAV? In fact, I don't quite see the point of an anti-virus-application on a web-server...
    Or is the only solution to increase the RAM?
    I did some research and it seems I'm not the only one with these observations/complaints - is there an alternative to ClamAV?

    Thanks in advance!
    Last edited: Oct 13, 2012
  2. till

    till Super Moderator Staff Member ISPConfig Developer

    Your memory is low for a full hosting system, you should eiher increase the ram or extend the swap to 2gb.
  3. concept21

    concept21 Member

    Yes, it is.

    ClamAV uses 150MB in order to load itself. :)
  4. concept21

    concept21 Member

    You should also fine tune apache2 and mysql memory usage.

    Search the web info.

    My ispconfig 3 can run at full load at about 500MB ram out of 1GB ram, and 1GB swap, without clamav loaded. :)
  5. glenstewart

    glenstewart New Member

    The fun realities of ClamAV

    This chart should bring some realities home.


    This particular server has 4GB RAM, and is losing almost 10% of that to ClamAV. ClamAV is a great tool - perhaps still the best on Linux, but this is simply the price you have to pay to run it.

    4GB RAM would be the very least I'd put up with to run an internet-facing email server these days.

    Remember, Just because you can doesn't mean you should.

Share This Page