You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Peter Fastré <pe...@gmail.com> on 2007/10/19 10:58:12 UTC

spamd hangs at 100% cpu

Hello

I have a severe problem with one of my mailservers. I'm using spamassassin
3.2.3 in combination with exim 4.66, and experience hanging spamd processes
which consume all my server resources.
I've searched these mailing lists, searched google, searched documentation,
... I found very much old posts of people experiencing the same problems, so
I think it's a very common one. I tried different solutions: tracing the
process (process doesn't do anything when it hangs - no trace output),
clearing the bayes database (doesn't help), ...
The problem is really urgent, because exim receives timeouts from spamd, and
rejects the mails.
I reduced the number of mails each spamd processes, to reduce the risk of
hanging. Usually it hangs after having processed 2 or 3 mails.
Now I've even reduced it to 1, the hangups are less often, but still there!
I hope someone has a solution, or a clue to what I can do!
I checked the log files and debug output, which is very consistent. The last
thing all hanging processes do, is this:
Oct 19 09:42:09 mail01 spamd[6072]: rules: ran uri rule __DOS_HAS_ANY_URI
======> got hit: "k"
After this line in the log, the process hangs.

For your reference: the full log file is here:
     http://peter.lunatis.be/temp/spamd.txt

Regards

Peter

Re: spamd hangs at 100% cpu

Posted by longjos <jl...@uchra.com>.
I am also having this same problem, Just noticed it starting two days ago.
-- 
View this message in context: http://www.nabble.com/spamd-hangs-at-100--cpu-tf4651889.html#a13298064
Sent from the SpamAssassin - Users mailing list archive at Nabble.com.


Re: spamd hangs at 100% cpu

Posted by Micah Anderson <mi...@riseup.net>.
I too have experienced strange hangs with spamc/spamd combos on my
postfix box running maildrop/mailfilter. At first I was convinced it 
was my bayes DB because it was using MyISAM tables and these are slow 
and I'm doing a lot of mail. So I switched to InnoDB and then I was 
convinced that the problem had to do with table locking during SA 
auto-expire periods and as a result dug deep into the SA SQL and 
submitted a bug to enhance the query so it can use indexes[1]. 

Even after all this I was getting reports from people who received
bounced messages from my server saying that the default maildrop timeout
was reached (300 seconds) and as a result the message was considered as
the user being over quota and was bounced back to the original sender.
We run spamc with -t 100 and expected that this meant that after 100
seconds if the message wasn't returned from spamd, then we simply
accepted the message without any spam scanning. However, it seemed like
things were lasting far longer than 100 seconds (3x as long to hit the
maildrop timeout) and so our theory was that -t wasn't working properly.

Because of these incorrect bounces, this meant we were not delivering 
legitimate email, and so we turned off spamassassin and began digging 
deeper to try and determine what was causing this. 

I have spent hours devising and running tests to try and figure out what
is causing this, and so far I cannot replicate it in a test environment.

If you are interested in seeing my tests, and have any suggestions for
other tests that could be run to determine what might be causing this, I
am *very* interested. Please see my test page:

https://we.riseup.net/riseup+mail/spam-timeout-tests

Micah


1. http://issues.apache.org/SpamAssassin/show_bug.cgi?id=5661

* Martin.Hepworth <ma...@solidstatelogic.com> [071019 02:03]:
> Peter
> 
> Get the latest ruleset for SA using sa-update, this works around an issue with whois lookups.
> 
> Only run a few RBL's - you're running them all and this will take some time.
> 
> Running a local caching nameserver on the box will help as well.
> 
> 
> --
> Martin Hepworth
> Snr Systems Administrator
> Solid State Logic
> Tel: +44 (0)1865 842300
> 
> > -----Original Message-----
> > From: Peter Fastré [mailto:peter.fastre@gmail.com]
> > Sent: 19 October 2007 09:58
> > To: users@spamassassin.apache.org
> > Subject: spamd hangs at 100% cpu
> >
> > Hello
> >
> > I have a severe problem with one of my mailservers. I'm using spamassassin
> > 3.2.3 in combination with exim 4.66, and experience hanging spamd
> > processes which consume all my server resources.
> > I've searched these mailing lists, searched google, searched
> > documentation, ... I found very much old posts of people experiencing the
> > same problems, so I think it's a very common one. I tried different
> > solutions: tracing the process (process doesn't do anything when it hangs
> > - no trace output), clearing the bayes database (doesn't help), ...
> > The problem is really urgent, because exim receives timeouts from spamd,
> > and rejects the mails.
> > I reduced the number of mails each spamd processes, to reduce the risk of
> > hanging. Usually it hangs after having processed 2 or 3 mails.
> > Now I've even reduced it to 1, the hangups are less often, but still
> > there! I hope someone has a solution, or a clue to what I can do!
> > I checked the log files and debug output, which is very consistent. The
> > last thing all hanging processes do, is this:
> > Oct 19 09:42:09 mail01 spamd[6072]: rules: ran uri rule __DOS_HAS_ANY_URI
> > ======> got hit: "k"
> > After this line in the log, the process hangs.
> >
> > For your reference: the full log file is here:
> >      http://peter.lunatis.be/temp/spamd.txt
> >
> > Regards
> >
> > Peter
> >
> 
> 
> 
> 
> 
> **********************************************************************
> Confidentiality : This e-mail and any attachments are intended for the 
> addressee only and may be confidential. If they come to you in error 
> you must take no action based on them, nor must you copy or show them 
> to anyone. Please advise the sender by replying to this e-mail 
> immediately and then delete the original from your computer.
> Opinion : Any opinions expressed in this e-mail are entirely those of 
> the author and unless specifically stated to the contrary, are not 
> necessarily those of the author's employer.
> Security Warning : Internet e-mail is not necessarily a secure 
> communications medium and can be subject to data corruption. We advise 
> that you consider this fact when e-mailing us. 
> Viruses : We have taken steps to ensure that this e-mail and any 
> attachments are free from known viruses but in keeping with good 
> computing practice, you should ensure that they are virus free.
> 
> Red Lion 49 Ltd T/A Solid State Logic
> Registered as a limited company in England and Wales 
> (Company No:5362730)
> Registered Office: 25 Spring Hill Road, Begbroke, Oxford OX5 1RU, 
> United Kingdom
> **********************************************************************
> 

Re: spamd hangs at 100% cpu

Posted by Peter Fastré <pe...@gmail.com>.
Thank you for your response, Michael.

I've done your suggestions (sa-update + less RBL's), but still the same
problem. We already have a caching nameserver in the same subnet.

Some further investigation learns that it's always the same mail which
spamassassin is crashing on! But I don't have this mail, because it's
accepted by exim, then passed to spamd, and then rejected by exim. Anyway,
whatever the contents of the mail are, I think spamd should never hang up?
Do you have any suggestions I can do to work around this problem?

Regards

peter


On 10/19/07, Martin.Hepworth <ma...@solidstatelogic.com> wrote:
>
> Peter
>
> Get the latest ruleset for SA using sa-update, this works around an issue
> with whois lookups.
>
> Only run a few RBL's - you're running them all and this will take some
> time.
>
> Running a local caching nameserver on the box will help as well.
>
>
> --
> Martin Hepworth
> Snr Systems Administrator
> Solid State Logic
> Tel: +44 (0)1865 842300
>
> > -----Original Message-----
> > From: Peter Fastré [mailto:peter.fastre@gmail.com]
> > Sent: 19 October 2007 09:58
> > To: users@spamassassin.apache.org
> > Subject: spamd hangs at 100% cpu
> >
> > Hello
> >
> > I have a severe problem with one of my mailservers. I'm using
> spamassassin
> > 3.2.3 in combination with exim 4.66, and experience hanging spamd
> > processes which consume all my server resources.
> > I've searched these mailing lists, searched google, searched
> > documentation, ... I found very much old posts of people experiencing
> the
> > same problems, so I think it's a very common one. I tried different
> > solutions: tracing the process (process doesn't do anything when it
> hangs
> > - no trace output), clearing the bayes database (doesn't help), ...
> > The problem is really urgent, because exim receives timeouts from spamd,
> > and rejects the mails.
> > I reduced the number of mails each spamd processes, to reduce the risk
> of
> > hanging. Usually it hangs after having processed 2 or 3 mails.
> > Now I've even reduced it to 1, the hangups are less often, but still
> > there! I hope someone has a solution, or a clue to what I can do!
> > I checked the log files and debug output, which is very consistent. The
> > last thing all hanging processes do, is this:
> > Oct 19 09:42:09 mail01 spamd[6072]: rules: ran uri rule
> __DOS_HAS_ANY_URI
> > ======> got hit: "k"
> > After this line in the log, the process hangs.
> >
> > For your reference: the full log file is here:
> >      http://peter.lunatis.be/temp/spamd.txt
> >
> > Regards
> >
> > Peter
> >
>
>
>
>
>
> **********************************************************************
> Confidentiality : This e-mail and any attachments are intended for the
> addressee only and may be confidential. If they come to you in error
> you must take no action based on them, nor must you copy or show them
> to anyone. Please advise the sender by replying to this e-mail
> immediately and then delete the original from your computer.
> Opinion : Any opinions expressed in this e-mail are entirely those of
> the author and unless specifically stated to the contrary, are not
> necessarily those of the author's employer.
> Security Warning : Internet e-mail is not necessarily a secure
> communications medium and can be subject to data corruption. We advise
> that you consider this fact when e-mailing us.
> Viruses : We have taken steps to ensure that this e-mail and any
> attachments are free from known viruses but in keeping with good
> computing practice, you should ensure that they are virus free.
>
> Red Lion 49 Ltd T/A Solid State Logic
> Registered as a limited company in England and Wales
> (Company No:5362730)
> Registered Office: 25 Spring Hill Road, Begbroke, Oxford OX5 1RU,
> United Kingdom
> **********************************************************************
>
>

RE: spamd hangs at 100% cpu

Posted by "Martin.Hepworth" <ma...@solidstatelogic.com>.
Peter

Get the latest ruleset for SA using sa-update, this works around an issue with whois lookups.

Only run a few RBL's - you're running them all and this will take some time.

Running a local caching nameserver on the box will help as well.


--
Martin Hepworth
Snr Systems Administrator
Solid State Logic
Tel: +44 (0)1865 842300

> -----Original Message-----
> From: Peter Fastré [mailto:peter.fastre@gmail.com]
> Sent: 19 October 2007 09:58
> To: users@spamassassin.apache.org
> Subject: spamd hangs at 100% cpu
>
> Hello
>
> I have a severe problem with one of my mailservers. I'm using spamassassin
> 3.2.3 in combination with exim 4.66, and experience hanging spamd
> processes which consume all my server resources.
> I've searched these mailing lists, searched google, searched
> documentation, ... I found very much old posts of people experiencing the
> same problems, so I think it's a very common one. I tried different
> solutions: tracing the process (process doesn't do anything when it hangs
> - no trace output), clearing the bayes database (doesn't help), ...
> The problem is really urgent, because exim receives timeouts from spamd,
> and rejects the mails.
> I reduced the number of mails each spamd processes, to reduce the risk of
> hanging. Usually it hangs after having processed 2 or 3 mails.
> Now I've even reduced it to 1, the hangups are less often, but still
> there! I hope someone has a solution, or a clue to what I can do!
> I checked the log files and debug output, which is very consistent. The
> last thing all hanging processes do, is this:
> Oct 19 09:42:09 mail01 spamd[6072]: rules: ran uri rule __DOS_HAS_ANY_URI
> ======> got hit: "k"
> After this line in the log, the process hangs.
>
> For your reference: the full log file is here:
>      http://peter.lunatis.be/temp/spamd.txt
>
> Regards
>
> Peter
>





**********************************************************************
Confidentiality : This e-mail and any attachments are intended for the 
addressee only and may be confidential. If they come to you in error 
you must take no action based on them, nor must you copy or show them 
to anyone. Please advise the sender by replying to this e-mail 
immediately and then delete the original from your computer.
Opinion : Any opinions expressed in this e-mail are entirely those of 
the author and unless specifically stated to the contrary, are not 
necessarily those of the author's employer.
Security Warning : Internet e-mail is not necessarily a secure 
communications medium and can be subject to data corruption. We advise 
that you consider this fact when e-mailing us. 
Viruses : We have taken steps to ensure that this e-mail and any 
attachments are free from known viruses but in keeping with good 
computing practice, you should ensure that they are virus free.

Red Lion 49 Ltd T/A Solid State Logic
Registered as a limited company in England and Wales 
(Company No:5362730)
Registered Office: 25 Spring Hill Road, Begbroke, Oxford OX5 1RU, 
United Kingdom
**********************************************************************