|
|||||||||||
|
reaching incoming connections queued max, what happens?
From: Micah Anderson <micah(at)riseup.net>
Date: Fri Sep 28 2007 - 13:01:23 EDT I was interested to find out what would happen if spamd was totally overloaded, so I set my --max-children=1 and --max-conn-per-child=1 and then started hitting spamd with spamc and -t timeout values to see what happens. Essentially, each connection (simultaneously generated) took 1 second longer than the previous and at the -t value the message was returned unscanned. I believe this is what could be expected. According to the spamd man page:
-m number , --max-children=number
This option specifies the maximum number of children to spawn.
Incoming connections can still occur if all of the children are busy, however those
connections will be queued waiting for a free child.
Please note that there is a OS specific maximum of connections that can be queued
(Try "perl -MSocket -e’print SOMAXCONN’" to find this maximum).
This leads me to wonder what would happen if I hit my SOMAXCONN with incoming messages, would they not be queued up? The SOMAXCONN on my linux box appears to be 128. So to test, I did the following on my spamd server, and then restarted spamd: echo "5" > /proc/sys/net/core/somaxconn I then issued 15 simultaneous connections with the -t value set to 15. Each individual connection took one second longer than the previous, as before, and those connections that took over the -t value were returned unscanned, as before. What puzzles me however is the fact that all of the connections acted just as before, when the SOMAXCONN was set to 128. Since each connection is coming in at exactly the same time I would expect that the first one would get accepted by spamd, 5 connections would be queued up, and then the 6+ connections would not be queued up and something would happen, but it doesn't, its the same as before... odd. These are the time results for each individual spamc connection:
Micah Received on Fri Sep 28 13:02:29 2007 This archive was generated by hypermail 2.1.8 : Sat Oct 27 2007 - 21:55:19 EDT |
||||||||||
|
|||||||||||