Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

clamav eating memory

273 views
Skip to first unread message

Maurizio Caloro

unread,
Feb 13, 2023, 9:20:05 AM2/13/23
to

 

hello Debian group

here iam running Debian 10.13, clamav 0.103.7+dfsg-0+deb10u1

 

but it's this possible that clamav-daemon use 1.2G memory?

try to punish little without getting any negative effects.

 

try to enclose, but after 4-5h the mailserver will freez/break

                >[Service]

                >ExecStart=/usr/sbin/clamd --foreground=true

                >Reload the database

                >MemoryLimit=128M

                >CPUQuota=25

 

/etc# systemctl status clamav-daemon

● clamav-daemon.service - Clam AntiVirus userspace daemon

   Loaded: loaded (/lib/systemd/system/clamav-daemon.service; enabled; vendor preset: enabled)

  Drop-In: /etc/systemd/system/clamav-daemon.service.d

           └─extend.conf

   Active: active (running) since Mon 2023-02-13 14:47:46 CET; 13min ago

     Docs: man:clamd(8)

           man:clamd.conf(5)

           https://docs.clamav.net/

  Process: 31948 ExecStartPre=/bin/mkdir -p /run/clamav (code=exited, status=0/SUCCESS)

  Process: 31949 ExecStartPre=/bin/chown clamav /run/clamav (code=exited, status=0/SUCCESS)

  Process: 31950 ExecStartPre=/bin/touch /var/run/clamav/clamd.ctl (code=exited, status=0/SUCCESS)

  Process: 31951 ExecStartPre=/bin/chown clamav /var/run/clamav/clamd.ctl (code=exited, status=0/SUCCESS)

Main PID: 31952 (clamd)

    Tasks: 2 (limit: 2358)

   Memory: 1.2G

 

thanks for any possible update

 

Darac Marjal

unread,
Feb 13, 2023, 11:12:23 AM2/13/23
to


On 13/02/2023 14:11, Maurizio Caloro wrote:

 

hello Debian group

here iam running Debian 10.13, clamav 0.103.7+dfsg-0+deb10u1

 

but it's this possible that clamav-daemon use 1.2G memory?

Entirely possible. As I recall, clamav-daemon caches the virus definitions in RAM in order to minimise startup speed when handling clients.

In other words, if you're only scanning for viruses occasionally (e.g. mails which have an attachment), you might find switching from "clamdscan" to "clamscan" and not running the daemon suits your purpose.


try to punish little without getting any negative effects.

 

try to enclose, but after 4-5h the mailserver will freez/break

Depending on your system architecture, you could consider running "clamdaemon" on a different host, and configuring "clamdscan" to use a TCP socket. This is particularly beneficial if you have several hosts which need to perform scanning as they can all pass their payload to the central scanning host, and you don't need multiple instances of the daemon.

YMMV.

OpenPGP_signature

Maurizio Caloro

unread,
Feb 13, 2023, 11:30:06 AM2/13/23
to

>>Entirely possible. As I recall, clamav-daemon caches the virus definitions in RAM in order to minimise startup speed when handling clients.

>>In other words, if you're only scanning for viruses occasionally (e.g. mails which have an attachment), you might find switching from "clamdscan" to >>"clamscan" and not running the daemon suits your purpose.

>>Depending on your system architecture, you could consider running "clamdaemon" on a different host, and configuring "clamdscan" to use a TCP socket. >>This is particularly beneficial if you have several hosts which need to perform scanning as they can all pass their payload to the central scanning host, and >>you don't need multiple instances of the daemon.

>>YMMV.

--

 

>Thanks for your answer, this machine are running as VPS, so this Server dont have a lot of memory configured, and running as standalone machine.

>Yes i will try to switch to clamscan, but you know this will impact the E-Mail ScannSpeed or transferspeed?

> 

>Amavis are also like clamd ?, a hungry memory maintainer

>Thanks for your update

>Mauri

 

 

Michel Verdier

unread,
Feb 13, 2023, 12:00:06 PM2/13/23
to
Le 13 février 2023 Maurizio Caloro a écrit :

>>Thanks for your answer, this machine are running as VPS, so this Server dont have a lot of memory configured, and running as standalone machine.
>
>>Yes i will try to switch to clamscan, but you know this will impact the E-Mail ScannSpeed or transferspeed?

Yes because clamscan loads virus base each time you call it. For mails
you need to stick to clamdscan. clamscan is only for running once a
while, manually or perhaps via cron.

>>Amavis are also like clamd ?, a hungry memory maintainer

amavis just links to clamav, spamassassin, etc. So if you config amavis to
call clamav obviously you need the same memory.
0 new messages