*BSD News Article 67844


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!news.vbc.net!garlic.com!fox.almaden.ibm.com!uunet!in2.uu.net!salliemae!newsfeed.internetmci.com!realtime.net!web1.bga.com!not-for-mail
From: dpm@web1.bga.com (David P. Maynard)
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: how to increase the number of sockets per process?
Date: 6 May 1996 14:03:35 -0500
Organization: Flametree Corporation
Lines: 26
Message-ID: <4mlie7$s1d@web1.bga.com>
References: <4mc5qp$kgt@doctor.nl2k.edmonton.ab.ca> <4me12t$jpv@kaleka.seanet.com>
NNTP-Posting-Host: web1.realtime.net
X-RTcode: 9ae108a7312c63083a8e4d97

In article <4me12t$jpv@kaleka.seanet.com>,  <kostya@osd.com> wrote:
>I installed apache 1.0.5 with a patch that BSDI sent me. But the problem seems  
>to be not with apache itself but with "select" system call which can't handle  
>mode than 256 file descriptors in fd_set. And since apache opens 2 files for  
>every virtual host this number goes over 256 when you have over 124 virtual  
>hosts (or so). When logging transaction apache calls gethostbyaddr to get a  
>host name of the remote host. Gethostbyaddr creates a socket and calls select  
>to wait for an answer. And since that socket file descriptor is larger than 256  
>select returns an error "Invalid argument". 

I haven't done this under 2.1 yet, but I do have apache serving 130+
virtual servers under BSD/OS 2.01.  For 2.01, you have to make a
kernel patch.  I think the kernel problem is supposed to be fixed in
2.1 though.  Try recompiling apache with FD_SETSIZE set to a higher
value than 256.  Also be sure that the file descriptor limit is set
appropriately.  (You must have already tweaked it, or you would have
hit the limit a long time go.)  I found the necessary kernel tweak for
2.0X in the archives for one of the BSDI newsgroups.  If you need to,
try searching on www.dejanews.com for FD_SETSIZE.

-dpm

-- 
 David P. Maynard, Flametree Corporation
 EMail: dpm@flametree.com,  Tel: +1 512 670 4090,  Fax: +1 512 251 8308
--