Community Forums
Connect with us on LinkedIn
Community Notice
+ Reply to Thread
Page 1 of 2 1 2 LastLast
Results 1 to 15 of 16
  1. #1
    Member
    Join Date
    Jul 2003
    Posts
    18

    Default spamd eating memory and cpu, load averages > 2

    On my server, spamd is constantly eating memory and CPU times, shooting my load average over 2. I've installed the dictionary attack blocker talked about here, but it still isn't helping. I only have about 4 small sites on my server so this shouldn't be happening. Here is a show of top:

    13:20:16 up 20 days, 14:02, 1 user, load average: 2.22, 2.11, 2.05
    105 processes: 100 sleeping, 2 running, 3 zombie, 0 stopped
    CPU states: 20.3% user 2.7% system 0.0% nice 0.0% iowait 76.8% idle
    Mem: 505716k av, 500260k used, 5456k free, 0k shrd, 2140k buff
    300836k actv, 65432k in_d, 10756k in_c
    Swap: 1052248k av, 526124k used, 526124k free 25244k cached

    PID USER PRI NI SIZE RSS SHARE STAT %CPU %MEM TIME CPU COMMAND
    26461 mailnull 15 0 528 256 180 S 99.9 0.0 1:17 0 exim
    12608 planproj 16 0 27204 19M 1416 S 7.9 3.9 1:14 0 spamd
    12300 planproj 16 0 27240 19M 1444 S 7.3 3.9 1:14 0 spamd
    28267 root 21 0 3680 3680 2664 S 1.9 0.7 0:00 0 exim
    28258 root 21 0 3684 3684 2664 S 1.7 0.7 0:00 0 exim
    12425 planproj 15 0 422M 241M 12 D 1.5 48.8 2:44 0 spamd


    Any ideas? This is really bad...

  2. #2
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    The problem is probably that you are memory thrashing - that is you're server has basically run out of physical RAM and is continuously swapping memory pages to the swapfile and back. This is seems evident from your swapfile usage that you've quoted and from the spamd process that has consumed 241M of memory.

    When you are in top, try pressing M (that's shift-m) to sort by memory usage. That should give you an idea of what's eating it all up, though it's quite clear that is is SpamAssassin.

    You might want to disable SpamAssassin which consumes considerable memory by unchecking WHM > Service Manager > spamd and WHM > Tweak Settings > SpamAssassin and then investigating what is causing it to bloom like that.
    Last edited by chirpy; 04-09-2005 at 04:09 PM.
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  3. #3
    Member
    Join Date
    Feb 2003
    Posts
    176

    Default

    I was running quite smoothly until about 3/29, when spamd began eating memory more and more. My server started running out of memory and crashing. I'm still not sure why as the email loads and all other activity look to be about the same. I "think" it corresponds to a cPanel upgrade (Release) but I haven't been able to track that down yet. At someone elses suggestion, I installed the spamd startup config addon and set Maximum Children to 2, leaving the other options blank. After it restarted exim, the loads went down to almost normal again. Give it a try and see if it helps.

    David

  4. #4
    Member
    Join Date
    Jul 2003
    Posts
    18

    Default

    Hi,

    Where did you get this startup config editor for spamd?

    Also, is there anything else I can do besides removing spamassassin? I keep getting dictionary attacks it looks like, rather than a lot of spam emails. Would removing spamassassin solve this issue?

  5. #5
    Member
    Join Date
    Jul 2003
    Posts
    18

    Default

    I think I figured out the problem. All unrouted email for one of my domains was getting sent to a default address, so dictionary attacks were all looked at by the spam daemon. Once I blackhole'd the default address, the spam daemon no longer looks at those emails.... hopefully my load avg will go down now.

  6. #6
    Member
    Join Date
    Feb 2003
    Posts
    176

    Default

    Quote Originally Posted by heath
    Hi,

    Where did you get this startup config editor for spamd?

    Also, is there anything else I can do besides removing spamassassin? I keep getting dictionary attacks it looks like, rather than a lot of spam emails. Would removing spamassassin solve this issue?
    Go to WHM, it's in Cpanel > Addon Scripts with all the other addons from cpanel. It did so much to improve my situation, I would suggest that anyone using SA install it and read up on the settings at spamassassin.org. In my case, just the one setting above did the trick. Good luck.

    David

  7. #7
    Super Moderator This forum account has been confirmed by cPanel staff to represent a vendor. chirpy's Avatar
    Join Date
    Jun 2002
    Location
    Go on, have a guess
    Posts
    13,495

    Default

    Quote Originally Posted by heath
    I think I figured out the problem. All unrouted email for one of my domains was getting sent to a default address, so dictionary attacks were all looked at by the spam daemon. Once I blackhole'd the default address, the spam daemon no longer looks at those emails.... hopefully my load avg will go down now.
    Be sure to use :fail: and not :blackhole: you can also find a dictionary attack ACL to further reduce the harm that they do here:
    http://www.configserver.com/free/eximdeny.html
    Jonathan Michaelson

    Need your cPanel servers secured and tuned?
    cPanel Server Configuration, Security, Recovery and Antivirus/AntiSpam Services
    Developers of the most effective (and free) Firewall & Security Solution for cPanel Servers - csf
    http://www.configserver.com

  8. #8
    cPanel Partner NOC cPanel Partner NOC Badge
    Join Date
    May 2003
    Location
    Ukraine
    Posts
    195
    cPanel/Enkompass Access Level

    Root Administrator

    Default

    Quote Originally Posted by DavidR
    At someone elses suggestion, I installed the spamd startup config addon and set Maximum Children to 2, leaving the other options blank. After it restarted exim, the loads went down to almost normal again. Give it a try and see if it helps.
    David

    I also install this module and when I log in as reseller to its WHM I was suprised by seeing that this module accessible from reseller WHM and reseller can change values there.
    Regards, Alexey

  9. #9
    Member
    Join Date
    Mar 2004
    Location
    This Planet
    Posts
    984

    Default

    Quote Originally Posted by AlexAT
    I also install this module and when I log in as reseller to its WHM I was suprised by seeing that this module accessible from reseller WHM and reseller can change values there.
    http://forums.cpanel.net/showthread....ighlight=spamd

    No response
    bugzilla ..... don't see any use if one has to post it there come back to forum and then restart it again asking forum visitors to visit bugzilla entry... vote for it. Utterly painful.

  10. #10
    Member
    Join Date
    Mar 2003
    Posts
    604

    Default

    Quote Originally Posted by DavidR
    Go to WHM, it's in Cpanel > Addon Scripts with all the other addons from cpanel. It did so much to improve my situation, I would suggest that anyone using SA install it and read up on the settings at spamassassin.org. In my case, just the one setting above did the trick. Good luck.

    David

    How do you use this startup script editor? I've installed it, but can't find out how to use it. I've searched the forums and come up empty? Is there documentation anywhere for this one?

  11. #11
    Member
    Join Date
    Mar 2003
    Posts
    604

    Default

    Quote Originally Posted by noimad1
    How do you use this startup script editor? I've installed it, but can't find out how to use it. I've searched the forums and come up empty? Is there documentation anywhere for this one?
    can anyone tell me how to use this script?

  12. #12
    BANNED
    Join Date
    Jun 2005
    Location
    Wild Wild West
    Posts
    2,025

    Default

    I'd check the Bayes and Autowhitelist databases for each site and make
    sure that you don't have one or more that have grown massively huge.

    Every so often, you need to truncate and reset those files else they get
    big and slow down your Spamassassin scans as well as eat a lot of memory.

  13. #13
    Member
    Join Date
    Mar 2003
    Posts
    604

    Default

    Quote Originally Posted by Spiral
    I'd check the Bayes and Autowhitelist databases for each site and make
    sure that you don't have one or more that have grown massively huge.

    Every so often, you need to truncate and reset those files else they get
    big and slow down your Spamassassin scans as well as eat a lot of memory.
    Shouldn't this be something that Spamassasin maintains itself? What is the beset way to truncate those files. For example, I have one site that is 45mb. I don't know if that is excessive in size or not. But how do I truncate that file?

    Whould there be a way to write a script to automatically do this?

  14. #14
    Member
    Join Date
    Mar 2003
    Posts
    604

    Default

    Spiral,

    Whats the best way to "truncate" and reset those files?

  15. #15
    Member This forum account has been confirmed by cPanel staff to represent a vendor.
    Join Date
    Apr 2004
    Posts
    620

    Default

    Use the following code:
    for P in `find /home*/*/.spamassassin/ -name "bayes_toks" -size +10240k | xargs -i echo {}`; do PP=`echo $P|sed s/bayes_toks//`; cat /dev/null > $PP"bayes_journal"; cat /dev/null > $PP"bayes_seen"; cat /dev/null > $PP"bayes_toks"; done;
    We are using this code and it works well. It remove the Bayes databases if the main dictionary file over 10 Mb.
    Reliable web-hosting, good resellers plans, web-design.
    ISProHosting.com

Similar Threads & Tags
Similar threads

  1. Apache eating a lot of memory and high Cpu load
    By parsmatix in forum New User Questions
    Replies: 1
    Last Post: 05-26-2008, 07:55 PM
  2. Spamd Hangs with 100% CPU Load
    By a.sheipani in forum E-mail Discussions
    Replies: 4
    Last Post: 05-03-2008, 03:53 PM
  3. spamd child eating 100% of Cpu help
    By bsasninja in forum cPanel and WHM Discussions
    Replies: 47
    Last Post: 02-05-2008, 03:16 AM
  4. memory/cpu load question
    By shann in forum cPanel and WHM Discussions
    Replies: 1
    Last Post: 01-04-2007, 09:12 AM
Linkedin       Facebook       Twitter       RSS       Flickr       YouTube