[clamav-users] Multiple Clam Daemons on a single system

Maarten Broekman maarten.broekman at gmail.com
Thu Mar 5 06:55:47 EST 2020


> On Mar 5, 2020, at 05:09, Ashish Poddar via clamav-users <clamav-users at lists.clamav.net> wrote:
> 
> 
> Hi all, 
> 
> We have a situation where we run a clamav daemon to scan files on a system. However, in the process, we only use about 10% CPU in the system. We would naturally like to increase this number. We were thus trying to come up with a way to scan multiple files in parallel on the same system. Is there a way we can spawn multiple clam daemons to do this?

In short, yes. You can run multiple ClamAV daemons. Simply launch each daemon with a different config file for each daemon and then you can have clamdscan processes talking to each of those daemons. At a minimum, you would want to use different sockets for the daemons to listen on. You could set up each daemon to use smaller virus database sets, but that really only impacts the speed at which the daemon reloads when there are database changes. 

Are you trying to reduce the time that it takes to scan your entire system? Or is there some other reason that you are looking to run multiple daemons? “Increasing CPU usage” isn’t generally one of the things people look to do just because it’s low.

> I am aware of the multiscan mode in clamdscan but I want each scan to be a separate process so as to not increase the overall scan time of any one file. Is there a way to do this? Or are there any other alternatives to tackle this situation?

Running multiple clamdscan processes doesn’t require multiple clamd daemons to be running. You can run multiple clamdscan processes against a single clamd daemon and it will just spawn more threads to do the scanning. So, for example, you can have a separate clamdscan process working each user’s home directory in parallel and they should all be able to talk to a single clamd daemon.

—Maarten


More information about the clamav-users mailing list