The following reply was made to PR config/897; it has been noted by GNATS. From: Dean Gaudet <[EMAIL PROTECTED]> To: Marc Slemko <[EMAIL PROTECTED]> Subject: Re: config/897: Possible Starving Sockets issue. In same conf 1 virtual getting connection regused, others ok. Intermittant Date: Tue, 22 Jul 1997 13:48:09 -0700 (PDT)
On Tue, 22 Jul 1997, Marc Slemko wrote: > If the connection is refused, that doesn't sound like a > starved socket problem unless the number of unaccepted > connections is hitting somaxconn; Dean? What does that > default to in Linux, how can it be changed? somaxconn in default code maxes at 128. You can increase it by applying a patch I wrote (should work against 2.0.29 or 2.0.30): http://www.arctic.org/~dgaudet/patches/linux-2_0_29-SOMAXCONN.patch If you're running with SYN or RST cookies then you'll know if it's hitting the listen queue length, because it'll start using the cookies and klogd should get messages about that. See /var/log/messages. > If you could work around your need for a Listen directive > for each server, you would eliminate a _lot_ of overhead. > If the file descriptor limitations are the only reason > you need multipl copies of Apache running, finding a > way to make Linux use more would be a good thing. It's easy to go to 1024, but extra changes are needed to go to higher values like 3000 or 4000. There's a patch at http://www.linux.org.za/filehandle.patch.linux which goes to essentially arbitrary amounts (>32768 might be a problem, dunno). My hypothesis, and the reason I was asking if your system was maxed out, is that you've run into a theoretical problem that I've fixed in the 1.3-dev code base. Apache 1.2 always scans sockets in the reverse order of Listen statements. So if some of the early ones are really busy, they could "lock out" some of the later ones. In 1.3 all children rotate through the sockets and keep state between requests. It may not even require a system to be maxed out for this to be a problem. If you're brave, you could try 1.3a1 which will be released hopefully this week. I don't think I could backpatch this for 1.2, I've done a lot of work in that part of http_main.c. I'd love to know if 1.3a1 fixes it ... 'cause it would mean the problem wasn't just theoretical. As Marc said, it'd be good for you to eliminate the use of Listen directives. Probably by going with the descriptor patch. Dean
