You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by Justin Mason <jm...@jmason.org> on 2004/10/05 07:16:24 UTC

Re: Memory footprint of spamd 3.0

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1


Jerry Glomph Black writes:
> spamd 3.0 does preforking of the child processes.
> 
> Nothing wrong with that, but WHY do the children have such enormous RSS
> numbers already when started (>20 Meg per process)?  To me, this makes
> no sense.
> 
> 3.0 has rendered two decent machines of mine useless by snarfing up all
> the RAM.
> 
> Can this be put back to the old fork-on-demand model?   I'm convinced
> that the current forking scheme is broken.
> 
> Is the old 2.6x spamd code compatible enough to run with all the 3.0
> perl apparatus?

most of this memory is shared.  spamd preloads as much as possible
upfront, to maximise memory sharing -- including all the rules, compiled
into perl code etc.  recent investigation (can't recall bug #) is showing
that this is working, too...

- --j.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
Comment: Exmh CVS

iD8DBQFBYi4oQTcbUG5Y7woRAvODAKDiWxNLCaKaBCf+61/Yfd2z7hbGTACcDQSU
aNq6h+LAU/vLNcqu9bRuHlo=
=h/kR
-----END PGP SIGNATURE-----


Re: Memory footprint of spamd 3.0

Posted by Jon Trulson <jo...@radscan.com>.
On Tue, 5 Oct 2004, Michael Parker wrote:

> On Tue, Oct 05, 2004 at 10:22:42AM -0700, Morris Jones wrote:
>>
>> I watched a spamd child grow to 250MB yesterday on a single message.  I
>> have a suspicion that the memory usage growth is happening on a whitelist
>> or bayes database maintenance event of some sort.
>>
>
> For folks that are seeing huge jumps in memory, instead of gradual
> growth, how are you calling SA?
>

 	spamd (on a fast machine) via spamass-milter on the MX host.  I 
use no external rules (only sa 3.0 supplied ones).  I do not use Razor, 
DCC, or the others.  I do use the DNSBL's.  It happens a couple of times a 
day, and always the jump is to 320MB.  The messages themselves (according 
to the logs) are only around 2-3k.  I think it is a bug somewhere. 
Limiting the children to 1 message before termination seems to be doing 
well to keep it under control.  No more untagged spam has slipped through 
since I enabled it Sunday.

 	OTOH, SA 3.0 seems to be doing a *much* better job at catching 
spam.  Big improvement over 2.6x, so I'll keep it :)

> Thanks,
> Michael
>

-- 
Jon Trulson    mailto:jon@radscan.com
ID: 1A9A2B09, FP: C23F328A721264E7 B6188192EC733962
PGP keys at http://radscan.com/~jon/PGPKeys.txt
#include <std/disclaimer.h>
"I am Nomad." -Nomad


Re: Memory footprint of spamd 3.0

Posted by Morris Jones <mo...@whiteoaks.com>.
On Thu, 7 Oct 2004, Jeff Tucker wrote:

> I captured an exact copy of one of the messages that was being scanned 
> when this happened. 
> [ ... ]
> Rescanning the same message by calling spamc didn't cause the 
> problem. The scan completed in just a couple of seconds.

I did exactly the same experiment with the same result.

You have Bayes turned off, I have it on.  I'm also using auto-whitelist.

Clearly there's nothing significant about the triggering message.

I'm doing fine with --max-conn-per-child=10 for now.

Cheers,
Mojo
-- 
Morris Jones         <*>
Monrovia, CA
mojo@whiteoaks.com
http://www.whiteoaks.com


Re: Memory footprint of spamd 3.0

Posted by Jeff Tucker <je...@jltnet.com>.
Michael Parker wrote:
> On Tue, Oct 05, 2004 at 10:22:42AM -0700, Morris Jones wrote:
> 
>>I watched a spamd child grow to 250MB yesterday on a single message.  I
>>have a suspicion that the memory usage growth is happening on a whitelist
>>or bayes database maintenance event of some sort.
>>
> 
> 
> For folks that are seeing huge jumps in memory, instead of gradual
> growth, how are you calling SA?
> 
> Thanks,
> Michael
> 

I, too, am seeing the 250MB spamd processes. I've been doing some 
research on this and I'll share what I know.

I'm using SA 3.0.0 with spamd and the qmail-spamc wrapper which really 
just pipes the email into spamc. It's pretty common that one of the 
machines doing the filtering will have a spamd process jump to 250MB or 
more of memory usage. I have several machines doing filtering and each 
will have a problem several times per hour. I am not using Bayes at all, 
so this doesn't have anything to do with that. Since I'm using spamc, 
I've got its default behavior which is to not scan any message over 250KB.

First, I've been told that perl never really frees memory, even when it 
isn't using it any more. So, if a single message causes a spamd to jump 
up to hundreds of MB's, it will stay that way until the process exits 
entirely. Setting the --max-conn-per-child to a lower number will help 
make sure these don't stick around too long. With the default of 200 and 
a bunch of spamd processes, it could be hours before a spamd dies on a 
server that isn't busy. Pick a time limit that seems reasonable to you, 
say five minutes, and adjust --max-conn-per-child to make the processes 
die about that often.

I captured an exact copy of one of the messages that was being scanned 
when this happened. This particular message took something like 10 
minutes to scan. We deliver to maildirs, so it was easy to get a copy of 
it, although it's possible there was an extra header line by the time I 
had it. Rescanning the same message by calling spamc didn't cause the 
problem. The scan completed in just a couple of seconds.

One interesting thing is that I have some machines that do this and a 
couple that don't. The ones that don't were built slightly later than 
the ones that do. Actually, the SpamAssassin installs were done at the 
same time and are identical, but other system software isn't exactly the 
same vintage. The machines that are having problems all have perl 5.8.0. 
The machines that don't all run perl 5.8.4. There might be small 
differences in the versions of other libraries, too. Maybe this is 
exercising a perl bug?

This extreme memory usage does cause real problems for us. If two 
spamd's get messed up at the same time, the machine starts thrashing to 
swap. (The machines all have 1 GB of RAM). When that happens, mail 
processing slows way down, which unfortunately means it takes even 
longer for the spamd's to process enough messages to go ahead and die.

One last note, when the spamd is processing a trouble message, it seems 
like it is usually running 99% CPU. It might drop CPU usage after that 
message, but like I said earlier it doesn't drop memory usage until it 
dies. Why a small message would cause spamd to go to 99% CPU for 
minutes, I don't know.

JT


Re: Memory footprint of spamd 3.0

Posted by Jim Gifford <ma...@jg555.com>.
Michael Parker wrote:

>On Tue, Oct 05, 2004 at 12:25:45PM -0500, Michael Parker wrote:
>  
>
>>On Tue, Oct 05, 2004 at 10:22:42AM -0700, Morris Jones wrote:
>>    
>>
>>>I watched a spamd child grow to 250MB yesterday on a single message.  I
>>>have a suspicion that the memory usage growth is happening on a whitelist
>>>or bayes database maintenance event of some sort.
>>>
>>>      
>>>
> 
>Better question.
>
>Of all the folks seeing memory issues, are you using ok_languages in
>your config somewhere?  If not, please speak up as well.
>
>Thanks
>Michael
>  
>
I use ok_locales.

-- 
----
Jim Gifford
maillist@jg555.com


Re: Memory footprint of spamd 3.0

Posted by Jon Trulson <jo...@radscan.com>.
On Fri, 8 Oct 2004, Michael Parker wrote:

> On Tue, Oct 05, 2004 at 12:25:45PM -0500, Michael Parker wrote:
>> On Tue, Oct 05, 2004 at 10:22:42AM -0700, Morris Jones wrote:
>>>
>>> I watched a spamd child grow to 250MB yesterday on a single message.  I
>>> have a suspicion that the memory usage growth is happening on a whitelist
>>> or bayes database maintenance event of some sort.
>>>
>
> Better question.
>
> Of all the folks seeing memory issues, are you using ok_languages in
> your config somewhere?  If not, please speak up as well.
>

 	I am using 'ok_locales en'.


-- 
Jon Trulson    mailto:jon@radscan.com
ID: 1A9A2B09, FP: C23F328A721264E7 B6188192EC733962
PGP keys at http://radscan.com/~jon/PGPKeys.txt
#include <std/disclaimer.h>
"I am Nomad." -Nomad


Re: Memory footprint of spamd 3.0

Posted by Morris Jones <mo...@whiteoaks.com>.
On Fri, 8 Oct 2004, Michael Parker wrote:

> Of all the folks seeing memory issues, are you using ok_languages in
> your config somewhere?  If not, please speak up as well.

Yes:
ok_languages	en

Mojo
-- 
Morris Jones         <*>
Monrovia, CA
mojo@whiteoaks.com
http://www.whiteoaks.com


Re: Memory footprint of spamd 3.0

Posted by Michael Parker <pa...@pobox.com>.
On Tue, Oct 05, 2004 at 12:25:45PM -0500, Michael Parker wrote:
> On Tue, Oct 05, 2004 at 10:22:42AM -0700, Morris Jones wrote:
> > 
> > I watched a spamd child grow to 250MB yesterday on a single message.  I
> > have a suspicion that the memory usage growth is happening on a whitelist
> > or bayes database maintenance event of some sort.
> > 
 
Better question.

Of all the folks seeing memory issues, are you using ok_languages in
your config somewhere?  If not, please speak up as well.

Thanks
Michael

Razor service down?

Posted by Jerry Glomph Black <sp...@glomph.com>.
I'm getting connection refused on port 2703 for all the cloudmark.com servers.

Oct 07 10:28:47.241994 check[8774]: [ 3] Unable to connect to thrill.cloudmark.com:2703; Reason: Connection refused.
Oct 07 10:28:47.264952 check[8774]: [ 3] Unable to connect to wonder.cloudmark.com:2703; Reason: Connection refused.
Oct 07 10:28:47.287666 check[8774]: [ 3] Unable to connect to pride.cloudmark.com:2703; Reason: Connection refused.
Oct 07 10:28:47.444759 check[8774]: [ 3] Unable to connect to thrill.cloudmark.com:2703; Reason: Connection refused.




Re: Memory footprint of spamd 3.0

Posted by Jon Trulson <jo...@radscan.com>.
On Thu, 7 Oct 2004, Jon Trulson wrote:

> On Thu, 7 Oct 2004, Michael Parker wrote:
>
>> On Thu, Oct 07, 2004 at 10:53:30AM -0600, Jon Trulson wrote:
>>> 
>>> 	FWIW, in our case a child would go to 320MB and just stay there
>>> until the child was terminated (even after finishing a message).  We do
>>> use AWL and bayes.
>>> 
>> 
>> Is it possible to try and find the msgs that was being scanned at that
>> point in time?  If so, can you reproduce by re-processing that
>> message?
>> 
>> Also, if you can, do an sa-learn --dump magic shortly after the jump
>> happens and see what it says for the "last expiry atime" value.  Does
>> it happen to match when you saw the memory jump?
>> 
>
> 	I'll give that a shot this weekend when I'll have time to try to 
> watch for it to happen.
>

 	I missed the actual message (though it was only 2.5K, rejected at 
MTA), but I did happen to see one of the blowups happen this morning - to 
325MB.

 	The "last expiry atime" did indeed correspond with the time of the 
blowup.

FWIW, here is the output of 'sa-learn --dump magic'

[ pulsar ] sa-learn --dump magic
0.000          0          3          0  non-token data: bayes db version
0.000          0     175877          0  non-token data: nspam
0.000          0     132455          0  non-token data: nham
0.000          0     149125          0  non-token data: ntokens
0.000          0 1097168279          0  non-token data: oldest atime
0.000          0 1097513975          0  non-token data: newest atime
0.000          0          0          0  non-token data: last journal sync 
atime
0.000          0 1097513872          0  non-token data: last expiry atime
0.000          0     345600          0  non-token data: last expire atime 
delta
0.000          0      15505          0  non-token data: last expire 
reduction count

The time 1097513872 (Mon Oct 11 10:57:52 2004) - matches when the the 
blowup started.  The scan for this particular message lasted 125.9 
seconds, and ran the CPU at 99% until the child exited. I am using 
'--max-conn-per-child=1' option to spamd.

I am also running Perl 5.8.0, if that makes a diff.

-- 
Jon Trulson    mailto:jon@radscan.com
ID: 1A9A2B09, FP: C23F328A721264E7 B6188192EC733962
PGP keys at http://radscan.com/~jon/PGPKeys.txt
#include <std/disclaimer.h>
"I am Nomad." -Nomad


Re: Memory footprint of spamd 3.0

Posted by Jon Trulson <jo...@radscan.com>.
On Thu, 7 Oct 2004, Michael Parker wrote:

> On Thu, Oct 07, 2004 at 10:53:30AM -0600, Jon Trulson wrote:
>>
>> 	FWIW, in our case a child would go to 320MB and just stay there
>> until the child was terminated (even after finishing a message).  We do
>> use AWL and bayes.
>>
>
> Is it possible to try and find the msgs that was being scanned at that
> point in time?  If so, can you reproduce by re-processing that
> message?
>
> Also, if you can, do an sa-learn --dump magic shortly after the jump
> happens and see what it says for the "last expiry atime" value.  Does
> it happen to match when you saw the memory jump?
>

 	I'll give that a shot this weekend when I'll have time to try to 
watch for it to happen.


-- 
Jon Trulson    mailto:jon@radscan.com
ID: 1A9A2B09, FP: C23F328A721264E7 B6188192EC733962
PGP keys at http://radscan.com/~jon/PGPKeys.txt
#include <std/disclaimer.h>
"I am Nomad." -Nomad


Re: Memory footprint of spamd 3.0

Posted by Michael Parker <pa...@pobox.com>.
On Thu, Oct 07, 2004 at 10:53:30AM -0600, Jon Trulson wrote:
> 
> 	FWIW, in our case a child would go to 320MB and just stay there 
> until the child was terminated (even after finishing a message).  We do 
> use AWL and bayes.
> 

Is it possible to try and find the msgs that was being scanned at that
point in time?  If so, can you reproduce by re-processing that
message?

Also, if you can, do an sa-learn --dump magic shortly after the jump
happens and see what it says for the "last expiry atime" value.  Does
it happen to match when you saw the memory jump?

Thanks
Michael

Re: Memory footprint of spamd 3.0

Posted by Jon Trulson <jo...@radscan.com>.
On Wed, 6 Oct 2004, Michael Parker wrote:

> On Wed, Oct 06, 2004 at 10:19:17AM -0300, Luis Hernán Otegui wrote:
>> In my specific case, the ponit isn't only woth the big memory usage
>> jumps, but with SA keeping the memory, and never releasing it.
>
> Highwater marks, common in most perl applicatios, don't concern me as
> much as these HUGE jumps in memory that folks are seeing.  Jumps that
> just keep chewing memory without stopping.
>


spamd opts: -c -d -m 20 --max-conn-per-child=1

> There are places in the code where we could use memory a little more
> efficiently, I found one yesterday in fact, and we will work on these
> over time.  In 2.x, the fork-on-demand model allowed us to be much
> more liberal with our data structures.  We just need to wrangle that
> in a little with the 3.0 pre-fork code.
>

 	FWIW, in our case a child would go to 320MB and just stay there 
until the child was terminated (even after finishing a message).  We do 
use AWL and bayes.

> Michael
>

-- 
Jon Trulson    mailto:jon@radscan.com
ID: 1A9A2B09, FP: C23F328A721264E7 B6188192EC733962
PGP keys at http://radscan.com/~jon/PGPKeys.txt
#include <std/disclaimer.h>
"I am Nomad." -Nomad

Re: Memory footprint of spamd 3.0

Posted by Michael Parker <pa...@pobox.com>.
On Wed, Oct 06, 2004 at 10:19:17AM -0300, Luis Hernán Otegui wrote:
> In my specific case, the ponit isn't only woth the big memory usage
> jumps, but with SA keeping the memory, and never releasing it.

Highwater marks, common in most perl applicatios, don't concern me as
much as these HUGE jumps in memory that folks are seeing.  Jumps that
just keep chewing memory without stopping.

There are places in the code where we could use memory a little more
efficiently, I found one yesterday in fact, and we will work on these
over time.  In 2.x, the fork-on-demand model allowed us to be much
more liberal with our data structures.  We just need to wrangle that
in a little with the 3.0 pre-fork code.

Michael

Re: Memory footprint of spamd 3.0

Posted by Theo Van Dinter <fe...@kluge.net>.
On Wed, Oct 06, 2004 at 10:19:17AM -0300, Luis Hernán Otegui wrote:
> jumps, but with SA keeping the memory, and never releasing it.

Well, there's really no way to do that at the application level -- it's up to
the OS.  Typically what happens is:

- process wants X memory
- process gets X memory allocated from kernel
- process uses X memory
- process frees (free()) X memory
- kernel keeps memory allocated to process figuring it'll use it again (and to
  avoid all the overhead of cleanup/reallocation, etc.)

