*BSD News Article 59133


Return to BSD News archive

Path: euryale.cc.adfa.oz.au!newshost.anu.edu.au!harbinger.cc.monash.edu.au!msunews!agate!news.mindlink.net!uniserve!usenet
From: tom@uniserve.com (Tom Samplonius)
Newsgroups: comp.unix.bsd.netbsd.misc
Subject: Re: How to run a process in NetBSD with more than 20 sockets
Date: 10 Jan 1996 06:46:28 GMT
Organization: UNIServe Online
Lines: 38
Distribution: world
Message-ID: <4cvnc4$6if@atlas.uniserve.com>
References: <4cqk7e$1gi@nntp.Stanford.EDU>
NNTP-Posting-Host: pc.sdf.com
Mime-Version: 1.0
Content-Type: Text/Plain; charset=US-ASCII
X-Newsreader: WinVN 0.99.6

In article <4cqk7e$1gi@nntp.Stanford.EDU>, pct@lyra.stanford.edu says...
>
>There is a limit of file descriptors table size in NetBSD, it is 20 I guess.
>I think by getfdtablesize() I can get it. The problem is I would like to
>run up at least 100 sockets/file descriptors in one process, so that it
>can serve at least a hundred tcp connections.
>
>I tried, but the software crashed with "Broken Pipe" after the 19-22 sockets
>get connected. That is not going to help my requirements.
>
>Anyone knows where in kernel code that spec the file descriptor table size,
>and may be by hacking it I can get NetBSD to do the thing I want it to do.
>

  You don't need to hack anything.  First of all, check the "limit" (internal 
csh command) to make sure that you aren't running up against a soft limit.

  Otherwise you will need to put an option in your kernel config file, and just 
rebuild your kernel.  There is a document describing all the acceptable options 
for kernel config files.

>
>Another solution to my problem can be I can fork() at least 100 processes
>to serve 100 tcp connections. But in NetBSD, processes are expensive, kernel
>panic after 40th processes, and hangs. If in each process I can reducee the
>virtual space to my needs only, freeing up VM addresses for fellow processed,
>I may be able to make it, but how to free up Virtual Memory in each process ?

  I don't understand this one.  Generally a panic causes a reboot.

  Only as much VM as needed is allocated for each process.  How much swap-space 
do you have?

  Panics are bugs.  Especially reproducable panics.


Tom