Control Web Panel

WebPanel => E-Mail => Topic started by: Starburst on September 06, 2020, 03:44:16 AM

Title: SpamAssassin High CPU Usage
Post by: Starburst on September 06, 2020, 03:44:16 AM
Followed the Wiki at http://wiki.centos-webpanel.com/how-to-configure-spamassassin

Thought when you rebuilt the Email Server and had this option checked, it enabled it.
But apparently it doesn't, since all the line listed in the Wiki are missing.


After Enabling now though, CPU usable is at 100% for spamd

33279 root      20   0  185136  74772   8532 R 100.0   0.9   0:01.48 spamd


Does the Wiki have to still be done for CWPpro 0.9.8.1006?
Or am I missing something?
Title: Re: SpamAssassin High CPU Usage
Post by: bartje1974 on September 06, 2020, 07:49:25 AM
First I had a problem that clamav and amavis had stopped and my mails got stuck in the postfix mail queue. This problem was solved by the mail server rebuilt.

Now my CPU meter keeps ticking 50 percent.
In the top stats, just like yours 100% in use.

I'm not too happy about this.

I reinstall everything and i got an error:
● clamd.service - clamd scanner () daemon
   Loaded: loaded (/usr/lib/systemd/system/clamd.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Sun 2020-09-06 09:45:12 CEST; 57s ago
     Docs: man:clamd(8)
           man:clamd.conf(5)
           https://www.clamav.net/documents/
 Main PID: 22278 (code=exited, status=203/EXEC)

Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Started clamd scanner () daemon.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service: main process exited, code=exited, status=203/EXEC
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Unit clamd.service entered failed state.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service failed.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service holdoff time over, scheduling restart.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Stopped clamd scanner () daemon.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: start request repeated too quickly for clamd.service
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Failed to start clamd scanner () daemon.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Unit clamd.service entered failed state.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service failed.

amaviaAV:
● amavisd.service - Amavis mail content checker
   Loaded: loaded (/usr/lib/systemd/system/amavisd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: http://www.ijs.si/software/amavisd/#doc

Sep 05 18:22:18 srv1.cs-hosting.nl systemd[1]: Starting Amavis mail content checker...
Sep 05 18:22:19 srv1.cs-hosting.nl systemd[1]: Started Amavis mail content checker.
Sep 05 18:23:32 srv1.cs-hosting.nl systemd[1]: Stopping Amavis mail content checker...
Sep 05 18:23:33 srv1.cs-hosting.nl systemd[1]: Stopped Amavis mail content checker.
Sep 05 18:24:00 srv1.cs-hosting.nl systemd[1]: Starting Amavis mail content checker...
Sep 05 18:24:01 srv1.cs-hosting.nl systemd[1]: Started Amavis mail content checker.
Sep 06 09:44:59 srv1.cs-hosting.nl systemd[1]: Stopping Amavis mail content checker...
Sep 06 09:45:04 srv1.cs-hosting.nl systemd[1]: Stopped Amavis mail content checker.

something is realy fucked up.
Title: Re: SpamAssassin High CPU Usage
Post by: bartje1974 on September 06, 2020, 07:51:28 AM
Ow i forgot:
this error i get after reinstall:

mv: cannot stat ‘clamd@scan.service’: No such file or directory
Title: Re: SpamAssassin High CPU Usage
Post by: venty on September 06, 2020, 09:57:08 AM
+1
Title: Re: SpamAssassin High CPU Usage
Post by: CoriaWeb Hosting on September 06, 2020, 12:36:02 PM
First I had a problem that clamav and amavis had stopped and my mails got stuck in the postfix mail queue. This problem was solved by the mail server rebuilt.

Now my CPU meter keeps ticking 50 percent.
In the top stats, just like yours 100% in use.

I'm not too happy about this.

I reinstall everything and i got an error:
● clamd.service - clamd scanner () daemon
   Loaded: loaded (/usr/lib/systemd/system/clamd.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Sun 2020-09-06 09:45:12 CEST; 57s ago
     Docs: man:clamd(8)
           man:clamd.conf(5)
           https://www.clamav.net/documents/
 Main PID: 22278 (code=exited, status=203/EXEC)

Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Started clamd scanner () daemon.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service: main process exited, code=exited, status=203/EXEC
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Unit clamd.service entered failed state.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service failed.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service holdoff time over, scheduling restart.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Stopped clamd scanner () daemon.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: start request repeated too quickly for clamd.service
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Failed to start clamd scanner () daemon.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Unit clamd.service entered failed state.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service failed.

amaviaAV:
● amavisd.service - Amavis mail content checker
   Loaded: loaded (/usr/lib/systemd/system/amavisd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: http://www.ijs.si/software/amavisd/#doc

Sep 05 18:22:18 srv1.cs-hosting.nl systemd[1]: Starting Amavis mail content checker...
Sep 05 18:22:19 srv1.cs-hosting.nl systemd[1]: Started Amavis mail content checker.
Sep 05 18:23:32 srv1.cs-hosting.nl systemd[1]: Stopping Amavis mail content checker...
Sep 05 18:23:33 srv1.cs-hosting.nl systemd[1]: Stopped Amavis mail content checker.
Sep 05 18:24:00 srv1.cs-hosting.nl systemd[1]: Starting Amavis mail content checker...
Sep 05 18:24:01 srv1.cs-hosting.nl systemd[1]: Started Amavis mail content checker.
Sep 06 09:44:59 srv1.cs-hosting.nl systemd[1]: Stopping Amavis mail content checker...
Sep 06 09:45:04 srv1.cs-hosting.nl systemd[1]: Stopped Amavis mail content checker.

something is realy fucked up.

Today we have had problems with the use of CPU with the process clamd/amavis, if it serves you I pass this link where I put 3 commands that have solved it and eliminated the use of 100% CPU.

https://www.coriaweb.hosting/clientes/index.php/knowledgebase/33/Amavis-orClamd-esta-utilizando-el-100-de-CPU.html
Title: Re: SpamAssassin High CPU Usage
Post by: Starburst on September 06, 2020, 03:25:58 PM
Problem is, when you do a Mail Server Rebuild, it does away with the changes to the config files to activate SpamAssassin.
So your right back to square one.

My mail also got stuck in the queue.

I wound up just disabling SpamAssassin for now.

The server can handle 100% for 1 CPU core.


Another problem I noticed, is last night I did a kernel update and dnf update Amavis as well.
This broke the client from being able to use mail.domaname.com, and had to resort going back to using the hostname for SMTP & IMAP.

He wasn't too happy about that, but at least it working for now.
Title: Re: SpamAssassin High CPU Usage
Post by: Starburst on September 06, 2020, 03:49:10 PM
Did those 3 steps, am getting:

** (pkttyagent:9592): WARNING **: 15:47:20.946: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)


But clamd CPU did go down.
Title: Re: SpamAssassin High CPU Usage
Post by: CoriaWeb Hosting on September 06, 2020, 04:15:06 PM

Another problem I noticed, is last night I did a kernel update and dnf update Amavis as well.
This broke the client from being able to use mail.domaname.com, and had to resort going back to using the hostname for SMTP & IMAP.


I reported this to the CWP team two days ago and it is already fixed, they told me that in the next update it will be fixed.

You can fix it this way:

1º Remove all SSL from the domain you have the problem with.

2º Issue the SSL only for the domain ( without marking any other service, mail, webmail, etc...).

3º Issue the SSL for the services ( mail, webmail, etc...).

4º Execute this command through SSH: postmap -F hash:/etc/postfix/vmail_ssl.map

5º Restart Dovecot.

With these steps you should get mail.domain working again
Title: Re: SpamAssassin High CPU Usage
Post by: CoriaWeb Hosting on September 06, 2020, 04:16:59 PM
Did those 3 steps, am getting:

** (pkttyagent:9592): WARNING **: 15:47:20.946: Unable to register authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject
Error registering authentication agent: GDBus.Error:org.freedesktop.PolicyKit1.Error.Failed: Cannot determine user of subject (polkit-error-quark, 0)


But clamd CPU did go down.

That error should be ignored, anyway if you have already lowered the CPU, is that it is solved.
Title: Re: SpamAssassin High CPU Usage
Post by: venty on September 08, 2020, 07:29:39 AM
First I had a problem that clamav and amavis had stopped and my mails got stuck in the postfix mail queue. This problem was solved by the mail server rebuilt.

Now my CPU meter keeps ticking 50 percent.
In the top stats, just like yours 100% in use.

I'm not too happy about this.

I reinstall everything and i got an error:
● clamd.service - clamd scanner () daemon
   Loaded: loaded (/usr/lib/systemd/system/clamd.service; disabled; vendor preset: disabled)
   Active: failed (Result: start-limit) since Sun 2020-09-06 09:45:12 CEST; 57s ago
     Docs: man:clamd(8)
           man:clamd.conf(5)
           https://www.clamav.net/documents/
 Main PID: 22278 (code=exited, status=203/EXEC)

Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Started clamd scanner () daemon.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service: main process exited, code=exited, status=203/EXEC
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Unit clamd.service entered failed state.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service failed.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service holdoff time over, scheduling restart.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Stopped clamd scanner () daemon.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: start request repeated too quickly for clamd.service
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Failed to start clamd scanner () daemon.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: Unit clamd.service entered failed state.
Sep 06 09:45:12 srv1.cs-hosting.nl systemd[1]: clamd.service failed.

amaviaAV:
● amavisd.service - Amavis mail content checker
   Loaded: loaded (/usr/lib/systemd/system/amavisd.service; disabled; vendor preset: disabled)
   Active: inactive (dead)
     Docs: http://www.ijs.si/software/amavisd/#doc

Sep 05 18:22:18 srv1.cs-hosting.nl systemd[1]: Starting Amavis mail content checker...
Sep 05 18:22:19 srv1.cs-hosting.nl systemd[1]: Started Amavis mail content checker.
Sep 05 18:23:32 srv1.cs-hosting.nl systemd[1]: Stopping Amavis mail content checker...
Sep 05 18:23:33 srv1.cs-hosting.nl systemd[1]: Stopped Amavis mail content checker.
Sep 05 18:24:00 srv1.cs-hosting.nl systemd[1]: Starting Amavis mail content checker...
Sep 05 18:24:01 srv1.cs-hosting.nl systemd[1]: Started Amavis mail content checker.
Sep 06 09:44:59 srv1.cs-hosting.nl systemd[1]: Stopping Amavis mail content checker...
Sep 06 09:45:04 srv1.cs-hosting.nl systemd[1]: Stopped Amavis mail content checker.

something is realy fucked up.

Today we have had problems with the use of CPU with the process clamd/amavis, if it serves you I pass this link where I put 3 commands that have solved it and eliminated the use of 100% CPU.

https://www.coriaweb.hosting/clientes/index.php/knowledgebase/33/Amavis-orClamd-esta-utilizando-el-100-de-CPU.html

????
Title: Re: SpamAssassin High CPU Usage
Post by: venty on September 08, 2020, 07:30:38 AM
Followed the Wiki at http://wiki.centos-webpanel.com/how-to-configure-spamassassin

Thought when you rebuilt the Email Server and had this option checked, it enabled it.
But apparently it doesn't, since all the line listed in the Wiki are missing.


After Enabling now though, CPU usable is at 100% for spamd

33279 root      20   0  185136  74772   8532 R 100.0   0.9   0:01.48 spamd


Does the Wiki have to still be done for CWPpro 0.9.8.1006?
Or am I missing something?


??????
Title: Re: SpamAssassin High CPU Usage
Post by: bartje1974 on September 08, 2020, 01:09:14 PM
Wel.. the high performance is gone.
Another problem: clamAV, and Amavis not starting when i reboot the server.
Need to manual start everything.
Title: Re: SpamAssassin High CPU Usage
Post by: venty on September 08, 2020, 01:35:27 PM
Wel.. the high performance is gone.
Another problem: clamAV, and Amavis not starting when i reboot the server.
Need to manual start everything.

Has high productivity not disappeared for me?
Title: Re: SpamAssassin High CPU Usage
Post by: Starburst on September 08, 2020, 04:07:17 PM
Wel.. the high performance is gone.
Another problem: clamAV, and Amavis not starting when i reboot the server.
Need to manual start everything.

Look under Services Config -> Startup Services

By Default they are set to Disabled, and you have to change them to Enabled.
Title: Re: SpamAssassin High CPU Usage
Post by: venty on September 11, 2020, 02:11:53 PM
High productivity has not disappeared for me?
Title: Re: SpamAssassin High CPU Usage
Post by: brack on September 17, 2020, 07:56:12 PM

Today we have had problems with the use of CPU with the process clamd/amavis, if it serves you I pass this link where I put 3 commands that have solved it and eliminated the use of 100% CPU.

https://www.coriaweb.hosting/clientes/index.php/knowledgebase/33/Amavis-orClamd-esta-utilizando-el-100-de-CPU.html

I am still having this problem.
I did try the solutions but it doesn't work. It's starting again after a while.
Any solution?

https://prnt.sc/uj47u6
Title: Re: SpamAssassin High CPU Usage
Post by: Starburst on September 17, 2020, 08:40:06 PM
Still do intermittently as always.

It's really noticeable if you only have 1 CPU, if you have 4+ then 1 CPU maxing out doesn't affect much.
Title: Re: SpamAssassin High CPU Usage
Post by: CoriaWeb Hosting on September 18, 2020, 07:44:35 AM
Can you try to execute this command? Sometimes it solves it.

Code: [Select]
sh /scripts/clamd_fix_100_cpu_usage
Title: Re: SpamAssassin High CPU Usage
Post by: brack on September 18, 2020, 06:14:26 PM
Can you try to execute this command? Sometimes it solves it.

Code: [Select]
sh /scripts/clamd_fix_100_cpu_usage
The problem continues
Title: Re: SpamAssassin High CPU Usage
Post by: Ozzi on September 18, 2020, 08:56:06 PM
CONTROL WEB PANEL »WEBPANEL »CENTOS-WEBPANEL BUGS »CPU 100% CLAMD
https://forum.centos-webpanel.com/index.php?topic=4426.15
Title: Re: SpamAssassin High CPU Usage
Post by: brack on September 22, 2020, 07:44:53 PM
Guys, I tried all methods but none of them work.
The problem is starting again after a while.
This is really a bad situation.

Any suggestions for solution?

Title: Re: SpamAssassin High CPU Usage
Post by: venty on September 23, 2020, 04:45:01 AM
High productivity has not disappeared for me?
Title: Re: SpamAssassin High CPU Usage
Post by: Starburst on September 23, 2020, 07:02:47 AM
High productivity has not disappeared for me?

How many CPU's and RAM does the box have?
Title: Re: SpamAssassin High CPU Usage
Post by: venty on September 23, 2020, 07:08:48 AM
High productivity has not disappeared for me?

How many CPU's and RAM does the box have?

2  x  CPU Model: Intel(R) Xeon(R) CPU X5670 @ 2.93GHz
CPU Details: 8 Core (2933 MHz)
RAM - 28 GB
Title: Re: SpamAssassin High CPU Usage
Post by: Starburst on September 23, 2020, 03:51:58 PM
That definitely should be enough.
Usually clam has a problem with a single CPU and 1-2GB of RAM
Title: Re: SpamAssassin High CPU Usage
Post by: venty on October 01, 2020, 03:10:05 PM
That definitely should be enough.
Usually clam has a problem with a single CPU and 1-2GB of RAM

High productivity has not disappeared for me?
Title: Re: SpamAssassin High CPU Usage
Post by: Starburst on October 01, 2020, 06:48:49 PM
What happens when you run: sh /scripts/clamd_fix_100_cpu_usage

Usually that takes care of the problem, but only pops back up after a server reboot.
Title: Re: SpamAssassin High CPU Usage
Post by: venty on October 02, 2020, 02:12:59 AM
Of what happens and why? and is there a lasting solution ...?
Title: Re: SpamAssassin High CPU Usage
Post by: Starburst on October 02, 2020, 03:12:53 AM
I'm guessing its a bug in clamav and/or spamassassin with a cpu/memory leak.

On CentOS 7 I ran: clamscan --version

And got the current version (ClamAV 0.102.4) in the epel repo.

On a server I don't have spamassassin running, just ClamAV there isn't a problem.
Title: Re: SpamAssassin High CPU Usage
Post by: venty on October 10, 2020, 11:35:40 AM
Pls, help....?!?
Title: Re: SpamAssassin High CPU Usage
Post by: cinique on October 10, 2020, 11:50:02 AM
I have already provided the best solution in this forum.
ClamAV/clamd has been problematic for over a decade, including on other control panels.
As Windoze lusers (clients) should be running their own anti-virus software, it really is only optional to use it on a server.

The key fault/issue with CWP is that it doesn't separate SpamAssassin from clamAV/clamd.
On 1GB RAM VPS, I manually disable clamd/clamAV
Code: [Select]
systemctl stop clamd
systemctl disable clamd
For a smoother experience and in other cases, apply my research & tested 'fix', mentioned elsewhere. I can lead a horse to water..
http://forum.centos-webpanel.com/index.php?topic=4426.msg31152#msg31152
Title: Re: SpamAssassin High CPU Usage
Post by: studio4host on October 12, 2020, 07:14:08 AM
the best is to contact cwp support to check the case on your server
Title: Re: SpamAssassin High CPU Usage
Post by: venty on December 13, 2020, 04:45:39 PM
Hi,

again, today I updated the clam and regarding the same problem...

Pls, help...

thanks in advance!

BR
Venty