So the goal needs to be: don't use the memory in the first place.  Anything
after that is only fixable by restarting the process.

-- 
Randomly Generated Tagline:
"But these go to 11..."               - Spinal Tap

Re: Memory footprint of spamd 3.0

Posted by Luis Hernán Otegui <lu...@gmail.com>.
On Tue, 5 Oct 2004 12:25:45 -0500, Michael Parker <pa...@pobox.com> wrote:
> On Tue, Oct 05, 2004 at 10:22:42AM -0700, Morris Jones wrote:
> >
> > I watched a spamd child grow to 250MB yesterday on a single message.  I
> > have a suspicion that the memory usage growth is happening on a whitelist
> > or bayes database maintenance event of some sort.
> >
> 
> For folks that are seeing huge jumps in memory, instead of gradual
> growth, how are you calling SA?
> 
> Thanks,
> Michael
> 
I'm calling it via spamass-milter. In the Spamd init script I have this options:
OPTIONS="-d -x -u spamd -H /var/spool/spamassassin/"
and in the spamassmilter init script, this ones:
SM_EXTRA_FLAGS="-r 15 -m -u spamd -fb quarantine@quimica.unlp.edu.ar
-i 163.10.18.0/32 -i 163.10.7.0/32"
In my specific case, the ponit isn't only woth the big memory usage
jumps, but with SA keeping the memory, and never releasing it.

