httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jeff Trawick <traw...@attglobal.net>
Subject Re: FD_SETSIZE comparison
Date Wed, 07 Jan 2004 01:00:38 GMT
Brian Akins wrote:
> Call me stupid, put why in various places does Apache do things like this:
> if (csd >= FD_SETSIZE) {
>         ap_log_error(APLOG_MARK, APLOG_WARNING, 0, NULL,
>                      "new file descriptor %d is too large; you probably 
> need "
>                      "to rebuild Apache with a larger FD_SETSIZE "
>                      "(currently %d)",
>                      csd, FD_SETSIZE);
>         apr_socket_close(sock);
>         return;
>     }
> 
> On linux, at least, FD_SETSIZE is fairly low (1024), yet the actually 
> max file descriptors can be much, much higher (we have thousands per 
> process with squid).

If APR uses select() to implement send/recv/connect timeouts, some code 
some where needs to check for FD_SETSIZE to prevent that select() logic 
from blowing up (it could even overlay storage).

But APR doesn't use select() on most boxes since poll() is pretty 
standard nowadays.  The plan is to yank these checks from Apache 2.1-dev 
(which uses APR 1.0) and change APR 1.0 to implement the check only on 
the dwindling set of platforms where select() is used.


Mime
View raw message