You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@spamassassin.apache.org by David Bartmess <di...@edingo.net> on 2004/07/14 18:44:00 UTC
Duplicate spamd process being started when processing mail
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
I'm having a problem in that I have spamd started by /etc/init.d/spamassassin
with the "-d -c -u" parameters, but everytime the email client starts the
filter (in KMail, using a filter that just pipes the email into
"/usr/bin/spamc" with no parameters), it starts a brand new spamd process.
The output from ps is below, both before an email arrives, and during (wasn't
a trick to catch it during, since /var/log/mail/info reports spamc taking
anywhere from 15-30 seconds PER EMAIL).
My questions are:
WHY is it taking so long to process each email?
And WHY does it start a new spamd process? I thought spamd was a "server" of
sorts, and would just process each request from spamc as it came in???
Thanks for any answers!
BEFORE:
[dingodave@Dingo Conduit]$ ps ax | grep spam
12223 ? S 0:09 /usr/bin/spamd -d -c -u dingodave
13090 pts1 R 0:00 grep spam
DURING:
[dingodave@Dingo Conduit]$ ps ax | grep spam
12223 ? S 0:09 /usr/bin/spamd -d -c -u dingodave
13096 ? S 0:00 /bin/sh -c (/usr/bin/spamc)
</tmp/kde-dingodave/kontactFzbFPa.tmp
13097 ? S 0:00 /usr/bin/spamc
13098 ? R 0:05 /usr/bin/spamd -d -c -u dingodave
13111 pts1 R 0:00 grep spam
- --
David A. Bartmess
Software Configuration Manager / Sr. Software Developer
eDingo Enterprises
http://edingo.net
But one should not forget that money can buy a bed but not sleep,
finery but not beauty, a house but not a home,
medicine but not health, luxuries but not culture,
sex but not love, and amusements but not happiness.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA9WLQVfozuyBfRXIRAujJAKCxY6NePHzHw2Jn9ecGLEyzNx2cuQCeO+sM
G4BfYStTNowulUm/+ST9tTg=
=a7oj
-----END PGP SIGNATURE-----
Re: Duplicate spamd process being started when processing mail
Posted by Matt Kettler <mk...@evi-inc.com>.
At 01:32 PM 7/14/2004, David Bartmess wrote:
>I am using Razor, thought I had it all set up correctly, but double-checking
>my shorewall setup.
Fair enough.. keep in mind that razor sends outbound connections to two
different ports on the razor servers, tcp/7 and tcp/2703.
(The servers don't need to initiate connections back, but they do need to
send replies. Use stateful filtering or ack-flag required as a filter on
the inbound replies and you should be fine.)
Re: Duplicate spamd process being started when processing mail
Posted by David Bartmess <di...@edingo.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 14 July 2004 11:11 am, Matt Kettler wrote:
> At 12:44 PM 7/14/2004, David Bartmess wrote:
> >WHY is it taking so long to process each email?
>
> That could be any one of MANY problems.
> 1) are you running out of ram?
> 2) are DNSBLs timing out?
> 3) are you using razor or DCC? Did you correctly set up your
> firewall to allow them to communicate?
> 4) are you using any "huge" add-on rulesets like bigevil,
> sa-blacklist.cf, etc.
OK, have to check some of this out. Not sure of the answers. I am using a few
larger rulesets, but I do know I'm not out of RAM (512Mg, with only 80% max
usage at any given time).
How can I check whether the DNSBLs are timing out? I don't see anything in my
logs about those.
I am using Razor, thought I had it all set up correctly, but double-checking
my shorewall setup.
Thanks!
- --
David A. Bartmess
Software Configuration Manager / Sr. Software Developer
eDingo Enterprises
http://edingo.net
But one should not forget that money can buy a bed but not sleep,
finery but not beauty, a house but not a home,
medicine but not health, luxuries but not culture,
sex but not love, and amusements but not happiness.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA9W5GVfozuyBfRXIRAlEkAKCkb+CY5+qh+ntmebbOepZ+ZKpuoACcC8mH
UI6rlj+WFbKZnzjG7LNZLCA=
=7tUP
-----END PGP SIGNATURE-----
Re: Duplicate spamd process being started when processing mail
Posted by Matt Kettler <mk...@evi-inc.com>.
At 12:44 PM 7/14/2004, David Bartmess wrote:
>WHY is it taking so long to process each email?
That could be any one of MANY problems.
1) are you running out of ram?
2) are DNSBLs timing out?
3) are you using razor or DCC? Did you correctly set up your
firewall to allow them to communicate?
4) are you using any "huge" add-on rulesets like bigevil,
sa-blacklist.cf, etc.
>And WHY does it start a new spamd process? I thought spamd was a "server" of
>sorts, and would just process each request from spamc as it came in???
Spamd is a FORKING server, much like apache and sendmail. It forks new
processes as needed to handle the inbound request. If all the existing
children are busy, a new one is created.
You can use the -m parameter to limit the maximum number of children, but
several people have had problems making it work in 2.63, most notably when
you don't daemonize spamd with -d it doesn't seem to properly self-limit.
Re: Duplicate spamd process being started when processing mail
Posted by David Bartmess <di...@edingo.net>.
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1
On Wednesday 14 July 2004 11:05 am, Theo Van Dinter wrote:
> On Wed, Jul 14, 2004 at 10:44:00AM -0600, David Bartmess wrote:
> > "/usr/bin/spamc" with no parameters), it starts a brand new spamd
> > process.
>
> Well, how do you know it starts a brand new process?
>
> > And WHY does it start a new spamd process? I thought spamd was a "server"
> > of sorts, and would just process each request from spamc as it came in???
>
> I can't tell from your output (try "ps -ef" instead (depends on your
> OS)), but what is likely happening is that when spamc connects to spamd,
> spamd forks a process to deal with the request. You can tell this
> is what happens via the "ps -ef" because instead of pid 1 being the
> parent, it'll be the pid of another spamd. So it's not a "brand new"
> spamd, but actually just a processing child which gets spawned off per
> incoming connection.
>
> In 3.0, when you launch spamd, it'll spawn X children (5 by default), so
> you end up with 6 spamd processes. When spamc connects, it'll "randomly"
> get one of the children which will then process the message. To make
> it easier to figure out what is going on, we have the spamd children
> change their process name to be obvious:
>
> $ ps -ef | grep spamd
> root 7460 1 0 Jul13 ? 00:00:00 /usr/bin/spamd -d -c -H -r
> /var/run/spamd.pid -m 2 root 5388 7460 1 07:53 ? 00:03:48 spamd
> child
> root 7853 7460 0 08:00 ? 00:01:32 spamd child
That makes sense, now, thanks... Still have the slow response issue, but I'm
investigating that a little more.. No problem in amount of memory space, so
it may be a DNSBL issue. I need to look at the results from those calls...
Thanks!
- --
David A. Bartmess
Software Configuration Manager / Sr. Software Developer
eDingo Enterprises
http://edingo.net
But one should not forget that money can buy a bed but not sleep,
finery but not beauty, a house but not a home,
medicine but not health, luxuries but not culture,
sex but not love, and amusements but not happiness.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)
iD8DBQFA9W2hVfozuyBfRXIRAne1AKCz7ynpaLk/Z7avC9p4Co7RofwyKwCfbQaK
YQtb+XM9eIEZ89aHTeU4kQo=
=V34L
-----END PGP SIGNATURE-----
Re: Duplicate spamd process being started when processing mail
Posted by Theo Van Dinter <fe...@kluge.net>.
On Wed, Jul 14, 2004 at 10:44:00AM -0600, David Bartmess wrote:
> "/usr/bin/spamc" with no parameters), it starts a brand new spamd process.
Well, how do you know it starts a brand new process?
> And WHY does it start a new spamd process? I thought spamd was a "server" of
> sorts, and would just process each request from spamc as it came in???
I can't tell from your output (try "ps -ef" instead (depends on your
OS)), but what is likely happening is that when spamc connects to spamd,
spamd forks a process to deal with the request. You can tell this
is what happens via the "ps -ef" because instead of pid 1 being the
parent, it'll be the pid of another spamd. So it's not a "brand new"
spamd, but actually just a processing child which gets spawned off per
incoming connection.
In 3.0, when you launch spamd, it'll spawn X children (5 by default), so
you end up with 6 spamd processes. When spamc connects, it'll "randomly"
get one of the children which will then process the message. To make
it easier to figure out what is going on, we have the spamd children
change their process name to be obvious:
$ ps -ef | grep spamd
root 7460 1 0 Jul13 ? 00:00:00 /usr/bin/spamd -d -c -H -r /var/run/spamd.pid -m 2
root 5388 7460 1 07:53 ? 00:03:48 spamd child
root 7853 7460 0 08:00 ? 00:01:32 spamd child
--
Randomly Generated Tagline:
*/ \* <-Tribbles having a swordfight