[SOLVED] clamscan is killing vps..

Discussion in 'General' started by murdocklawless, Jul 26, 2021.

Tags:
  1. hi all,

    I've entry level vps. clamscan is using %100 of cpu. it was not using %100 cpu before. as I remember amavis or clamav got update a week ago, maybe thats why it is using complete cpu power.

    is there any way to limit it's cpu usage?
     
  2. Taleman

    Taleman Well-Known Member HowtoForge Supporter

    I would try to find why clamscan uses so much CPU.
    But to answer your question, use Internet Search Engines with
    Code:
    linux limit cpu of process
     
    murdocklawless likes this.
  3. till

    till Super Moderator Staff Member ISPConfig Developer

    Probably not enough RAM. For a full server that runs all services, you need 2GB RAM or more. If you have enough RAM, then it might be that calamav is nit running as daemon and clamsacn is used instead.
     
    murdocklawless likes this.
  4. I did this. I used cpulimit but there is two process running background and cpulimit only take care one of them.
     
  5. as you said I've only one gig of ram in my vps. so I decided to disable clamav-daemon, clamav-freshclam and amavis services. now cpu utilization is %2 percent.
     
  6. I found the problem. I searched some logs and I saw an error and it was saying it couldn't find a file. there should be a file named clamd.ctl in /var/run/clamav directory. directory was empty so I created this file with correct user permissions and problem solved. however I don't know why this file deleted?
     
  7. Jesse Norell

    Jesse Norell Well-Known Member Staff Member Howtoforge Staff

    Probably because:
    Or maybe there is an ownership/permissions/config issue where clamav-daemon couldn't create it when it started.
     
  8. I don't think so because I saw the same error before disabling daemon.
     
  9. concept21

    concept21 Active Member

    I guess your clamav daemon had overloaded your server and it was killed by Linux OS.
    Please add up to 4GB RAM to your system if you plan to run clamav daemon.

    Even if you do not run clamav as daemon, your clamscan can load all those virus signatures and overload your system.
     
  10. it was only a socket file problem. clamav and amavis is working as they should be now and server load is %2 right now.
     

Share This Page