httpd-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ben Laurie <...@gonzo.ben.algroup.co.uk>
Subject Re: listen, select, etc.
Date Mon, 16 Dec 1996 23:03:29 GMT
sameer wrote:
> 
> 	I'd like approval before committing the following. I have
> learned the following about select() on FreeBSD. Do people know what
> it is like on other OSes? I'd also like to have the information about
> how Listen works confirmed, as I'm not intimately familiar with that
> bit of code.
> 	(I suppose I should add that Apache will log "select error:
> Invalid argument" when things aren't sized right)

It is generally true that you must set FD_SETSIZE if you want to use more than
the default number of file descriptors. Whether the kernel can handle it, in
general, is another questions. Certainly a caveat emptor.

Cheers,

Ben.

> 
> 
> Index: bind.html
> ===================================================================
> RCS file: /export/home/cvs/apache/htdocs/manual/bind.html,v
> retrieving revision 1.4
> diff -c -r1.4 bind.html
> *** bind.html   1996/12/02 18:13:38     1.4
> --- bind.html   1996/12/16 23:39:59
> ***************
> *** 83,88 ****
> --- 83,114 ----
>   &lt;VirtualHost&gt; is set for an address and port that the server is
>   not listening to, it cannot be accessed.
>   
> + <H2>Listen and <CODE>select()</CODE></H2>
> + 
> + When using Listen, Apache is listening to a socket for each Listen
> + directive, and does a <CODE>select()</CODE> over all of those sockets.
> + In installations with large numbers of virtualhosts, this select() may
> + cause a problem because some OSes have difficulty with large numbered
> + file descriptors in a <CODE>select()</CODE><P>
> + 
> + <DL>
> + 
> + <DT>FreeBSD
> + <DD>
> + 
> + FreeBSD prior to 2.2 had a default limit for the number of descriptors
> + one could select() over as 256. In order to increase that limit you
> + would have to recompile the kernel and set FD_SETSIZE to a larger
> + value, and make sure that FD_SETSIZE is set to that same large value
> + when you compile Apache. FreeBSD after 2.2 has no default limit in the
> + kernel, but you still need to make sure you set FD_SETSIZE to a larger
> + number when compiling Apache so that the header files define the right
> + sizes for the fd_set data structures that get passed to
> + <CODE>select()</CODE><P>
> + 
> + </DL>
> + 
> + 
>   <h2>See also</h2>
>   
>   See also the documentation on
> 
> -- 
> Sameer Parekh					Voice:   510-986-8770
> President					FAX:     510-986-8777
> C2Net
> http://www.c2.net/				sameer@c2.net

-- 
Ben Laurie                Phone: +44 (181) 994 6435  Email: ben@algroup.co.uk
Freelance Consultant and  Fax:   +44 (181) 994 6472
Technical Director        URL: http://www.algroup.co.uk/Apache-SSL
A.L. Digital Ltd,         Apache Group member (http://www.apache.org)
London, England.          Apache-SSL author

Mime
View raw message