'spamd' bottleneck after update

vs-fam

Active Member
PartnerNOC
Mar 18, 2010
34
4
58
Hi,

We have noticed, after the latest cPanel update, a unbearable bottleneck caused by 'spamd'. SMTP timeouts while trying to send, RoundCube and the like timing out, etc. Even though we get these errors, most of the time the email does get sent, however, all email clients claim that emails are not sent leaving them on the outgoing tray.

The minute we disable all types of SPAM scans, everything goes back to normal.

Anyone else seeing these behavior?

Thanks
 
  • Like
Reactions: HOTNET

Jaxson Chin

Registered
Oct 20, 2015
1
0
1
malaysia
cPanel Access Level
Root Administrator
Hi,

Im having a problem that spamd.child keeps getting high load and causing email not able to be sent out.

The process is as below:
17747 cpanelex 20 0 210m 70m 3600 R 100.0 3.7 2:11.17 spamd child

May i know what application is using the user access "cpanelex"? And what is the cause?

I saw some article mentioned that it was cause by Spam Assassin Recent update.


Kindly Advice.

Thank You.
 

4u123

Well-Known Member
PartnerNOC
Jan 2, 2006
939
22
168
We've noticed this on every one of our cpanel servers since the latest update. Have tried a number of things with no success. We are only using spam assassin for outbound checking - so it's not been a problem to temporarily disable the service. Symptoms are spamd child process using 100% CPU and clients are then unable to send mail. chkservd hangs while waiting on spamd so we get these notifications too. Restarting Exim seems to temporarily resolve it.
 

bloatedstoat

Well-Known Member
Jun 14, 2012
183
24
68
Victoria, Australia
cPanel Access Level
Root Administrator
We have this issue too.
Is anyone else getting this in their logs and when running lint?

warn: Use of uninitialized value $hasStructureInfo in numeric eq (==) at (eval 65) line 5520.
warn: rules: failed to run __KAM_SPF_NONE test, skipping:
warn: (Can't locate object method "check_for_spf_none" via package "Mail: [...]:SpamAssassin::PerMsgStatus" at (eval 1798) line 1449.
warn: )
warn: lint: 1 issues detected, please rerun with debug enabled for more information

This is triggered on line 4380 within /etc/mail/spamassassin/KAM.cf
 

cPanelMichael

Administrator
Staff member
Apr 11, 2011
47,909
2,229
463
Hello :)