-- 
-------------------------------------------------
GNU-GPL: "May The Source Be With You...
-------------------------------------------------

Re: Memory footprint of spamd 3.0

Posted by Morris Jones <mo...@whiteoaks.com>.
On Tue, 5 Oct 2004, Michael Parker wrote:

> On Tue, Oct 05, 2004 at 10:22:42AM -0700, Morris Jones wrote:
> > 
> > I watched a spamd child grow to 250MB yesterday on a single message.  I
> > have a suspicion that the memory usage growth is happening on a whitelist
> > or bayes database maintenance event of some sort.
> > 
> 
> For folks that are seeing huge jumps in memory, instead of gradual
> growth, how are you calling SA?
> 
> Thanks,
> Michael

I'm running spamd -d -c --max-conn-per-child=10

In /etc/procmailrc I have:

:0fw
* < 256000
| /usr/bin/spamc

Mojo
-- 
Morris Jones         <*>
Monrovia, CA
mojo@whiteoaks.com
http://www.whiteoaks.com


Re: Memory footprint of spamd 3.0

Posted by Michael Parker <pa...@pobox.com>.
On Tue, Oct 05, 2004 at 10:22:42AM -0700, Morris Jones wrote:
> 
> I watched a spamd child grow to 250MB yesterday on a single message.  I
> have a suspicion that the memory usage growth is happening on a whitelist
> or bayes database maintenance event of some sort.
> 

