Question

Out of memory: Kill process clamd / amavisd

my server is running well for a while then suddenly the service clamd.amavisd failed and cannot start. it say the pid is exist but failed to start and i trace my server. and i suspect it seems memory issue that’s why it terminate clamd.amavisd failed to start (it will work normally back again once i reboot the machine). last time my server is only 700 MB but can run clamav with no issue. and now almost 1 gb and has issue. how to fix it? please help many thanks.

[root@us1 05]# tail -f /var/log/maillog Feb 4 10:24:23 us1 amavis[16189]: (16189-01) (!)connect to /var/spool/amavisd/clamd.sock failed, attempt #1: Can’t connect to UNIX socket /var/spool/amavisd/clamd.sock: 111 Feb 4 10:24:24 us1 amavis[16189]: (16189-01) (!)connect to /var/spool/amavisd/clamd.sock failed, attempt #1: Can’t connect to UNIX socket /var/spool/amavisd/clamd.sock: Connection refused Feb 4 10:24:24 us1 amavis[16189]: (16189-01) (!)ClamAV-clamd: All attempts (1) failed connecting to /var/spool/amavisd/clamd.sock, retrying (2) Feb 4 10:24:30 us1 amavis[16189]: (16189-01) (!)connect to /var/spool/amavisd/clamd.sock failed, attempt #1: Can’t connect to UNIX socket /var/spool/amavisd/clamd.sock: Connection refused Feb 4 10:24:30 us1 amavis[16189]: (16189-01) (!)ClamAV-clamd av-scanner FAILED: run_av error: Too many retries to talk to /var/spool/amavisd/clamd.sock (All attempts (1) failed connecting to /var/spool/amavisd/clamd.sock) at (eval 113) line 600.\n Feb 4 10:24:30 us1 amavis[16189]: (16189-01) (!)WARN: all primary virus scanners failed, considering backups

[root@us1 05]# cat /proc/meminfo MemTotal: 1020400 kB MemFree: 69272 kB Buffers: 3316 kB Cached: 24264 kB SwapCached: 76988 kB Active: 435740 kB Inactive: 445112 kB Active(anon): 424344 kB Inactive(anon): 428988 kB Active(file): 11396 kB Inactive(file): 16124 kB Unevictable: 0 kB Mlocked: 0 kB SwapTotal: 1048568 kB SwapFree: 581576 kB Dirty: 192 kB Writeback: 0 kB AnonPages: 801232 kB Mapped: 11912 kB Shmem: 12 kB Slab: 37264 kB SReclaimable: 12648 kB SUnreclaim: 24616 kB KernelStack: 1184 kB PageTables: 16912 kB NFS_Unstable: 0 kB Bounce: 0 kB WritebackTmp: 0 kB CommitLimit: 1558768 kB Committed_AS: 1859408 kB VmallocTotal: 34359738367 kB VmallocUsed: 7324 kB VmallocChunk: 34359726292 kB HardwareCorrupted: 0 kB AnonHugePages: 55296 kB HugePages_Total: 0 HugePages_Free: 0 HugePages_Rsvd: 0 HugePages_Surp: 0 Hugepagesize: 2048 kB DirectMap4k: 8184 kB DirectMap2M: 1040384 kB

