anomy-list

Re: 100 % CPU utilization Postfix+Anomy+SpamAssassin+ClamAV

From: Derrick Webber (138886@xyz.molar.is)
Date: Sat 05 Feb 2005 - 00:26:15 GMT

  • Next message: kyle victor: "Re: 100 % CPU utilization Postfix+Anomy+SpamAssassin+ClamAV"

    Kyle Victor said:
    >
    > (1) Xeon 2.80GHz (I may be putting a second CPU in if I can not get
    > this resolved)
    >
    > 1024MB of RAM (memory used does not seem to be a problem at all)
    >
    >
    > Fedora Core 3 kernel 2.6.9-1.724_FC3
    >
    >
    > postfix-2.1.5 + anomy + SpamAssassin-3.0.2 + clamav-0.80
    >
    >
    > for the last couple weeks my output from top looks like this:
    >
    >
    >
    > Tasks: 209 total, 26 running, 183 sleeping, 0 stopped, 0 zombie
    >
    > Cpu(s): 93.4% us, 6.6% sy, 0.0% ni, 0.0% id, 0.0% wa, 0.0% hi,
    > 0.0% si
    >
    > Mem: 1035980k total, 1010968k used, 25012k free, 4464k
    > buffers
    >
    > Swap: 1048552k total, 100968k used, 947584k free, 138700k
    > cached
    >
    >
    > PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    >
    > 6245 filter 25 0 11084 7616 1756 R 6.6 0.7 0:17.59
    > sanitizer.pl
    >
    > 7318 filter 25 0 10144 7568 1756 R 6.6 0.7 0:04.30
    > sanitizer.pl
    >
    > 8190 filter 25 0 57248 52m 2412 R 6.3 5.2 0:01.39
    > spamassassin
    >
    > 8153 filter 20 0 29468 25m 2508 S 6.0 2.5 0:01.69
    > spamassassin
    >
    > 8205 filter 25 0 26928 23m 2412 R 6.0 2.3 0:01.29
    > spamassassin
    >
    > 7938 filter 25 0 8252 6584 1756 R 5.3 0.6 0:01.37
    > sanitizer.pl
    >
    > 6610 filter 25 0 9948 7520 1756 R 3.3 0.7 0:11.70
    > sanitizer.pl
    >
    > 7932 filter 25 0 9716 6848 1756 R 3.3 0.7 0:01.52
    > sanitizer.pl
    >
    > 8062 filter 23 0 8436 5240 1756 R 3.3 0.5 0:00.37
    > sanitizer.pl
    >
    > 8094 filter 25 0 82700 76m 2412 R 3.3 7.6 0:02.30
    > spamassassin
    >
    >
    >
    > These are just the top 10 from the top command, there can be as many
    > as 25 entries from sanitizer.pl and spamassassin all looking like
    > these
    >
    >
    > If I stop Postfix this plains right out to 100% or so idle,
    >
    > so I do not think the CPU is being eaten by any other service on this
    > machine,
    >
    > but I do have apache and a voice com server running on this machine
    > too
    >
    >
    > this first thing I tried was to get spamd running and editing
    > filter.sh to call /usr/bin/spamc
    >
    >
    > I did not see a big difference, but I was a little impatient when test
    > mails still where not being delivered with in the first 10-15 mins
    >
    >
    > I think it's the PERL that is killing me
    >
    >
    > Any other suggestions, comments,
    >
    >
    > I can supply any or all of my conf, but I need help getting this to
    > run leaner and meaner
    >
    >
    > It is taking some mail over an hour to be delivered
    >

    Sure you're not swapping? Taking an hour to process a message sounds like
    the box is getting out of memory.

    Regardless, you want a dedicated mail server if you get any significant
    mail volume. For higher volumes spamassassin really needs it's own box.

    Some suggestions:

    - Use "clamd" and "clamdscan" instead of the commandline clamscan.
    - Lower the maxproc setting for the filter process in Postfix master.cf
    - If your filter script writes to a temp file, try to rewrite it so
    everything is done through pipes.
    - To reduce the perl's startup overhead, try compiling sanitizer.pl using
    "perlcc" (may not work depending on your perl). Persistent Perl
    (http://daemoninc.com/PersistentPerl/) may also work.

    --
     Derrick Webber
     Advosys Consulting Inc. Ottawa
     http://advosys.ca/
    --
    



    hosted by molar.is