Cisco-Talos / clamav

ClamAV - Documentation is here: https://docs.clamav.net

Home Page:https://www.clamav.net/

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Clanscan will eat all memory and cpu on an AWS t2.small box

danbuntu opened this issue · comments

Describe the bug

I have an upto date Ubuntu server version 22.04.4 running on AWS as a small instance - 1 cpu and 2gig of ram.

When I run clamscan against a file from the terminal with

clamscan testfile.txt

the cpu spikes to 100%, the memory is gobbled up and the server locks up entirely. I have to force reset it.

Is there any way to limit the memory usage or similar?

How to reproduce the problem

Bring up an AWS server t2.small using the 22.04 aws template

SSH to the server

run clamscan .

wait a minute and watch the server lock up

2GB is not enough RAM to run ClamAV.

https://docs.clamav.net/#recommended-system-requirements

Sorry!

3 gig jeepers

I think I might have solved the problem though. Turned out that AWS Ubuntu boxes don't have swap enabled be default. I created a 1 gig swap file and the scans now work - albeit with high resource usage whilst they run.

Our t2.small our development machines so I think this will be ok. The prod boxes are much bigger.

3 gig jeepers

I know 😞