You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Ted Mittelstaedt <te...@ipinc.net> on 2012/10/19 22:21:13 UTC

spamd not staying up

Hi All,

   Last month I put in a new mailserver, here are the specs:

FreeBSD 8.3 amd64bit
8GB ram
2TB mirrored disk space
dual Xeon E5310s
Intel motherboard

top output:

last pid: 82946;  load averages:  0.71,  0.74,  0.65    up 5+06:39:07 
13:12:33
94 processes:  1 running, 93 sleeping
CPU:  0.3% user,  0.0% nice,  0.5% system,  0.0% interrupt, 99.2% idle
Mem: 395M Active, 6058M Inact, 1061M Wired, 376M Cache, 827M Buf, 25M Free
Swap: 4096M Total, 548K Used, 4095M Free

The problem is that for seemingly no reason every once in a while
spamd will exit.  It seems to be graceful exit since it deletes it's
pid file - whereas if I do a kill -9 it will not delete the pid file.

I ended up writing a script that checks once an hour for the existence
of spamd in the process table and if it's not there it restarts it.

Over the last month it did it on
10/3
10/4
10/5
10/8
10/11
10/15
10/17
10/18 twice

there is no defined time it does it.  Sometimes in the afternoon, 
sometimes in the morning.  This is under Perl 5.14.2.  The core ram
consumed by the process does not appear to be increasing over time
that it is running.

Any suggestions?

Ted


Re: spamd not staying up

Posted by Duane Hill <du...@gmail.com>.
On Friday, October 19, 2012 at 20:21:13 UTC, tedm@ipinc.net confabulated:

> Hi All,

>    Last month I put in a new mailserver, here are the specs:

> FreeBSD 8.3 amd64bit
> 8GB ram
> 2TB mirrored disk space
> dual Xeon E5310s
> Intel motherboard

> top output:

> last pid: 82946;  load averages:  0.71,  0.74,  0.65    up 5+06:39:07 
> 13:12:33
> 94 processes:  1 running, 93 sleeping
> CPU:  0.3% user,  0.0% nice,  0.5% system,  0.0% interrupt, 99.2% idle
> Mem: 395M Active, 6058M Inact, 1061M Wired, 376M Cache, 827M Buf, 25M Free
> Swap: 4096M Total, 548K Used, 4095M Free

> The problem is that for seemingly no reason every once in a while
> spamd will exit.  It seems to be graceful exit since it deletes it's
> pid file - whereas if I do a kill -9 it will not delete the pid file.

> I ended up writing a script that checks once an hour for the existence
> of spamd in the process table and if it's not there it restarts it.

> Over the last month it did it on
> 10/3
> 10/4
> 10/5
> 10/8
> 10/11
> 10/15
> 10/17
> 10/18 twice

> there is no defined time it does it.  Sometimes in the afternoon, 
> sometimes in the morning.  This is under Perl 5.14.2.  The core ram
> consumed by the process does not appear to be increasing over time
> that it is running.

> Any suggestions?

Have  you  examined  the logs surrounding these times when spamd stops
running?  Perhaps  it  happens  when  sa-update is ran (if you have it
automated) and spamd is not getting started back up again.

-- 
If at first you don't succeed...
...so much for skydiving.


Re: spamd not staying up

Posted by Robert Schetterer <rs...@sys4.de>.
Am 20.10.2012 14:52, schrieb Alexandre Boyer:
> I used monit in the past and had very nasty behaviors, multiple
> instances of the same process running. May be monit is better know.

i use monit since years with no bigger problems, but for sure
i do not use config examples, i edited them for my needs

-- 
Best Regards
MfG Robert Schetterer

