Hi,
Justin Mason wrote:
-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
there's been a few reports of this, but we're really mystified. A test case would help, but it doesn't seem easily reproducable for anyone :(
- --j.
You could add a fragment like this to spamd (introducing a dependency on Proc::ProcessTable)
---------- use Proc::ProcessTable; my $MEMLIMIT = 64 * 1024 * 1024; my $mypid = $$; my $t = Proc::ProcessTable->new; my $isbloaty = 0; # print join("\n", $t->fields), "\n"; scantable: foreach my $p (@{$t->table}) { if ($p->pid == $mypid) { # print $p->size, "\n", $p->rss, "\n"; if ($p->size > $MEMLIMIT) { $isbloaty = 1; } last scantable: } }
if ($isbloaty) { # terminate child } ----------
or use it as a basis for an external 'nanny' script to kill bloated spamd's:
---------- use Proc::ProcessTable; my $MEMLIMIT = 64 * 1024 * 1024; my $t = Proc::ProcessTable->new; # print join("\n", $t->fields), "\n"; foreach my $p (@{$t->table}) { if ($p->cmndline =~ /\bspamd\b/) { if ($p->size > $MEMLIMIT) { # whack bloaty spamd } } } # add some sanity checking to find out if you've killed all spamd # processes and restart spamd if it was running in the first place # (don't start spamd if it wasn't running) ----------
The upside is that 'nanny' scripts make an operator's life easier and give engineering some breathing room to fix problems as well as gather environmental data and log restarts to provide clues to the problem. The downside is you run the risk of never actually solving the underlying problem and shifting responsibility away from engineering to operations.
I hate nanny scripts because they're laced with subtle logic traps and they can mask problems if people aren't committed to fixing the code. Sadly, they're often essential when dealing with commercial software and lazy/slow/insular/stupid vendors.
-- Bob