For folks that are seeing huge jumps in memory, instead of gradual
growth, how are you calling SA?

Thanks,
Michael

Re: Memory footprint of spamd 3.0

Posted by Kai Schaetzl <ma...@conactive.com>.
Morris Jones wrote on Tue, 5 Oct 2004 10:22:42 -0700 (PDT):

> I watched a spamd child grow to 250MB yesterday on a single message.
>

This can happen sometimes (rarely) with 2.6x as well! I have already seen 
900 MB spamds.


Kai

-- 

Kai Schätzl, Berlin, Germany
Get your web at Conactive Internet Services: http://www.conactive.com
IE-Center: http://ie5.de & http://msie.winware.org




Re: Memory footprint of spamd 3.0

Posted by Theo Van Dinter <fe...@kluge.net>.
[moving to dev since there's nothing private at this point]

On Tue, Oct 05, 2004 at 07:59:23PM -0500, Michael Parker wrote:
[discussion about having the parent doing forking for bayes expire, etc.]
> I looked at this briefly today.  There are some Apache::*
> modules that we could mimic to accomplish the same thing.  So I think
> we could come up with a solution on our own.

The first thing is to get the parent involved in things.

For 3.1, I was thinking of making spamd parent run as root (or whoever
launches it), and do all the logging and everything.  It'll spawn off
children, which do the checks as current.  The children will run the
checks to see if a sync or expire is necessary, but not actually do
the work.

Along with the results from the run being sent to the parent for logging
purposes, the child can pass back a "bayes expire user" type command which
spamd will then use to fork() and do the work.  There'll have to be some form
of "max work children" option, and either the work will have to be
best-effort, or a queue will have to be built up.  I'd probably not bother
with prefork on that one.

This is pretty much the httpd model, and would also let us do a min/max
servers instead of spawning them all at once, based on the number of
incoming requests, etc.

-- 
Randomly Generated Tagline:
I suppose that :byte could also take an argument to force a particular
 old-style (single-byte) locale, if we choose to support them, and are
 willing to take the consequences of Jarkko going postal.  :-)
              -- Larry Wall in <20...@wall.org>

