From owner-freebsd-questions@FreeBSD.ORG Wed Jun 4 07:30:47 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 9B68837B404 for ; Wed, 4 Jun 2003 07:30:47 -0700 (PDT) Received: from sage-one.net (adsl-65-71-135-137.dsl.crchtx.swbell.net [65.71.135.137]) by mx1.FreeBSD.org (Postfix) with ESMTP id 6169643F3F for ; Wed, 4 Jun 2003 07:30:46 -0700 (PDT) (envelope-from jackstone@sage-one.net) Received: from sagea (adsl-65-68-247-73.dsl.crchtx.swbell.net [65.68.247.73]) by sage-one.net (8.12.6p2/8.12.6) with SMTP id h54EUW1v038365; Wed, 4 Jun 2003 09:30:34 -0500 (CDT) (envelope-from jackstone@sage-one.net) Message-Id: <3.0.5.32.20030604093036.013716d8@sage-one.net> X-Sender: jackstone@sage-one.net X-Mailer: QUALCOMM Windows Eudora Pro Version 3.0.5 (32) Date: Wed, 04 Jun 2003 09:30:36 -0500 To: Roman Neuhauser , freebsd-questions From: "Jack L. Stone" In-Reply-To: <20030604132909.GE29699@freepuppy.bellavista.cz> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" X-Spam-Status: No, hits=-1.0 required=4.5 tests=EMAIL_ATTRIBUTION,IN_REP_TO version=2.54-sage_one.rules_v1 X-Spam-Checker-Version: SpamAssassin 2.54-sage_one.rules_v1 (1.174.2.17-2003-05-11-exp) 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:30:47 -0000 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. 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. Best regards, Jack L. Stone, Administrator SageOne Net http://www.sage-one.net jackstone@sage-one.net