Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 3 Aug 1997 12:19:53 -0500
From:      Dan Nelson <dnelson@emsphone.com>
To:        Cliff Addy <fbsdlist@federation.addy.com>
Cc:        "Andrew N. Edmond" <edmond@shaman.lycaeum.org>, questions@FreeBSD.ORG, hackers@FreeBSD.ORG
Subject:   Re: Too many open files in System!
Message-ID:  <19970803121953.04717@dan.emsphone.com>
In-Reply-To: <Pine.BSF.3.95q.970803114414.5334B-100000@federation.addy.com>; from "Cliff Addy" on Sun Aug  3 11:47:44 GMT 1997
References:  <Pine.BSF.3.96.970803072629.4490C-100000@necropolis.org> <Pine.BSF.3.95q.970803114414.5334B-100000@federation.addy.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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
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?19970803121953.04717>