httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From (Robert S. Thau)
Subject Re: possible bug?
Date Fri, 09 Aug 1996 23:08:50 GMT
  So what was the fix for the infamous SOMAXCONN problem?

Oh, for a well-organized archive.

To go through the problem in detail, what happens is that the
operating system generally clips the maximum number of waiting
connections in listen() to some value which is lower than what the
server itself requests.  On sufficiently old systems, such as SunOS,
the default is to clip it outrageously low, like around 5.

Now, you'd think that this wouldn't make a difference unless Apache
stopped accepting connections.  The problem with that theory is that
TCP connections start up with a "three-way handshake", which means
that each connection the server accepts spends some amount of time in
a half-accepted state, where the kernel can't hand it off to Apache,
since it hasn't actually been accepted yet, but at the same time, it
still counts against the quota.  If you have enough of these at one
time, they block any further attempts to connect.  (This can often
happen when some remote router goes down, and you were in the middle
of three-way handshakes with clients on the other side of it, which
handshakes will never complete).

The fix is to raise the maximum allowed value for the second argument
of listen().  Unfortunately, the way you do that varies from Unix to
Unix, and on SunOS, it's ugly as hell, as the number in question is
compiled into the kernel.  I think robh posted a procedure to this
list a while ago --- I may try digging it out over the weekend if no
one beats me to it.


View raw message