From owner-freebsd-hackers Sun Aug 3 10:20:10 1997 Return-Path: Received: (from root@localhost) by hub.freebsd.org (8.8.5/8.8.5) id KAA03411 for hackers-outgoing; Sun, 3 Aug 1997 10:20:10 -0700 (PDT) Received: from dan.emsphone.com (dan@dan.emsphone.com [199.67.51.101]) by hub.freebsd.org (8.8.5/8.8.5) with ESMTP id KAA03348; Sun, 3 Aug 1997 10:20:01 -0700 (PDT) Received: (from dan@localhost) by dan.emsphone.com (8.8.6/8.8.6) id MAA19542; Sun, 3 Aug 1997 12:19:54 -0500 (CDT) Message-ID: <19970803121953.04717@dan.emsphone.com> Date: Sun, 3 Aug 1997 12:19:53 -0500 From: Dan Nelson To: Cliff Addy Cc: "Andrew N. Edmond" , questions@FreeBSD.ORG, hackers@FreeBSD.ORG Subject: Re: Too many open files in System! References: Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Mailer: Mutt 0.79e In-Reply-To: ; from "Cliff Addy" on Sun Aug 3 11:47:44 GMT 1997 X-OS: FreeBSD 2.2-970701-RELENG Sender: owner-freebsd-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk 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