You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@httpd.apache.org by Dean Gaudet <dg...@arctic.org> on 1997/06/25 12:06:23 UTC

fd slack & BSDI

I've received two bug reports from BSDI users that say the patch doesn't
help, but they can run > 128 descriptors on 1.1.3.  But I've tracked down
why.  The problem wasn't directly slack, or a different ordering of
descriptor opening.  It was the child_main loop rewrite which removed the
special case for a single descriptor that existed in 1.1.3.  In pre
1.2bsomething there was a special case that called accept() directly
without first calling select(). 

1.2 also has the select() called while doing B_SAFEREAD.   But I wrote
that one defensively and if the select() fails it just flushes anyhow,
wasting a bit of net traffic only on pipelining clients.

Under BSDI 2.0 it is *not* fixed by compiling with -DFD_SETSIZE=nnn where
nnn is large enough.  It could be bogosity in the C library, or just a
kernel build time option.  But I don't have access to a BSDI box where I
could rebuild the kernel and try with a larger FD_SETSIZE.

I can fix the listen select by reordering how files are opened.  I just
open the listening sockets before opening the logs.  It's not sufficient
to just return to pre-1.2 behaviour with a single accept(), because that
behaviour breaks on multiple Listens.  The reordering should still be
OK on solaris if HIGH_SLACK_LINE is defined.  This isn't perfect, but
it decreases the situations where errors can happen.

We should add a if (sd >= FD_SETSIZE) test into the loop which constructs
the fd_sets, and error out if it fails.  The same test needs to go into
the safe read code.  Without that test we're actually trashing random
stack space.

Oh yeah, note that with only the reordering and without the slack patch
it mostly works.  Reverse DNS fails -- so it's clear that BSDI 2.0's
bind library has FD_SETSIZE=256.

I'll put together a patch weds night (PDT).  Unfortunately I had to make
plans for weds aft so I can't do anything about 1.2.1. 

Oh yeah and I'll try to summarize all of this descriptor madness in code
comments somewhere.

Dean


Re: fd slack & BSDI

Posted by Marc Slemko <ma...@worldgate.com>.
BSDI 2.1 doesn't appear to have such a problem from reports I have...

On Wed, 25 Jun 1997, Dean Gaudet wrote:

> I've received two bug reports from BSDI users that say the patch doesn't
> help, but they can run > 128 descriptors on 1.1.3.  But I've tracked down