[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
Aufsichtsratsvorsitzender: Joerg Heidrich

Re: spamd not staying up

Posted by Alexandre Boyer <bi...@gmail.com>.
Hi there,

This suggestion should be considered as a last chance.

I used monit in the past and had very nasty behaviors, multiple
instances of the same process running. May be monit is better know.

Debuging using your logs and knowledge is the first thing you should do.
Try to find what is your real problem, where does it come from instead
of patching without knowing.

The point from Duane is interesting: did you check that? also check your
messages log (there should be an equivalent to dmsg under freebsd) to
find out kernel warnings, hardware problemes, Perl troubles or such things.

Regards

Alex, from osmose.
Bow before me, for I am root.

On 12-10-20 02:33 AM, Robert Schetterer wrote:
> Am 19.10.2012 22:21, schrieb Ted Mittelstaedt:
>> Hi All,
>>
>>   Last month I put in a new mailserver, here are the specs:
>>
>> FreeBSD 8.3 amd64bit
>> 8GB ram
>> 2TB mirrored disk space
>> dual Xeon E5310s
>> Intel motherboard
>>
>> top output:
>>
>> last pid: 82946;  load averages:  0.71,  0.74,  0.65    up 5+06:39:07
>> 13:12:33
>> 94 processes:  1 running, 93 sleeping
>> CPU:  0.3% user,  0.0% nice,  0.5% system,  0.0% interrupt, 99.2% idle
>> Mem: 395M Active, 6058M Inact, 1061M Wired, 376M Cache, 827M Buf, 25M Free
>> Swap: 4096M Total, 548K Used, 4095M Free
>>
>> The problem is that for seemingly no reason every once in a while
>> spamd will exit.  It seems to be graceful exit since it deletes it's
>> pid file - whereas if I do a kill -9 it will not delete the pid file.
>>
>> I ended up writing a script that checks once an hour for the existence
>> of spamd in the process table and if it's not there it restarts it.
>>
>> Over the last month it did it on
>> 10/3
>> 10/4
>> 10/5
>> 10/8
>> 10/11
>> 10/15
>> 10/17
>> 10/18 twice
>>
>> there is no defined time it does it.  Sometimes in the afternoon,
>> sometimes in the morning.  This is under Perl 5.14.2.  The core ram
>> consumed by the process does not appear to be increasing over time
>> that it is running.
>>
>> Any suggestions?
>>
>> Ted
>>
> as workaround you can use monit
> for monitor and restart, also usefull for other services
>
> you might have to fit example to your needs and distro
>
> i.e
>
> http://mmonit.com/wiki/Monit/ConfigurationExamples#spamd
>
> check process spamd with pidfile /var/run/spamd.pid
>    group mail
>    start program = "/etc/init.d/spamd start"
>    stop  program = "/etc/init.d/spamd stop"
>    if 5 restarts within 5 cycles then timeout
>    if cpu usage > 99% for 5 cycles then alert
>    if mem usage > 99% for 5 cycles then alert
>    depends on spamd_bin
>    depends on spamd_rc
>
>  check file spamd_bin with path /usr/local/bin/spamd
>    group mail
>    if failed checksum then unmonitor
>    if failed permission 755 then unmonitor
>    if failed uid root then unmonitor
>    if failed gid root then unmonitor
>
>  check file spamd_rc with path /etc/init.d/spamd
>    group mail
>    if failed checksum then unmonitor
>    if failed permission 755 then unmonitor
>    if failed uid root then unmonitor
>    if failed gid root then unmonitor
>
>



Re: spamd not staying up

Posted by Robert Schetterer <rs...@sys4.de>.
Am 19.10.2012 22:21, schrieb Ted Mittelstaedt:
> Hi All,
> 
>   Last month I put in a new mailserver, here are the specs:
> 
> FreeBSD 8.3 amd64bit
> 8GB ram
> 2TB mirrored disk space
> dual Xeon E5310s
> Intel motherboard
> 
> top output:
> 
> last pid: 82946;  load averages:  0.71,  0.74,  0.65    up 5+06:39:07
> 13:12:33
> 94 processes:  1 running, 93 sleeping
> CPU:  0.3% user,  0.0% nice,  0.5% system,  0.0% interrupt, 99.2% idle
> Mem: 395M Active, 6058M Inact, 1061M Wired, 376M Cache, 827M Buf, 25M Free
> Swap: 4096M Total, 548K Used, 4095M Free
> 
> The problem is that for seemingly no reason every once in a while
> spamd will exit.  It seems to be graceful exit since it deletes it's
> pid file - whereas if I do a kill -9 it will not delete the pid file.
> 
> I ended up writing a script that checks once an hour for the existence
> of spamd in the process table and if it's not there it restarts it.
> 
> Over the last month it did it on
> 10/3
> 10/4
> 10/5
> 10/8
> 10/11
> 10/15
> 10/17
> 10/18 twice
> 
> there is no defined time it does it.  Sometimes in the afternoon,
> sometimes in the morning.  This is under Perl 5.14.2.  The core ram
> consumed by the process does not appear to be increasing over time
> that it is running.
> 
> Any suggestions?
> 
> Ted
> 

as workaround you can use monit
for monitor and restart, also usefull for other services

you might have to fit example to your needs and distro

i.e

http://mmonit.com/wiki/Monit/ConfigurationExamples#spamd

check process spamd with pidfile /var/run/spamd.pid
   group mail
   start program = "/etc/init.d/spamd start"
   stop  program = "/etc/init.d/spamd stop"
   if 5 restarts within 5 cycles then timeout
   if cpu usage > 99% for 5 cycles then alert
   if mem usage > 99% for 5 cycles then alert
   depends on spamd_bin
   depends on spamd_rc

 check file spamd_bin with path /usr/local/bin/spamd
   group mail
   if failed checksum then unmonitor
   if failed permission 755 then unmonitor
   if failed uid root then unmonitor
   if failed gid root then unmonitor

 check file spamd_rc with path /etc/init.d/spamd
   group mail
   if failed checksum then unmonitor
   if failed permission 755 then unmonitor
   if failed uid root then unmonitor
   if failed gid root then unmonitor


-- 
Best Regards
MfG Robert Schetterer

[*] sys4 AG

http://sys4.de, +49 (89) 30 90 46 64
Franziskanerstraße 15, 81669 München

Sitz der Gesellschaft: München, Amtsgericht München: HRB 199263
Vorstand: Patrick Ben Koetter, Axel von der Ohe, Marc Schiffbauer
Aufsichtsratsvorsitzender: Joerg Heidrich

I think the bayes filter just goes bad if you ignore it

Posted by Cathryn Mataga <ca...@junglevision.com>.
And that no amount of training will fix it once it goes bad.  I was 
getting maybe 30-40 spams through
every day and many of them marked BAYES_00 -- and the last month I've 
been carefully feeding the
software spam and ham lists, all carefully checked, but so much of it 
just kept coming in.

But last night I backed up bayes, reset it, and then retrained with my 
old spam and ham email
collection, and difference is stunning.  Many fewer spam are coming in.

Re: spamd not staying up

Posted by Axb <ax...@gmail.com>.
On 10/19/2012 10:21 PM, Ted Mittelstaedt wrote:

> there is no defined time it does it.  Sometimes in the afternoon,
> sometimes in the morning.  This is under Perl 5.14.2.  The core ram
> consumed by the process does not appear to be increasing over time
> that it is running.
>
> Any suggestions?

IVe gone thru the recurring case that if you run too few spare threads, 
and reload (HUP) spamd after a sa-update or some other reason, you run 
into the condition where spamd is recycling AND reloading at the same 
time and not having enough spare threads spamd vanishes.

I use --min-spare=3 - no more disappearing spamd.
(iirc, per default spamd only uses 2 threads)

Axb