Discussion:
spamd : adjust increase + decrease number of spamd children
Bruno Costacurta
2012-12-17 17:37:51 UTC
Permalink
Hello,

a question about increasing / decreasing children process.
I got following message in log file. Please note timing as increasing
and decreasing actions are consecutive.

Dec 17 13:00:25 vps622 spamd[1335]: prefork: adjust: 0 idle children
less than 1 minimum idle children. Increasing spamd children: 9358
started.
Dec 17 13:00:28 vps622 spamd[1335]: prefork: adjust: 2 idle children
more than 1 maximum idle children. Decreasing spamd children: 9358
killed.
Dec 17 13:00:28 vps622 spamd[1335]: spamd: handled cleanup of child
pid [9358] due to SIGCHLD: interrupted, signal 2 (0002)

Looks normal or my config is wrongly setup ?

spamc configuration is the following:

# /etc/default/spamassassin
ENABLED=1
OPTIONS="--create-prefs --min-spare 1 --max-spare 1 --max-children 5
--helper-home-dir"
PIDFILE="/var/run/spamd.pid"

Thanks for attention and advice.
Bye,
Bruno
--
Linux Counter # 353844
https://linuxcounter.net/user/353844.html
RW
2012-12-17 23:11:03 UTC
Permalink
On Mon, 17 Dec 2012 18:37:51 +0100
Post by Bruno Costacurta
Hello,
a question about increasing / decreasing children process.
I got following message in log file. Please note timing as
increasing and decreasing actions are consecutive.
Dec 17 13:00:25 vps622 spamd[1335]: prefork: adjust: 0 idle children
less than 1 minimum idle children. Increasing spamd children: 9358
start
Dec 17 13:00:28 vps622 spamd[1335]: prefork: adjust: 2 idle children
more than 1 maximum idle children. Decreasing spamd children: 9358
killed.
Dec 17 13:00:28 vps622 spamd[1335]: spamd: handled cleanup of child
pid [9358] due to SIGCHLD: interrupted, signal 2 (0002)
Looks normal or my config is wrongly setup ?
# /etc/default/spamassassin
ENABLED=1
OPTIONS="--create-prefs --min-spare 1 --max-spare 1 --max-children 5
If you set min-spare == max-spare you are likely to get children
created and deleted in rapid succession, the default is 1 and 2.
Bowie Bailey
2012-12-18 16:21:06 UTC
Permalink
Post by RW
On Mon, 17 Dec 2012 18:37:51 +0100
Post by Bruno Costacurta
Hello,
a question about increasing / decreasing children process.
I got following message in log file. Please note timing as
increasing and decreasing actions are consecutive.
Dec 17 13:00:25 vps622 spamd[1335]: prefork: adjust: 0 idle children
less than 1 minimum idle children. Increasing spamd children: 9358
start
Dec 17 13:00:28 vps622 spamd[1335]: prefork: adjust: 2 idle children
more than 1 maximum idle children. Decreasing spamd children: 9358
killed.
Dec 17 13:00:28 vps622 spamd[1335]: spamd: handled cleanup of child
pid [9358] due to SIGCHLD: interrupted, signal 2 (0002)
Looks normal or my config is wrongly setup ?
# /etc/default/spamassassin
ENABLED=1
OPTIONS="--create-prefs --min-spare 1 --max-spare 1 --max-children 5
If you set min-spare == max-spare you are likely to get children
created and deleted in rapid succession, the default is 1 and 2.
Right. Consider this situation starting with an idle server:

1 idle child
email comes in
1 busy child
too few spares, so create one
1 busy child, 1 idle child
email processing finishes
2 idle children
too many idle children, kill one
1 idle child
another email comes in...

Every time an email comes in, the server will have to start a new child
process and every time a child process goes idle, the server will have
to kill one. You need a range so that the server can work more efficiently.
--
Bowie
RW
2012-12-18 17:07:02 UTC
Permalink
On Tue, 18 Dec 2012 11:21:06 -0500
Post by Bowie Bailey
Post by RW
If you set min-spare == max-spare you are likely to get children
created and deleted in rapid succession, the default is 1 and 2.
1 idle child
email comes in
1 busy child
too few spares, so create one
1 busy child, 1 idle child
email processing finishes
2 idle children
too many idle children, kill one
1 idle child
another email comes in...
Every time an email comes in, the server will have to start a new
child process and every time a child process goes idle, the server
will have to kill one. You need a range so that the server can work
more efficiently.
It isn't quite that pedantic about the count. The number of children is
checked when a child becomes idle and after an attempt to reassign
that child to a waiting client connection.

If you process one at a time, you have one idle child before and after
the scan, so no fork happens.

What the OP saw is what happens when a second client comes in before
the first has completed. In that case the second client gets assigned
to the original child and a second child is created and then destroyed
(if there are no further waiting clients).

Loading...