Mailing List Archive

[clamav-users] ClamAV in Raspberry Pi with Nextcloud
Hi there, 
I'm using ClamAV on a Raspberry 3 Model B which hosts a Nextcloud instance on an Apache Webserver with a local MariaDB database. The problem is when I boot the Raspberry Pi, clamd starts and uses very much memory making it impossible to connect to the Pi via SSH. The only solution is to be very fast with logging in and then stopping the clamd process. But of course that doesn't make much sense. 
Can anyone please suggest me a configuration to bypass this problem without having to stop the clamd process? 
Thanked n advance. 
Dominik
Re: [clamav-users] ClamAV in Raspberry Pi with Nextcloud [ In reply to ]
Hi Dominik,

I don’t have any good recommendations for you. ClamAV has a fairly high RAM requirement. It uses almost 1GB of RAM just to run, and will use some additional RAM when scanning larger files, and when freshclam tests newly updated databases (a feature that you can disable). While you _may_ be able to get by with just 2GB of RAM on a headless server, users are *recommended* to have 4GB of RAM or more when using ClamAV.

-Micah


Micah Snyder
ClamAV Development
Talos
Cisco Systems, Inc.



From: clamav-users <clamav-users-bounces@lists.clamav.net> on behalf of Dominik Betz <domi.betz@web.de>
Reply-To: ClamAV users ML <clamav-users@lists.clamav.net>
Date: Friday, April 10, 2020 at 3:48 PM
To: "clamav-users@lists.clamav.net" <clamav-users@lists.clamav.net>
Subject: [clamav-users] ClamAV in Raspberry Pi with Nextcloud

Hi there,

I'm using ClamAV on a Raspberry 3 Model B which hosts a Nextcloud instance on an Apache Webserver with a local MariaDB database. The problem is when I boot the Raspberry Pi, clamd starts and uses very much memory making it impossible to connect to the Pi via SSH. The only solution is to be very fast with logging in and then stopping the clamd process. But of course that doesn't make much sense.

Can anyone please suggest me a configuration to bypass this problem without having to stop the clamd process?

Thanked n advance.

Dominik
Re: [clamav-users] ClamAV in Raspberry Pi with Nextcloud [ In reply to ]
Hi there,

> On Fri, 10 Apr 2020, Micah Snyder (micasnyd) via clamav-users wrote:
> > Dominik Betz wrote:
>
> > I'm using ClamAV on a Raspberry 3 Model B which hosts a Nextcloud
> > instance on an Apache Webserver with a local MariaDB database. The
> > problem is when I boot the Raspberry Pi, clamd starts and uses very
> > much memory making it impossible to connect to the Pi via SSH. The
> > only solution is to be very fast with logging in and then stopping
> > the clamd process. But of course that doesn't make much sense.
> >
> > Can anyone please suggest me a configuration to bypass this problem
> > without having to stop the clamd process?
>
> I don’t have any good recommendations for you. ClamAV has a fairly
> high RAM requirement. It uses almost 1GB of RAM just to run, and
> will use some additional RAM when scanning larger files, and when
> freshclam tests newly updated databases (a feature that you can
> disable). While you _may_ be able to get by with just 2GB of RAM on
> a headless server, users are *recommended* to have 4GB of RAM or
> more when using ClamAV.

To clarify what Micah has said, it is the ClamAV databases which are
largely responsible for the memory consumption of the clamd daemon.
If you want to be able to run clamd on a Pi 3B then you will need to
be creative with its databases. Perhaps if you tell us what you want
to achieve by using clamd and/or ClamAV we can offer more help. If
all you want to do is log in to the Pi over SSH you could modify the
boot configuration on the Pi to prevent the ClamAV daemons (freshclam
and clamd) from starting at boot, but you will still run into memory
problems if you start the clamd daemons (or for example run clamscan)
with the default (large) official databases configured to load.

For What It's Worth I've been running clamd on a Raspberry Pi4B with
4G of RAM for several months now. The daemon serves a mail server on
the same LAN segment and is not used for anything else. The mail
server (not on a Pi) runs a milter of my own design which passes the
mail text to the clamd daemon. The same Pi 4B also runs a Postgres
database (the milter queries and updates the database with information
about the mail traffic), plus a couple of VPNs, the Icinga monitoring
system, and finally it also streams a security camera (just a 640x480
Webcam at 2 frames/second looking at our car park - video recording is
done by a second Pi4B which runs many other cameras and 'Motion'). A
NFS server on the LAN provides most of the mass storage for the Pis,
although the Motion server operating system is on a read-only mounted
SD card (this is also planned for the clamd system when it's settled).

After an initial period of learning about some of the foibles of the
4Bs (for example you really don't want to plug in an active USB device
while the 4B is running, or it will probably crash there and then) the
performance has been acceptable. Typically, with the Icinga instance
monitoring a few hundred services, and clamd serving our very lightly
loaded local mail server, the 4B runs at a few percent of its maximum
CPU capacity and about half of the RAM is free. The Pi has replaced a
15 year old dual Opteron server (which consumed 40 times more energy)
and the Pi is ~80dB quieter. Almost as importantly, I no longer have
to schedule any cleaning of air filters because there are no fans. :)

In my experience the Pi 3B+ seems to be more forgiving than the 4B.
Although I use a 3B+ as a thin desktop client and offsite backup
server, for many purposes the maximum available memory rules it out.

--

73,
Ged.

_______________________________________________

clamav-users mailing list
clamav-users@lists.clamav.net
https://lists.clamav.net/mailman/listinfo/clamav-users


Help us build a comprehensive ClamAV guide:
https://github.com/vrtadmin/clamav-faq

http://www.clamav.net/contact.html#ml