Re: Memory footprint of spamd 3.0

Posted by Theo Van Dinter <fe...@kluge.net>.
On Tue, Oct 05, 2004 at 05:30:32PM -0700, Loren Wilton wrote:
> It seems a solution here might be to have a spamd child that notices it
> needs to to maintenance should either pass that off to another child created
> specifically for that purpose, or else die after performing the maintenance

Yeah, I had actually thought about doing that in the future.  Right now,
that's not possible due to the way the code gets run.

The plan, BTW, was for the parent spamd to be more involved in things
in the future, and the child would report to the parent that some work needs
doing (like expire user foo's bayes tokens), and it would then fork off
a process to do it.

-- 
Randomly Generated Tagline:
"Oh, go and eat my alarm clock."          - Matt

Re: Memory footprint of spamd 3.0

Posted by Loren Wilton <lw...@earthlink.net>.
> I watched a spamd child grow to 250MB yesterday on a single message.  I
> have a suspicion that the memory usage growth is happening on a whitelist
> or bayes database maintenance event of some sort.

It seems a solution here might be to have a spamd child that notices it
needs to to maintenance should either pass that off to another child created
specifically for that purpose, or else die after performing the maintenance
.

Of course, that is based on the speculation that the maintenance  is causing
the extra memory usage, which is still speculation.

        Loren


Re: Memory footprint of spamd 3.0

Posted by Morris Jones <mo...@whiteoaks.com>.
On Tue, 5 Oct 2004, Theo Van Dinter wrote:

> Well, it's not running a single child, it's that each child should
> only run 1 message before dying.  It's right in the spamd docs, but
> "--max-conn-per-child=1" is what you're looking for.

I set mine to --max-conn-per-child=10 as a compromise, and it's doing very
well for me.  At least if a 250MB spamd pops up, it won't live very long.

I watched a spamd child grow to 250MB yesterday on a single message.  I
have a suspicion that the memory usage growth is happening on a whitelist
or bayes database maintenance event of some sort.

One solution might be to have a child terminate after one of these events
to reclaim the memory.

Of course, here I am speculating about it without actually diving into
the code to propose a solution.

Regards,
Mojo
-- 
Morris Jones         <*>
Monrovia, CA
mojo@whiteoaks.com
http://www.whiteoaks.com


Re: Memory footprint of spamd 3.0

Posted by Theo Van Dinter <fe...@kluge.net>.
On Mon, Oct 04, 2004 at 10:42:54PM -0700, Loren Wilton wrote:
> There is an option to only run a single child, which is claimed to be
> equivalent to the 2.6x implementation.  I don't recall the option
> (something=1), but Theo posted it within the last day here.  And I'm almost
> positive it is in the docs somewhere.

Well, it's not running a single child, it's that each child should
only run 1 message before dying.  It's right in the spamd docs, but
"--max-conn-per-child=1" is what you're looking for.

It's not a "fork per message" model, it'll still prefork, but the child will
only survive 1 message then die, and there's no config copying going on, etc.

"fork per message" was simple, but very inefficient.  The "prefork" model
is more efficient (and has the potential to become even more efficient),
but it's also a lot more complex.

> 2.    The copying of the config back and forth with preforking has a few
> minor but serious problems.

It's really not efficient either, but the main problems with it right
now are all caused by Storable module bugs, iirc.

> 3.    There is a problem with spamd children getting hung out to dry on a
> read that never completes.

Seems to only affect a handful of people though, fyi.

> 4.    I suspect that 3.0 is inherently less memory efficient than 2.6x; but
> probably not by a huge amount.

Yes and no.  3.0 does a hell of a lot more than 2.6 did, so that means more
memory usage.

-- 
Randomly Generated Tagline:
#else /* !STDSTDIO */     /* The big, slow, and stupid way */
              -- Larry Wall in str.c from the perl source code

Re: Memory footprint of spamd 3.0

Posted by Maurice Lucas <ms...@taos-it.nl>.
From: "Loren Wilton" <lw...@earthlink.net>
Sent: Tuesday, October 05, 2004 7:42 AM

>> Any chance in going back to something that actually worked?   I tried
> running a
>> 2.64 version of spamd, but got a mountain of bayes-related errors.
>
> There is an option to only run a single child, which is claimed to be
> equivalent to the 2.6x implementation.  I don't recall the option
> (something=1), but Theo posted it within the last day here.  And I'm 
> almost
> positive it is in the docs somewhere.
>
> Just watching what people have been reporting, I've come to several
> tentative conclusions on 3.0 as it currently stands:
>
> 1.    I'm about 70% convinced there is an undiscvered memory leak or other
> resource leak that has the equivalent result.
> 2.    The copying of the config back and forth with preforking has a few
> minor but serious problems.
> 3.    There is a problem with spamd children getting hung out to dry on a
> read that never completes.

I had this problem and I'm checking on the moment if I found the "bug".
The message was deleted before spamc was killed so with a sleep in my spamc 
call script I hope to be able to close my problem

> 4.    I suspect that 3.0 is inherently less memory efficient than 2.6x; 
> but
> probably not by a huge amount.
>
> I think that when the first three problems are addressed and solved that 
> 3.0
> will become a whole lot more generally usable.
>

With kind regards,
Met vriendelijke groet,

Maurice Lucas
TAOS-IT 


Re: Memory footprint of spamd 3.0

Posted by Loren Wilton <lw...@earthlink.net>.
> Any chance in going back to something that actually worked?   I tried
running a
> 2.64 version of spamd, but got a mountain of bayes-related errors.

There is an option to only run a single child, which is claimed to be
equivalent to the 2.6x implementation.  I don't recall the option
(something=1), but Theo posted it within the last day here.  And I'm almost
positive it is in the docs somewhere.

Just watching what people have been reporting, I've come to several
tentative conclusions on 3.0 as it currently stands:

1.    I'm about 70% convinced there is an undiscvered memory leak or other
resource leak that has the equivalent result.
2.    The copying of the config back and forth with preforking has a few
minor but serious problems.
3.    There is a problem with spamd children getting hung out to dry on a
read that never completes.
4.    I suspect that 3.0 is inherently less memory efficient than 2.6x; but
probably not by a huge amount.

I think that when the first three problems are addressed and solved that 3.0
will become a whole lot more generally usable.

        Loren


Re: Memory footprint of spamd 3.0

Posted by Theo Van Dinter <fe...@kluge.net>.
On Tue, Oct 05, 2004 at 09:06:04AM -0600, Sherwood Botsford wrote:
> Perhaps code to say, "What's my present memory usage?"
> when it starts up, and a periodic "Hmm my memory usage has
> grown by 20%. time to die."

Unfortunately, there's no real way to do that.

> Or perhaps a config entry/commandline parameter that says
> filter a hundred messages then croak.

Already exists.  RTFM. :)   The default is 200 per child, btw.

