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?
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
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.
I did this. I used cpulimit but there is two process running background and cpulimit only take care one of them.
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.
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?
Probably because: Or maybe there is an ownership/permissions/config issue where clamav-daemon couldn't create it when it started.
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.
it was only a socket file problem. clamav and amavis is working as they should be now and server load is %2 right now.