From owner-freebsd-questions@FreeBSD.ORG Wed Jun 4 07:54:48 2003 Return-Path: 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 A4AEB37B401 for ; Wed, 4 Jun 2003 07:54:48 -0700 (PDT) Received: from mail.bellavista.cz (mail.bellavista.cz [213.235.167.218]) by mx1.FreeBSD.org (Postfix) with ESMTP id 2200343F85 for ; Wed, 4 Jun 2003 07:54:47 -0700 (PDT) (envelope-from neuhauser@bellavista.cz) Received: from freepuppy.bellavista.cz (freepuppy.bellavista.cz [10.0.0.10]) by mail.bellavista.cz (Postfix) with ESMTP id 996F045E; Wed, 4 Jun 2003 16:54:44 +0200 (CEST) Received: by freepuppy.bellavista.cz (Postfix, from userid 1001) id DCB762FDAB2; Wed, 4 Jun 2003 16:54:43 +0200 (CEST) Date: Wed, 4 Jun 2003 16:54:43 +0200 From: Roman Neuhauser To: "Jack L. Stone" Message-ID: <20030604145443.GH29699@freepuppy.bellavista.cz> Mail-Followup-To: "Jack L. Stone" , freebsd-questions References: <20030604132909.GE29699@freepuppy.bellavista.cz> <3.0.5.32.20030604093036.013716d8@sage-one.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <3.0.5.32.20030604093036.013716d8@sage-one.net> User-Agent: Mutt/1.5.1i cc: freebsd-questions Subject: Re: max open files reached X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.1 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 04 Jun 2003 14:54:48 -0000 # jackstone@sage-one.net / 2003-06-04 09:30:36 -0500: > At 03:29 PM 6.4.2003 +0200, Roman Neuhauser wrote: > >I have a script run by periodic(8) in the daily batch that is supposed > >to backup all databases from the local MySQL server using > >mysqlhostcopy(1). It used to run fine for a few months, but has > >been failing consistently with ENFILE (23) lately. > > > >The box is an Intel Celeron 533 (or some such) with 128 MB RAM. These > >are all the related sysctl knobs I could find. This is as of 20:40, so > >the value of kern.openfiles is reasonable. > > > >roman@ishtar ~ 1001:0 > sysctl -a kern|grep files > >kern.maxfiles: 2024 > >kern.maxfilesperproc: 1821 > >kern.openfiles: 512 > > > >I've cranked the kern.maxfiles value to 4096, and the backup has run to > >completion again, but am I risking anything? I mean, the fd's cost > >memory, is there any potential for problems? > > > > I don't see any problems with raising to 4096 as 2024 looks awful low. Most > of mine run 12000+ and the lowest at about 8000. I do have more CPU and RAM > in the equation. What do you have the "maxusers" set to in your kernel? I > have found this will usually take care of making the correct calculations > for the max files. A setting of "0" is good for later versions of FBSD. > Don't remember what version changed this & you didn't mention your version. it was @(#)FreeBSD 4.7-STABLE #0: Thu Dec 26 19:32:12 CET 2002 till ten minutes ago, and is 4.8-STABLE now. both kernels have maxusers set to 0: roman@ishtar ~ 1014:0 > strings /kernel|grep -E ^___maxusers ___maxusers 0 roman@ishtar ~ 1015:0 > strings /kernel.old|grep -E ^___maxusers ___maxusers 0 That looks like the old value was indeed decided by the kernel itself (it's 4072 on my PC w/ 256MB and 10216 on a box that has 640MB). > Otherwise, you'll need to set the max files in your /boot/loader.conf so > they stay up at the 4096, or whatever workable level is good for you. I've put it in sysctl.conf, works fine. Thanks for the reply. -- If you cc me or remove the list(s) completely I'll most likely ignore your message. see http://www.eyrie.org./~eagle/faqs/questions.html