Could someone experiencing this issue post the contents of the /etc/cpspamd.conf file on their system (if it's been configured)? Also, while unlikely to relate to the CPU usage increase for spamd, a separate issue with SpamAssassin was recently addressed in cPanel version 11.52.0.18:

Fixed case CPANEL-1942: Clean up previous bad SpamAssassin updates.

Thank you.
 

kamm

Well-Known Member
Jan 17, 2004
53
1
158
Spain
cPanel Access Level
Root Administrator
We're seeing this issue too...

WHM 11.52.0 (build 18)

/etc/cpspamd.conf

Server 1 (changed by our server admin around 12 hours - so far no failures, but not long enough to say the issue is resolved)
maxchildren=10
maxconnperchild=5


Server 2 (original configuration)
maxspare=1
maxchildren=3
 

JonTheWong

Active Member
Oct 8, 2013
38
2
58
Montreal, Quebec
cPanel Access Level
Root Administrator
Twitter
I'm seeing the same thing on our servers

Code:
Oct 23 12:49:36 magi spamd[1764]: rules: failed to run __KAM_SPF_NONE test, skipping:
Oct 23 12:49:36 magi spamd[1764]:  (Can't locate object method "check_for_spf_none" via package "Mail: [...]:SpamAssassin::PerMsgStatus" at (eval 1742) line 1709.
Oct 23 12:49:36 magi spamd[1764]: )
Oct 23 12:49:37 magi spamd[1764]: spamd: server started on IO::Socket::INET6 [127.0.0.1]:783 (running version 3.4.1)
As for /etc/cpspamd.conf

Code:
allowedips=127.0.0.1
maxchildren=4
maxconnperchild=10
maxspare=1
pidfile=/var/run/spamd.pid
timeoutchild=60
timeouttcp=60
 
Last edited:

vs-fam

Active Member
PartnerNOC
Mar 18, 2010
34
4
58
We have changed the parameters in cpspamd.conf and so far is working well. However, the question still remains... What changed in the last cPanel update to require now some tweaking?

Current values:
Code:
maxspare=1
maxchildren=10
maxconnperchild=5
 

bloatedstoat

Well-Known Member
Jun 14, 2012
183
24
68
Victoria, Australia
cPanel Access Level
Root Administrator
I've had a ticket open, closed and reopened several times regarding the KAM_SPF_NONE rule. (Ticket 7270125, currently re-opened).

The first attempted resolution was to reinstall spamassassin, appeared to address the issue but then it reappeared.

Thereafter /usr/local/cpanel/3rdparty/bin/sa-update was executed, which again appeared to have resolved the issue.

It did kill off the "warn: Use of uninitialized value $hasStructureInfo in numeric eq (==) at (eval 65) line 5520." but the "Can't locate object method "check_for_spf_none" via package Mail" issue remains.

On the matter of spamd croaking, despite the post being 5 years old I followed some advice at the bottom of this post Spam Assassin spamd max children setting? and reduced the maxchildren from 4 to 1 and left everything else at its default and spamd has not failed since that change.

When spamd bails out the CPU usage for the spamd daemon is above 45% on its own or above 30% with another process running in tandem that is consuming high CPU, such as restartsrv_base name as per the following examples.

PID Owner CPU % Memory % Command

697233 root 56.67 0.20 /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/scripts/restartsrv_mysql --check --notconfigured-ok
697205 root 32.21 1.24 /usr/local/cpanel/3rdparty/perl/514/bin/spamd --daemonize --allowed-ips=127.0.0.1 --max-children=8 --max-spare=1 --pidfile=/var/run/spamd.pid -i127.0.0.1

465971 root 38.69 1.24 /usr/local/cpanel/3rdparty/perl/514/bin/spamd --daemonize --allowed-ips=127.0.0.1 --max-children=8 --max-spare=1 --pidfile=/var/run/spamd.pid -i127.0.0.1
466004 root 19.19 0.21 /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/scripts/restartsrv_base named --check --notconfigured-ok

334552 root 30.58 1.23 /usr/local/cpanel/3rdparty/perl/514/bin/spamd --daemonize --allowed-ips=127.0.0.1 --max-children=8 --max-spare=1 --pidfile=/var/run/spamd.pid -i127.0.0.1
334567 root 20.29 0.18 /usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/scripts/restartsrv_p0f --check --notconfigured-ok

Output for /etc/cpspamd.conf
allowedips=127.0.0.1
maxchildren=1
maxconnperchild=200
maxspare=1
 

kamm

Well-Known Member
Jan 17, 2004
53
1
158
Spain
cPanel Access Level
Root Administrator
Update: Still getting failures despite the changes made to Server 1

We're seeing this issue too...

WHM 11.52.0 (build 18)

/etc/cpspamd.conf

Server 1 ( changed by our server admin around 12 hours - so far no failures, but not long enough to say the issue is resolved)
maxchildren=10
maxconnperchild=5


Server 2 (original configuration)
maxspare=1
maxchildren=3
 

MediaServe

Well-Known Member
PartnerNOC
Apr 9, 2004
140
4
168
Dallas, Texas
cPanel Access Level
DataCenter Provider
Similar problem here on a brand new freshly installed 11.52.0 (build 20) server with the KAM rules enabled:

spamassassin --lint
Oct 27 11:49:44.006 [3923] warn: rules: failed to run __KAM_SPF_NONE test, skipping:
Oct 27 11:49:44.006 [3923] warn: (Can't locate object method "check_for_spf_none" via package "Mail: [...]:SpamAssassin::PerMsgStatus" at (eval 1791) line 1449.
Oct 27 11:49:44.006 [3923] warn: )
Oct 27 11:49:44.471 [3923] warn: lint: 1 issues detected, please rerun with debug enabled for more information

Disable the KAM rules in Exim Configuration and the problem is gone (which stands to reason.)

The more good spam filtering rules the better, so I'm hoping this gets fixed asap.
 

bloatedstoat

Well-Known Member
Jun 14, 2012
183
24
68
Victoria, Australia
cPanel Access Level
Root Administrator
The ticket I had open for this issue was resolved (by cPanel) by totally removing and reinstalling spamassassin. The KAM SPF error is fixed and spamd has not fallen over either since then, I tweaked maxchildren to 2 as well as I was getting messages in the maillog to raise it when I had only 1.
 

nyjimbo

Well-Known Member
Jan 25, 2003
1,133
1
168
New York
Seeing lots of warnings from CSF/LFD on spamd excessive/suspicious use since updating to WHM 11.50.2 (build 2) last week on two Centos 6.3 machines. Customers also reporting long time waits on sending email (15-20 seconds). We only do UPCP manually once in a while so we can keep an eye on things. We were running 11.50.30.0 before this.

Note:
exim exim-4.85-8.cp1148.x86_64
spamd 3.4.0
on both machines.
 

Russell Harrower

Registered
Jun 29, 2015
2
0
1
Melbourne, AU
cPanel Access Level
Root Administrator
I keep getting these messages every 30minutes or so, the server provider says that it is due to not enough memory and that I need to upgrade the server. But there just has to be away to limit the memory use of the spamd processor or something here is most of the email - minus the server details - if anyone can help fix this I would be grateful.


Code:
[B]Name[/B]

spamd

[B]Service Status[/B]

failed 

[B]Notification[/B]

The service “spamd” appears to be down.

[B]Service Check Method[/B]

The system’s command to check or to restart this service failed.

[B]Number of Restart Attempts[/B]

2

[B]Startup Log[/B]

No startup log

[B]Memory Information[/B]

Used

6.08 GB

Available

70 MB

Installed

2 GB

[B]Load Information[/B]

0.55 0.41 0.32

[B]Uptime[/B]

8 days, 21 hours, 35 minutes, and 32 seconds

[B]IOStat Information[/B]

avg-cpu:  %user   %nice %system %iowait  %steal   %idle

          9.05    0.02    0.33    0.00    0.00   90.59

Device:            tps   Blk_read/s   Blk_wrtn/s   Blk_read   Blk_wrtn

[B]Top Processes[/B]

[B]PID[/B]

[B]Owner[/B]

[B]CPU %[/B]

[B]Memory %[/B]

[B]Command[/B]

9701

root

38.63

3.47

/usr/local/cpanel/3rdparty/perl/514/bin/spamd --daemonize --max-spare=1 --max-children=3 --allowed-ips=127.0.0.1 --pidfile=/var/run/spamd.pid -i127.0.0.1

9695

sallygoldner

33.09

0.00


9668

sallygoldner

14.79

0.00



9707

root

4.17

0.45

/usr/local/cpanel/3rdparty/bin/perl /usr/local/cpanel/scripts/restartsrv_queueprocd --check --notconfigured-ok

9566

sallygoldner

1.71

0.00
 
Last edited by a moderator:

nicknice

Member
Dec 21, 2013
7
0
1
cPanel Access Level
Root Administrator
Hi Mr/Mrs,

I have facing a big issues. I have try to restart the spamd and update to lastest version still cannot solve the issues. Below is the detail of the spamd from email. Thanks.

Code:
[B]Service Name[/B] spamd
[B]Service Status[/B] failed 
[B]Notification[/B] The service “spamd” appears to be down.
[B]Service Check Method[/B] The system’s command to check or to restart this service failed.
[B]Number of Restart Attempts[/B] 2,257
[B]Startup Log[/B] child process [1846] exited or timed out without signaling production of a PID file: exit 255 at /usr/local/cpanel/3rdparty/perl/514/bin/spamd line 2983.
[B]Memory Information[/B]
Used 2.22 GB
Available 29.11 GB
Installed 31.33 GB
[B]Load Information[/B] 0.44 0.24 0.20
[B]Uptime[/B] 17 days, 13 hours, 35 minutes, and 49 seconds
[B]IOStat Information[/B] avg-cpu:  %user  %nice %system %iowait  %steal  %idle           4.33    0.17    1.34    0.27    0.00  93.88 Device:            tps  Blk_read/s  Blk_wrtn/s  Blk_read  Blk_wrtn sda              10.52        30.37      278.53  46087294  422736764 dm-0            29.46        8.54      234.35  12965156  355682952 dm-1              0.00        0.00        0.00      2600          0 dm-2              5.66        21.80        44.18  33094178  67053760
 
Last edited by a moderator:
Thread starter Similar threads Forum Replies Date
A Email 1
G Email 1