From owner-freebsd-questions Tue Feb 4 7:25:13 2003 Delivered-To: freebsd-questions@freebsd.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 5EAB137B401 for ; Tue, 4 Feb 2003 07:25:11 -0800 (PST) Received: from sage-american.com (adsl-65-71-135-139.dsl.crchtx.swbell.net [65.71.135.139]) by mx1.FreeBSD.org (Postfix) with ESMTP id 5A21443F75 for ; Tue, 4 Feb 2003 07:25:05 -0800 (PST) (envelope-from jackstone@sage-one.net) Received: from sagea (sagea.sage-american [192.168.0.3]) by sage-american.com (8.12.6/8.12.6) with SMTP id h14FNJ4K074628; Tue, 4 Feb 2003 09:23:20 -0600 (CST) (envelope-from jackstone@sage-one.net) Message-Id: <3.0.5.32.20030204092319.01ee3530@sage-one.net> X-Sender: jackstone@sage-one.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Tue, 04 Feb 2003 09:23:19 -0600 To: Ruben de Groot , aSe From: "Jack L. Stone" Subject: Re: Too many files open / file: table is full Cc: FreeBSD-Questions , Ruben de Groot In-Reply-To: <20030204064340.GA82189@ei.bzerk.org> References: <20030203135208.GA78364@ei.bzerk.org> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, hits=-1.3 required=4.5 tests=IN_REP_TO,QUOTED_EMAIL_TEXT,REFERENCES,SPAM_PHRASE_02_03 version=2.43-jlsrules1 Sender: owner-freebsd-questions@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.ORG At 07:43 AM 2.4.2003 +0100, Ruben de Groot wrote: >On Tue, Feb 04, 2003 at 12:16:23AM -0500, aSe typed: >> >This is not a matter of diskspace. The kernel holds a fixed length table >> >in memory with all open files. If this table gets full it usually means >> >one of two things: >> > >> >1) You have a runaway application, opening way too many files. Identify >> >the application and fix or disable it. >> > >> >2) You're running a kernel with a too low value for maxusers (which, >> >among other things, determines the maximum amount of open files). The >> >default in 4.7-RELEASE is 0, which means: optimize according to amount >> >of memory installed. The default is usually O.K. If not, one option is >> >to simply install more memory. >> >> The machine itself runs several logging applications and things of that >> nature. I didn't think It was an issue with HD. Nor do I believe its ram, >> It has 512mb installed, and 256mb of swap. As it stands right now it has >> 270mb free and hasn't touched the swap. Right now maxusers is set to 6, >> I didn't realize it would play a role in this instance. > >You should set maxusers to 0. That way, it will be sized at boot time >according to the amount of memory you installed. > >> Jack Stone suggested looking up the number of max open files by doing >> "sysctl kern.maxfiles" It returns only "232" which to me seems like a >> very small number. He also suggested to change it using >> "sysctl -w kern.maxfiles=4160." >> >> My question to you is, does maxusers play more of a role then just >> the max number of open files. In the long run would it be better to >> just set maxusers to 0 or just change the kern.maxfiles? > >It does. According to tuning(7): > > kern.maxusers controls the scaling of a number of static system tables, > including defaults for the maximum number of open files, sizing of net- > work memory resources, etc. > >You can set maxusers to 0 by either recompiling your kernel or by setting >the value in loader.conf(5) > >Ruben > >> >> Thank you! >> Gordon Keesler [aSe@SysFail.com] >> BTW, in looking at the tuning(7), it specifically says this about maxfiles. Note the "typically a few thousand" setting: The kern.maxfiles sysctl determines how many open files the system sup- ports. The default is typically a few thousand but you may need to bump this up to ten or twenty thousand if you are running databases or large descriptor-heavy daemons. The read-only kern.openfiles sysctl may be interrogated to determine the current number of open files on the system. Best regards, Jack L. Stone, Administrator SageOne Net http://www.sage-one.net jackstone@sage-one.net To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message