Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 1997 21:10:49 +0300 (EEST)
From:      Narvi <narvi@haldjas.folklore.ee>
To:        Dan Nelson <dnelson@emsphone.com>
Cc:        Cliff Addy <fbsdlist@federation.addy.com>, "Andrew N. Edmond" <edmond@shaman.lycaeum.org>, questions@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: Too many open files in System!
Message-ID:  <Pine.BSF.3.96.970803210902.223C-100000@elwing.folklore.ee>
In-Reply-To: <19970803121953.04717@dan.emsphone.com>

next in thread | previous in thread | raw e-mail | index | archive | help

On Sun, 3 Aug 1997, Dan Nelson wrote:

> In the last episode (Aug 03), Cliff Addy said:
> > On Sun, 3 Aug 1997, Andrew N. Edmond wrote:
> > 
> > > error on accept: Too many open files in system
> > > 
> > > I set CHILD_MAX and OPEN_MAX to 4098 in the kernel, and I can't
> > > find a way to get accept to open any more sockets.  Any ideas?
> > 
> > This seems to be a FAQ (Frequently Asked Question).  Unfortunately,
> > it seems to seems to also be a NAQ (Never Answered Question).  I
> > myself have asked it several times and the answers, involving
> > CHILD_MAX and OPEN_MAX and limits, never work.  Apparently, FreeBSD
> > is too primitive to handle more than a few files at once.
> > 
> > (please realize the above is an intentional goad to get SOMEONE to
> > finally answer this.  I love FreeBSD :) )
> 
> CHILD_MAX and OPEN_MAX don't even affect this parameter; the systemwide
> maximum number of files 2 * (20 + 16 * maxusers), where maxusers is in
				   ^^^^

It might be good to be able to tune this parameter in the kernel config
file easily. MAXUSERS also affects other things which might be better
lefdt unchnaged in many cases.

	Sander

	There is no love, no good, no happiness and no future -
	all these are just illusions.

> your kernel config file.  See /sys/compile/*/param.c for the details.
> 
> You can change this particular parameter on the fly though.  First see
> how many open files you already have; pstat -T will tell you how many
> how many files open and maximum you have in your system:
> 
> 241/3240 files  
> 
> (in my case.)  If you want to raise the limit at runtime, as root run
> "sysctl -w kern.maxfiles=8192" or whatever (you can put this in
> rc.local if you don't want to recompile the kernel).  I was talking on
> IRC a few days ago with someone runing a web server, and he had
> maxfiles set at 16424 (i.e. maxusers=512) with no problems.
> 
> 	-Dan Nelson
> 	dnelson@emsphone.com
> 




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.BSF.3.96.970803210902.223C-100000>