Topic: Clamd high CPU usage
============ Required information ====
- iRedMail version (check /etc/iredmail-release): 0.9.2
- Linux/BSD distribution name and version: Centos 7 (1 CPU, 1GB RAM)
- Store mail accounts in which backend (LDAP/MySQL/PGSQL): MySQL
- Web server (Apache or Nginx): Apache 2.4.6
- Manage mail accounts with iRedAdmin-Pro? No
- Related log if you're reporting an issue:
====
Hi, thank you for iRedMail! It is working great! I followed the installation notes and did exactly what was told and it worked in 5 minutes!
My problem: I woke up to day with the Linode notification that CPU usage is ore than 100% in my mail server.
I took a look and found out following:
1- in top results: clamd with amavis user is eating the CPU, 99%.
2- in /var/log/messages: many repeated messages for killing and restarting clamd:
Sep 7 13:17:46 mx kernel: mysqld invoked oom-killer: gfp_mask=0x201da, order=0, oom_score_adj=0
Sep 7 13:17:46 mx kernel: mysqld cpuset=/ mems_allowed=0
Sep 7 13:17:46 mx kernel: CPU: 0 PID: 3742 Comm: mysqld Not tainted 4.1.5-x86_64-linode61 #7
Sep 7 13:17:46 mx kernel: Hardware name: QEMU Standard PC (i440FX + PIIX, 1996), BIOS rel-1.8.1-0-g4adadbd-20150316_085822-nilsson.home.kraxel.org 04/01/2014
Sep 7 13:17:46 mx kernel: 0000000000000000 0000000000000000 ffffffff8199ad1d ffff88003c6cf380
Sep 7 13:17:46 mx kernel: ffffffff819957d8 ffffffff81139cad ffff88003e031000 ffff88003e031000
Sep 7 13:17:46 mx kernel: ffffffff811b5a83 ffff880029a9ba08 01ff880029a9ba08 0000000000000000
Sep 7 13:17:46 mx kernel: Call Trace:
Sep 7 13:17:46 mx kernel: [<ffffffff8199ad1d>] ? dump_stack+0x40/0x50
Sep 7 13:17:46 mx kernel: [<ffffffff819957d8>] ? dump_header+0x7b/0x1fe
Sep 7 13:17:46 mx kernel: [<ffffffff81139cad>] ? css_next_descendant_pre+0x1c/0x34
Sep 7 13:17:46 mx kernel: [<ffffffff811b5a83>] ? mem_cgroup_iter+0x117/0x319
Sep 7 13:17:46 mx kernel: [<ffffffff811b8f06>] ? vmpressure+0x1e/0x78
Sep 7 13:17:46 mx kernel: [<ffffffff811793d2>] ? oom_kill_process+0xc5/0x387
Sep 7 13:17:46 mx kernel: [<ffffffff81178fba>] ? find_lock_task_mm+0x2c/0x7b
Sep 7 13:17:46 mx kernel: [<ffffffff810dfded>] ? has_ns_capability_noaudit+0x13/0x1b
Sep 7 13:17:46 mx kernel: [<ffffffff81179b19>] ? __out_of_memory+0x433/0x473
Sep 7 13:17:46 mx kernel: [<ffffffff81179c9a>] ? out_of_memory+0x52/0x67
Sep 7 13:17:46 mx kernel: [<ffffffff8117ddf5>] ? __alloc_pages_nodemask+0x724/0x862
Sep 7 13:17:46 mx kernel: [<ffffffff811ac081>] ? alloc_pages_current+0xb2/0xcf
Sep 7 13:17:46 mx kernel: [<ffffffff811784ba>] ? filemap_fault+0x280/0x3b4
Sep 7 13:17:46 mx kernel: [<ffffffff81196b29>] ? __do_fault+0x3f/0x79
Sep 7 13:17:46 mx kernel: [<ffffffff8119a5e5>] ? handle_mm_fault+0x3c3/0xf18
Sep 7 13:17:46 mx kernel: [<ffffffff8111c67d>] ? hrtimer_try_to_cancel+0xa0/0xab
Sep 7 13:17:46 mx kernel: [<ffffffff8114781c>] ? __audit_syscall_exit+0x208/0x224
Sep 7 13:17:46 mx kernel: [<ffffffff8104522c>] ? __do_page_fault+0x320/0x37b
Sep 7 13:17:46 mx kernel: [<ffffffff819a3808>] ? async_page_fault+0x28/0x30
Sep 7 13:17:46 mx kernel: Mem-Info:
Sep 7 13:17:46 mx kernel: active_anon:221029 inactive_anon:1945 isolated_anon:0
active_file:45 inactive_file:45 isolated_file:0
unevictable:0 dirty:0 writeback:0 unstable:0
slab_reclaimable:2996 slab_unreclaimable:5528
mapped:632 shmem:2007 pagetables:6387 bounce:0
free:1952 free_pcp:38 free_cma:0
Sep 7 13:17:46 mx kernel: Node 0 DMA free:3944kB min:60kB low:72kB high:88kB active_anon:8976kB inactive_anon:188kB active_file:0kB inactive_file:0kB unevictable:0kB isol$
Sep 7 13:17:46 mx kernel: lowmem_reserve[]: 0 972 972 972
Sep 7 13:17:46 mx kernel: Node 0 DMA32 free:3864kB min:3956kB low:4944kB high:5932kB active_anon:875140kB inactive_anon:7592kB active_file:180kB inactive_file:180kB unevi$
Sep 7 13:17:46 mx kernel: lowmem_reserve[]: 0 0 0 0
Sep 7 13:17:46 mx systemd: clamd@amavisd.service: main process exited, code=killed, status=9/KILL
Sep 7 13:17:46 mx systemd: Unit clamd@amavisd.service entered failed state.
Sep 7 13:17:46 mx kernel: Node 0 DMA: 2*4kB (MR) 1*8kB (R) 0*16kB 1*32kB (R) 1*64kB (R) 0*128kB 1*256kB (R) 1*512kB (R) 1*1024kB (R) 1*2048kB (R) 0*4096kB = 3952kB
Sep 7 13:17:46 mx kernel: Node 0 DMA32: 4*4kB (ER) 1*8kB (R) 0*16kB 0*32kB 2*64kB (R) 1*128kB (R) 0*256kB 1*512kB (R) 1*1024kB (R) 1*2048kB (R) 0*4096kB = 3864kB
Sep 7 13:17:46 mx kernel: 2101 total pagecache pages
Sep 7 13:17:46 mx kernel: 0 pages in swap cache
Sep 7 13:17:46 mx kernel: Swap cache stats: add 0, delete 0, find 0/0
Sep 7 13:17:46 mx kernel: Free swap = 0kB
Sep 7 13:17:46 mx kernel: Total swap = 0kB
Sep 7 13:17:46 mx kernel: 262014 pages RAM
Sep 7 13:17:46 mx kernel: 0 pages HighMem/MovableOnly
Sep 7 13:17:46 mx kernel: 8261 pages reserved
Sep 7 13:17:46 mx kernel: [ pid ] uid tgid total_vm rss nr_ptes nr_pmds swapents oom_score_adj name
Sep 7 13:17:46 mx kernel: [ 1784] 0 1784 29970 683 30 3 0 0 systemd-journal
Sep 7 13:17:46 mx kernel: [ 1801] 0 1801 10256 134 25 3 0 -1000 systemd-udevd
Sep 7 13:17:46 mx kernel: [ 2699] 0 2699 12795 117 26 3 0 -1000 auditd
Sep 7 13:17:46 mx kernel: [ 2729] 0 2729 82403 4253 81 3 0 0 firewalld
Sep 7 13:17:46 mx kernel: [ 2730] 70 2730 7021 89 19 3 0 0 avahi-daemon
Sep 7 13:17:46 mx kernel: [ 2738] 998 2738 6701 70 18 3 0 0 chronyd
Sep 7 13:17:46 mx kernel: [ 2742] 70 2742 6988 57 17 3 0 0 avahi-daemon
Sep 7 13:17:46 mx kernel: [ 2744] 0 2744 67928 260 36 3 0 0 rsyslogd
Sep 7 13:17:46 mx kernel: [ 2745] 0 2745 137540 2618 86 3 0 0 tuned
Sep 7 13:17:46 mx kernel: [ 2746] 81 2746 6675 142 18 3 0 -900 dbus-daemon
Sep 7 13:17:46 mx kernel: [ 2747] 0 2747 8673 79 23 3 0 0 systemd-logind
Sep 7 13:17:46 mx kernel: [ 2749] 0 2749 31577 155 18 3 0 0 crond
Sep 7 13:17:46 mx kernel: [ 2759] 0 2759 27503 34 10 3 0 0 agetty
Sep 7 13:17:46 mx kernel: [ 2760] 0 2760 27503 31 10 3 0 0 agetty
Sep 7 13:17:46 mx kernel: [ 2806] 0 2806 111656 450 67 4 0 0 NetworkManager
Sep 7 13:17:46 mx kernel: [ 2845] 999 2845 128597 880 51 3 0 0 polkitd
Sep 7 13:17:46 mx kernel: [ 3394] 0 3394 20629 214 44 3 0 -1000 sshd
Sep 7 13:17:46 mx kernel: [ 3395] 0 3395 139460 1838 207 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 3438] 27 3438 28838 78 13 3 0 0 mysqld_safe
Sep 7 13:17:46 mx kernel: [ 3557] 2001 3557 219948 5830 258 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 3564] 48 3564 140676 2411 208 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 3565] 48 3565 140735 2501 209 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 3576] 0 3576 205582 2038 76 3 0 0 fail2ban-server
Sep 7 13:17:46 mx kernel: [ 3619] 0 3619 54885 5349 61 4 0 0 linode-longview
Sep 7 13:17:46 mx kernel: [ 3726] 27 3726 311097 20845 110 4 0 0 mysqld
Sep 7 13:17:46 mx kernel: [ 3762] 2002 3762 75577 3216 67 3 0 0 python
Sep 7 13:17:46 mx kernel: [ 3833] 0 3833 23935 271 45 4 0 0 master
Sep 7 13:17:46 mx kernel: [ 3838] 89 3838 24010 275 49 3 0 0 qmgr
Sep 7 13:17:46 mx kernel: [ 3869] 2003 3869 78171 5162 71 4 0 0 cbpolicyd
Sep 7 13:17:46 mx kernel: [ 3870] 2003 3870 78171 5177 71 4 0 0 cbpolicyd
Sep 7 13:17:46 mx kernel: [ 3878] 995 3878 94379 25692 130 3 0 0 /usr/sbin/amavi
Sep 7 13:17:46 mx kernel: [ 3928] 995 3928 118796 31251 146 3 0 0 /usr/sbin/amavi
Sep 7 13:17:46 mx kernel: [ 3929] 995 3929 113278 25781 133 3 0 0 /usr/sbin/amavi
Sep 7 13:17:46 mx kernel: [ 3930] 995 3930 113625 26100 135 3 0 0 /usr/sbin/amavi
Sep 7 13:17:46 mx kernel: [ 3931] 995 3931 94767 25693 128 3 0 0 /usr/sbin/amavi
Sep 7 13:17:46 mx kernel: [ 3933] 0 3933 3907 76 13 3 0 0 dovecot
Sep 7 13:17:46 mx kernel: [ 3939] 2000 3939 3659 40 12 3 0 0 lmtp
Sep 7 13:17:46 mx kernel: [ 3940] 97 3940 2330 37 10 3 0 0 anvil
Sep 7 13:17:46 mx kernel: [ 3941] 0 3941 2362 81 11 3 0 0 log
Sep 7 13:17:46 mx kernel: [ 3943] 2000 3943 3659 40 13 3 0 0 lmtp
Sep 7 13:17:46 mx kernel: [ 3944] 2000 3944 3659 40 11 3 0 0 lmtp
Sep 7 13:17:46 mx kernel: [ 3945] 2000 3945 3659 41 13 4 0 0 lmtp
Sep 7 13:17:46 mx kernel: [ 3946] 2000 3946 3659 41 14 3 0 0 lmtp
Sep 7 13:17:46 mx kernel: [ 3947] 0 3947 4206 333 14 3 0 0 config
Sep 7 13:17:46 mx kernel: [ 3949] 0 3949 34446 309 71 3 0 0 sshd
Sep 7 13:17:46 mx kernel: [ 3951] 2004 3951 34484 316 68 3 0 0 sshd
Sep 7 13:17:46 mx kernel: [ 3952] 2004 3952 28840 74 14 3 0 0 bash
Sep 7 13:17:46 mx kernel: [ 3975] 0 3975 47851 214 51 3 0 0 sudo
Sep 7 13:17:46 mx kernel: [ 3976] 0 3976 45016 132 45 3 0 0 su
Sep 7 13:17:46 mx kernel: [ 3977] 0 3977 28840 104 13 3 0 0 bash
Sep 7 13:17:46 mx kernel: [ 4014] 48 4014 167223 3291 216 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 4036] 48 4036 140042 2449 206 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 4046] 48 4046 167218 3156 214 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 4051] 48 4051 140732 2449 208 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 4055] 48 4055 140730 2497 209 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 4058] 48 4058 140038 2402 206 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 4060] 48 4060 140734 2499 209 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 4148] 48 4148 140003 2380 206 3 0 0 httpd
Sep 7 13:17:46 mx kernel: [ 4228] 0 4228 42091 213 38 3 0 0 crond
Sep 7 13:17:46 mx kernel: [ 4229] 0 4229 28281 38 12 3 0 0 freshclam-sleep
Sep 7 13:17:46 mx kernel: [ 4234] 0 4234 26975 18 10 3 0 0 sleep
Sep 7 13:17:46 mx kernel: [ 4794] 89 4794 23965 265 48 3 0 0 tlsmgr
Sep 7 13:17:46 mx kernel: [ 4938] 996 4938 11323 186 25 3 0 0 imap-login
Sep 7 13:17:46 mx kernel: [ 4944] 2000 4944 5942 227 19 3 0 0 imap
Sep 7 13:17:46 mx kernel: [ 4945] 996 4945 11323 185 27 3 0 0 imap-login
Sep 7 13:17:46 mx kernel: [ 4946] 2000 4946 5948 170 16 3 0 0 imap
Sep 7 13:17:46 mx kernel: [ 4949] 996 4949 11323 185 25 3 0 0 imap-login
Sep 7 13:17:46 mx kernel: [ 4950] 2000 4950 5937 206 17 3 0 0 imap
Sep 7 13:17:46 mx kernel: [ 4951] 996 4951 11323 186 28 3 0 0 imap-login
Sep 7 13:17:46 mx kernel: [ 4952] 2000 4952 5875 111 16 3 0 0 imap
Sep 7 13:17:46 mx kernel: [ 5072] 89 5072 23963 263 47 3 0 0 pickup
Sep 7 13:17:46 mx kernel: [ 5087] 995 5087 136326 77517 199 3 0 0 clamd
Sep 7 13:17:46 mx kernel: [ 5120] 89 5120 25174 362 48 3 0 0 smtpd
Sep 7 13:17:46 mx kernel: [ 5121] 89 5121 42517 359 50 3 0 0 proxymap
Sep 7 13:17:46 mx kernel: [ 5122] 89 5122 23960 265 47 4 0 0 anvil
Sep 7 13:17:54 mx kernel: [ 5127] 89 5127 23965 264 49 3 0 0 trivial-rewrite
Sep 7 13:17:54 mx kernel: [ 5134] 2003 5134 78171 5138 71 4 0 0 cbpolicyd
Sep 7 13:17:54 mx kernel: [ 5135] 89 5135 23999 268 48 4 0 0 cleanup
Sep 7 13:17:54 mx kernel: [ 5142] 89 5142 24090 305 50 3 0 0 smtp
Sep 7 13:17:54 mx kernel: [ 5149] 97 5149 43247 265 54 3 0 0 dict
Sep 7 13:17:54 mx kernel: [ 5150] 89 5150 24070 287 48 3 0 0 smtpd
Sep 7 13:17:54 mx kernel: [ 5153] 89 5153 24658 360 50 3 0 0 smtpd
Sep 7 13:17:54 mx kernel: [ 5154] 2003 5154 78171 5138 71 4 0 0 cbpolicyd
Sep 7 13:17:54 mx kernel: [ 5159] 0 5159 23975 267 47 4 0 0 pipe
Sep 7 13:17:54 mx kernel: [ 5164] 0 5164 235757 12311 156 4 0 0 yum
Sep 7 13:17:54 mx kernel: [ 5236] 995 5236 98160 76230 192 3 0 0 clamd
Sep 7 13:17:54 mx kernel: Out of memory: Kill process 5236 (clamd) score 301 or sacrifice child
Sep 7 13:17:54 mx kernel: Killed process 5236 (clamd) total-vm:392640kB, anon-rss:304920kB, file-rss:0kB
Sep 7 13:17:55 mx systemd: clamd@amavisd.service holdoff time over, scheduling restart.
Sep 7 13:17:55 mx systemd: Stopping clamd scanner (amavisd) daemon...
Sep 7 13:17:55 mx systemd: Starting clamd scanner (amavisd) daemon...
Sep 7 13:17:55 mx systemd: Started clamd scanner (amavisd) daemon.
I posted log for 13:17, but this same logging is repeating all the time, messages file is filled with this repeating messages.
I am very new to iRedMail, also mail server maintenance. If more information needed to give any answer to my problem, I'll be happy to add.
Thank you very much, even for reading.
Suat
----
Spider Email Archiver: On-Premises, lightweight email archiving software developed by iRedMail team. Supports Amazon S3 compatible storage and custom branding.