clamav high memory usage workarounds

Discussion in 'ISPConfig 3 Priority Support' started by curiousadmin, Apr 13, 2021.

  1. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Hello Community,
    I just noticed that the clamav database actually grew further^ and now I got into situation when the previous setup with 2GB RAM and 4 GB SWAP won't do - I had to upgrade the server to 4 GB RAM and kept the 4 GB swap.
    Is there any reasonable workaround/tweak how to make the clamav less memory hungry?
    I also noticed that the M_RESIDENT and M_SIZE varies from server to server (on both M_SIZE is about 2x 1400MB) while M_RESIDENT on one server is 2x ~1000MB (say server2) while the other server is at 2x ~200MB (say server3). I suppose this very much depends how busy the mailserver is?
    I have found a workaround^ where somebody recommends switching to clamscan to save memory but it feels like really bad idea performance wise...
    I'm running Debian 9.13 and ISPConfig 3.1.x on top...
    Thanks for any thoughts on this.
  2. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    I had some trouble some months ago, and decided to increase SWAP to 8 GB and I use nice to lower the priority of clamav (add nice -n 19 in front of the command).
  3. till

    till Super Moderator Staff Member ISPConfig Developer

  4. curiousadmin

    curiousadmin Member HowtoForge Supporter

    Thanks for this.
    Can you please provide some guidance how to autostart the clamav with low priority? I don't want to manually set it every time I reboot the server via htop...

    Thank you very much.
  5. Th0m

    Th0m ISPConfig Developer Staff Member ISPConfig Developer

    Sorry, I thought your server went out of RAM when doing a manual scan, not anytime when clamav is just running for email filtering.
    clamav should not be using that much RAM all the time - depending on how much mail traffic there is of course.

    I see you are using Debian 9 with ISPConfig 3.1. You should upgrade to a newer ISPConfig version for security reasons, and Debian 9 will be EOL soon. Maybe you can install a new Debian 10 host and migrate to that, instead of debugging this for a long time to migrate later on anyway.

Share This Page