[root@us1 05]# grep -i kill /var/log/messages* | more /var/log/messages:Feb 4 09:40:02 us1 kernel: php invoked oom-killer: gfp_mask=0 x280da, order=0, oom_adj=0, oom_score_adj=0 /var/log/messages:Feb 4 09:40:02 us1 kernel: [<ffffffff81122df2>] ? oom_kill_pr ocess+0x82/0x2a0 /var/log/messages:Feb 4 09:40:02 us1 kernel: Out of memory: Kill process 2442 ( clamd) score 118 or sacrifice child /var/log/messages:Feb 4 09:40:02 us1 kernel: Killed process 2442, UID 494, (cla md) total-vm:507364kB, anon-rss:13376kB, file-rss:4kB /var/log/messages:Feb 4 10:25:39 us1 kernel: clamd invoked oom-killer: gfp_mask =0x201da, order=0, oom_adj=0, oom_score_adj=0 /var/log/messages:Feb 4 10:25:39 us1 kernel: [<ffffffff81122df2>] ? oom_kill_pr ocess+0x82/0x2a0 /var/log/messages:Feb 4 10:25:39 us1 kernel: Out of memory: Kill process 6213 ( amavisd) score 47 or sacrifice child /var/log/messages:Feb 4 10:25:39 us1 kernel: Killed process 6213, UID 494, (ama visd) total-vm:341332kB, anon-rss:5504kB, file-rss:8kB /var/log/messages:Feb 4 10:25:41 us1 kernel: clamd invoked oom-killer: gfp_mask =0x201da, order=0, oom_adj=0, oom_score_adj=0 /var/log/messages:Feb 4 10:25:41 us1 kernel: [<ffffffff81122df2>] ? oom_kill_pr ocess+0x82/0x2a0 /var/log/messages:Feb 4 10:25:41 us1 kernel: Out of memory: Kill process 16872 (clamd) score 48 or sacrifice child /var/log/messages:Feb 4 10:25:41 us1 kernel: Killed process 16872, UID 494, (cl amd) total-vm:125252kB, anon-rss:100376kB, file-rss:72kB /var/log/messages:Feb 4 10:25:55 us1 kernel: clamd invoked oom-killer: gfp_mask =0x201da, order=0, oom_adj=0, oom_score_adj=0 /var/log/messages:Feb 4 10:25:55 us1 kernel: [<ffffffff81122df2>] ? oom_kill_pr ocess+0x82/0x2a0 /var/log/messages:Feb 4 10:25:55 us1 kernel: Out of memory: Kill process 16189 (amavisd) score 44 or sacrifice child


Submit an answer

This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Want to learn more? Join the DigitalOcean Community!

Join our DigitalOcean community of over a million developers for free! Get help and share knowledge in Q&A, subscribe to topics of interest, and get courses and tools that will help you grow as a developer and scale your project or business.

This comment has been deleted

Hello, all

I will recommend you to upgrade the RAM of the server. The current available memory is not enough to handle all the processes.

What I would usually do if I’m getting that error on a Droplet with 1GB of RAM, is to add swap space, that way you would have some extra buffer in case that your RAM is fully exhausted.

You can follow the steps on how to do that here:

https://www.digitalocean.com/community/tutorials/how-to-add-swap-space-on-ubuntu-20-04

Hope that this helps! Regards, Alex

Hi <br>currently my swap file is 1 GB memory is 1 GB. <br>my server is running zpanel+suhosin+clamd+amavisd+wordpress multiuser+whmcs <br>may i know what is the recommended if i want to upgrade my memory? <br>is there any limit to wordpress? because i saw this error message <br> <br>today it happen again. <br>Feb 12 22:53:10 us1 rsyslogd-2177: imuxsock begins to drop messages from pid 1121 due to rate-limiting <br>Feb 12 22:53:41 us1 suhosin[3545]: ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker ‘157.55.34.29’, file ‘/var/zpanel/hostdata/agus/public_html/durianmedan_com/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php’, line 115) <br>Feb 12 22:58:08 us1 rsyslogd-2177: imuxsock lost 13 messages from pid 1121 due to rate-limiting <br>Feb 12 22:58:09 us1 rsyslogd-2177: imuxsock begins to drop messages from pid 1121 due to rate-limiting <br>Feb 12 23:00:03 us1 rsyslogd-2177: imuxsock lost 235 messages from pid 1121 due to rate-limiting <br>Feb 12 23:00:07 us1 suhosin[3545]: ALERT - script tried to increase memory_limit to 268435456 bytes which is above the allowed value (attacker ‘82.145.217.195’, file ‘/var/zpanel/hostdata/agus/public_html/durianmedan_com/wp-content/plugins/all-in-one-seo-pack/all_in_one_seo_pack.php’, line 115) <br>Feb 12 23:01:11 us1 named[913]: error (network unreachable) resolving ‘dlv.isc.org/DNSKEY/IN’: 2001:4f8:0:2::19#53 <br>Feb 12 23:01:11 us1 named[913]: error (network unreachable) resolving ‘dlv.isc.org/DNSKEY/IN’: 2001:500:60::30#53 <br>Feb 12 23:01:11 us1 named[913]: error (network unreachable) resolving ‘dlv.isc.org/DNSKEY/IN’: 2001:500:60::29#53 <br> <br>and <br>clamd dead but subsys locked <br> <br>thanks <br>regards <br>agus halim <br>