-- 
Randomly Generated Tagline:
"My opinions may have changed, but not the fact that I am right."
                      - Ashleigh Brilliant

Re: Memory footprint of spamd 3.0

Posted by Sherwood Botsford <sb...@sjsa.ab.ca>.
On Monday 04 October 2004 23:24, Jerry Glomph Black wrote:
> Good enough argument, but the new version has killed off
> two machines that have successfully run SA/spamd with no
> problems since Jan 2002.
>
> The machines leak into oblivion, and Something Bad
> happens (major daemons killed off, etc.).
>
> There is definitely some kind of memory resource problem
> (if not an outright leak) going on.    Which reverting to
> the old fork-on-demand -might- help.

Perhaps code to say, "What's my present memory usage?"
when it starts up, and a periodic "Hmm my memory usage has
grown by 20%. time to die."

Or perhaps a config entry/commandline parameter that says
filter a hundred messages then croak.

In the mean time, how about an hourly cronjob that kills and 
restarts spamd

E.g:  /usr/local/bin/spamd -r /var/run/spamd.pid -d
Crontab entry:
0  *  *  *  *    root    "kill -HUP `cat /var/run/spamd.pid`




-- 
Sherwood Botsford
St. John's School of Alberta


Re: Memory footprint of spamd 3.0

