From owner-freebsd-questions Thu Sep 12 14:48:53 2002 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 1A1F437B400 for ; Thu, 12 Sep 2002 14:48:50 -0700 (PDT) Received: from dan.emsphone.com (dan.emsphone.com [199.67.51.101]) by mx1.FreeBSD.org (Postfix) with ESMTP id 80DC343E4A for ; Thu, 12 Sep 2002 14:48:49 -0700 (PDT) (envelope-from dan@dan.emsphone.com) Received: (from dan@localhost) by dan.emsphone.com (8.12.6/8.12.5) id g8CLmm4u030571; Thu, 12 Sep 2002 16:48:48 -0500 (CDT) (envelope-from dan) Date: Thu, 12 Sep 2002 16:48:48 -0500 From: Dan Nelson To: Soheil Shaghaghi Cc: freebsd-questions@FreeBSD.ORG Subject: Re: Open files limit Message-ID: <20020912214846.GE42486@dan.emsphone.com> References: <20020912183244.5C46137B401@hub.freebsd.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-OS: FreeBSD 5.0-CURRENT X-message-flag: Outlook Error User-Agent: Mutt/1.5.1i 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 In the last episode (Sep 12), Soheil Shaghaghi said: > Hello everyone, > I am running a FreeBSD 4.6 server > I get a lot of too many open files in the system. > Searching the net, I found the reason. > Looking at the limits, here is what I get: > ulimit -a > open files 1064 > > Question: > > 1. I know that the number of open files should be increased, but I > don't know to what number! Can I set it to unlimited? Is there a > problem with doing this? I am running about 100 virtual hosts and a > Java chat server and a music server on this machine. You can't set it to unlimited, since there is a file table in the kernel and it has a size. Luckily it is dynamically adjustable. > 2. Can anyone recommend a different settings than the above, so I can > change it all at once? > > 3. The documents say to change the value and recompile the kernel. Do > I have to specify the new values in the kernel, and if so how? You don't even have to reboot. Run "sysctl kern.maxfiles" to print the current value, then double (or triple) it, and run "sysctl -w kern.maxfiles=####". You can put a line like "kern.maxfiles=####" in /etc/sysctl.conf to have the change made on every reboot. You may also have to edit /etc/login.conf and adjust any "openfiles=####" lines that might be lowering the per-process limit. -- Dan Nelson dnelson@allantgroup.com To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-questions" in the body of the message