Hi there,

On Wed, 2 Dec 2009 Gordan Bobic wrote:

> Can anyone explain why clamd 0.95.3 might use 190MB of RAM after 5
> days of light usage (few hundred emails)? It is the single biggest
> process on my mail servers, and I'm not convinced it's size is
> reasonably justifiable.

It's perfectly normal.  At the moment, each of my clamd processes uses
a little over 200M.  The important thing to watch is how it changes
with time.  Every now and then I'll plot a graph, and investigate any
unexplained changes.

http://www.jubileegroup.co.uk/JOS/misc/clamav-milter-0.88.7.jpg
http://www.jubileegroup.co.uk/JOS/misc/clamav-milter-0.91.1.jpg
http://www.jubileegroup.co.uk/JOS/misc/clamav-milter-0.94.1.gif
http://www.jubileegroup.co.uk/JOS/misc/clamd-0.95.3.gif
http://www.jubileegroup.co.uk/JOS/misc/virus_database_count.gif

I doo sometimes see sudden step changes but they're usually artifacts
of the, er, fragile data collection process in my systems rather than
signs of a bug.  There were some problems with multiple loading of the
databases and memory leaks a while ago but I think they've been solved
for a quite while.  From the behaviour of my clamd daemons, the memory
consumption of the current version seems fine to me.

> The database files under /var/lib/clamav use about 70MB.
> So, even assuming this is kept in memory at all times, where does the
> other 120MB come from?

Your approach is much too simplistic.  The database contains regular
expressions.  These are not necessarily used verbatim by the scanning
engine, they may have to be compiled first.  This can result in much
greater memory usage than the database file sizes might suggest.

If you have a mail server which is exchanging mail, scanning for
viruses and doing very little else I would suggest that a gigabyte of
RAM is a reasonable starting point, and fifteen to twenty percent of
that for malware scanning is also reasonable.  Two gigabytes would
be better if the machine is at all busy.

--

73,
Ged.
_______________________________________________
Help us build a comprehensive ClamAV guide: visit http://wiki.clamav.net
http://www.clamav.net/support/ml

Reply via email to