Posted by Jerry Glomph Black <sp...@glomph.com>.
Good enough argument, but the new version has killed off two machines
that have successfully run SA/spamd with no problems since Jan 2002.

The machines leak into oblivion, and Something Bad happens (major daemons killed 
off, etc.).

There is definitely some kind of memory resource problem (if not an outright 
leak) going on.    Which reverting to the old fork-on-demand -might- help.

I always marvelled at how SA was different from most perl programs, since they
generally hog a machine's resources if running long enough.   Perhaps this is 
finally happening with this persistent-process model.

Any chance in going back to something that actually worked?   I tried running a 
2.64 version of spamd, but got a mountain of bayes-related errors.



On Mon, 4 Oct 2004, Justin Mason wrote:

>
> Jerry Glomph Black writes:
>> spamd 3.0 does preforking of the child processes.
>>
>> Nothing wrong with that, but WHY do the children have such enormous RSS
>> numbers already when started (>20 Meg per process)?  To me, this makes
>> no sense.
>>
>> 3.0 has rendered two decent machines of mine useless by snarfing up all
>> the RAM.
>>
>> Can this be put back to the old fork-on-demand model?   I'm convinced
>> that the current forking scheme is broken.
>>
>> Is the old 2.6x spamd code compatible enough to run with all the 3.0
>> perl apparatus?
>
> most of this memory is shared.  spamd preloads as much as possible
> upfront, to maximise memory sharing -- including all the rules, compiled
> into perl code etc.  recent investigation (can't recall bug #) is showing
> that this is working, too...
>