The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Optimizing SpamAssassin for quickness/CPU-efficiency

Discussion in 'Workarounds and Optimization' started by lbeachmike, Jul 6, 2012.

  1. lbeachmike

    lbeachmike Well-Known Member

    Joined:
    Dec 27, 2001
    Messages:
    313
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Long Beach, NY
    cPanel Access Level:
    Root Administrator
    Hi there -

    Has anybody tried to optimize SpamAssassin for processing speed?

    I've got lots of RAM to work with and would like to optimize so emails are processed most efficiently.

    Currently I have 12 max children and the default for Max Connections Per Child. I'm not sure if there are many moves to be made here, given that cpanel offers no means of changing the bulk of SpamAssassin default settings.

    I see that my spam emails average about 12-14 seconds for processing. This is on an 8-core hyper-threaded box and on a 12-core hyper-threaded box!

    Are there any productive changes I can make to improve upon that? I'd not mind throwing a few more gig of RAM at this, and I also wonder if there's a way to have SA make more efficient use of a multi-threaded machine similar to what PIGZ has done for compression.

    Thanks.

    Mike
     
  2. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    You could try to modify settings for SpamAssassin in /var/lib/spamassassin/3.003001/updates_spamassassin_org directory. Most of the settings you have for SpamAssassin should be housed there.

    I don't have suggestions for changes, but this is being mentioned per the "cpanel offers no means of changing the bulk of SpamAssassin default settings" comment.
     
  3. lbeachmike

    lbeachmike Well-Known Member

    Joined:
    Dec 27, 2001
    Messages:
    313
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Long Beach, NY
    cPanel Access Level:
    Root Administrator
    Thanks Tristan - I took a look inside that directory and there are a large number of files. It is not apparent to me as to how I would be able to modify a setting like min-children. In fact when I grep that directory for "child" or "Child" there are no matches.

    Is modification of the content in this directory supported? I was told via ticket that the settings I am seeking to change are not supported.

    Thanks.
     
    #3 lbeachmike, Jul 10, 2012
    Last edited: Jul 10, 2012
  4. cPanelTristan

    cPanelTristan Quality Assurance Analyst
    Staff Member

    Joined:
    Oct 2, 2010
    Messages:
    7,623
    Likes Received:
    21
    Trophy Points:
    38
    Location:
    somewhere over the rainbow
    cPanel Access Level:
    Root Administrator
    We have an option in WHM > Manage Plugins that has "spamdconf" that can be enabled. When it is enabled, you can modify some of the settings for children as those settings appear in WHM > Plugins > Setup Spamd Startup Configuration area. There's no option for min-children, though.

    As for modification of the directory being supported, it isn't supported but it is available. Any modifications outside WHM that cannot be done via scripts either are basically custom. We don't support customizations, but that doesn't mean customizations don't work either. That's why the "no means" isn't actually how I would have phrased it. There's a means, it just is going to require customizations. There are going to probably be startup values you cannot modify, yes.
     
  5. lbeachmike

    lbeachmike Well-Known Member

    Joined:
    Dec 27, 2001
    Messages:
    313
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Long Beach, NY
    cPanel Access Level:
    Root Administrator
    Hi Tristan - Thanks. I already do use the Spamd Startup Settings plugin, which only allows four options of a huge number of SpamAssassin configuration options, to be set.

    Paul explained via ticket back in May why the additional options are not setable without modifying restartsrv.pl -

    And then provided further details in a subsequent response -

    So, it appears that getting additional settings modified requires hacking of restartsrv.pl, which I'm surpised is hard-coded like that - the code must be very ancient code because that seems very un-cpanel-like :rolleyes:

    I've not yet sat down and tried to walk through the code to figure it out, so if you have any insight, it would be most appreciated.
     
  6. lbeachmike

    lbeachmike Well-Known Member

    Joined:
    Dec 27, 2001
    Messages:
    313
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Long Beach, NY
    cPanel Access Level:
    Root Administrator
  7. lbeachmike

    lbeachmike Well-Known Member

    Joined:
    Dec 27, 2001
    Messages:
    313
    Likes Received:
    0
    Trophy Points:
    16
    Location:
    Long Beach, NY
    cPanel Access Level:
    Root Administrator
    So absolutely nobody in cpanel land has optimized spamassassin?
     
  8. semseoymas

    semseoymas Member

    Joined:
    Oct 22, 2013
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I discovered the cpanel parser does not take into account the contents of the variables, so you could:

    See that "-l" option??

    ;)
     
  9. semseoymas

    semseoymas Member

    Joined:
    Oct 22, 2013
    Messages:
    20
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Cannot modify... so....

    Cannot use "=" if inserting new variables.... so mine is:

    /usr/local/cpanel/3rdparty/perl/514/bin/spamd -d --allowed-ips=127.0.0.1 --max-conn-per-child=40 --min-spare 2 --max-spare 2 --min-children 2 --pidfile=/var/run/spamd.pid --max-children=6

    As you see, my conf file:

     
  10. myusername

    myusername Well-Known Member
    PartnerNOC

    Joined:
    Mar 6, 2003
    Messages:
    691
    Likes Received:
    1
    Trophy Points:
    18
    Location:
    chown -R us.*yourbase*
    cPanel Access Level:
    DataCenter Provider
    Twitter:
    I'm just wondering if you ever made it into a real feature request instead of just requesting it in the forums. I didn't see it over there when I looked earlier.
     
Loading...

Share This Page