*BSD News Article 67907


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!news.mira.net.au!inquo!hookup!uwm.edu!newsfeed.internetmci.com!solaris.cc.vt.edu!news.seanet.com!usenet
From: kostya@osd.com
Newsgroups: comp.unix.bsd.bsdi.misc
Subject: Re: how to increase the number of sockets per process?
Date: 7 May 1996 18:20:00 GMT
Organization: Seanet Online Services, Seattle WA
Lines: 34
Message-ID: <4mo48g$mgv@kaleka.seanet.com>
References: <4mlie7$s1d@web1.bga.com>
Reply-To: kostya@osd.com
NNTP-Posting-Host: ukbar.osd.com

In article <4mlie7$s1d@web1.bga.com> dpm@web1.bga.com (David P. Maynard)  
writes:
>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.

This is fixed in 2.1. But I'd rather patch 2.0.1 than upgrade. Recompiling  
apache will not help, because apache (1.0.5) doesn't use select and FD_SETSIZE  
at all. Instead resolver library should be recompiled. Number of file  
descriptors - apache increases it as necessary (up to a system limit).

I will look for the patch.

Thank you
--
Konstantin Martynenko
Seanet Corporation