Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 1 Oct 2002 15:41:31 -0700
From:      Justin Lundy <jbl@subterrain.net>
To:        freebsd-hackers@FreeBSD.ORG
Cc:        brian@ukip.com
Subject:   Re: Problem: Too Many open files
Message-ID:  <20021001224131.GA85747@subterrain.net>
In-Reply-To: <NEBBKKNOEKKNLLNMEOHFAEDFHKAA.brian@ukip.com>
References:  <NEBBKKNOEKKNLLNMEOHFAEDFHKAA.brian@ukip.com>

next in thread | previous in thread | raw e-mail | index | archive | help
You are running out of file descriptors. Tune your kern.maxfiles and 
kern.maxfilesperproc sysctl values to allow the system to open more.
I had a similar problem after creating 3,400 virtual hosts in Apache
on one of our production servers.

Here is a blockquote from Section 6.10.1 File/Process Limits, subsection 
6.10.1.1 kern.maxfiles in the FreeBSD Handbook that will help: [1]

"Each open file, socket, or fifo uses one file descriptor. A large-scale 
production server may easily require many thousands of file descriptors, 
depending on the kind and number of services running concurrently.

kern.maxfile's default value is dictated by the MAXUSERS option in your 
kernel configuration file. kern.maxfiles grows proportionally to the value
of MAXUSERS. When compiling a custom kernel, it is a good idea to set this
kernel configuration option according to the uses of your system. From this
number, the kernel is given most of its pre-defined limits. Even though a 
production machine may not actually have 256 users connected as once, the 
resources needed may be similar to a high-scale web server.

Note: As of FreeBSD 4.5, setting MAXUSERS to 0 in your kernel configuration
file will choose a reasonable default value based on the amount of RAM 
present in your system."

References:

[1] http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/configtuning-kernel-limits.html

--jbl

On Fri, May 31, 2002 at 10:03:09AM +0100, Bri wrote:
> Hi I'm getting a Too Many open files message on a FreeBSD 4.5-RELEASE
> machine of mine I originally had the disk in a AMD k5 150 machine with 48MB
> or RAM and it ran fine and the drive was on the Promise Ultra TX2 controller
> card and it all worked fine. Now that I've put the drive in a much bigger
> machine with 500 K6-2 with 512MB or ram it starts getting a Too many open
> files problem
> 
> Even trying to run ls -l gives the messages all though my net access stays
> running as natd continues not matter what it seems it says its something to
> do with /dev/kmem but I'm not sure what this does with memory.
> 
> I don't see any reason a bigger machine should fail where a smaller one
> worked fine maybe I should cvsup my kernel sources my current compile is
> Feburary 29 09:53am 2002 maybe a bit old.
> 
> oh yeah the Hard disk is my trusty IBM 40GB the 7200RPM with 2MB Cache model
> which has always worked great.
> 
> any help appreicated.
> 
> Bri,
> 
> 
> To Unsubscribe: send mail to majordomo@FreeBSD.org
> with "unsubscribe freebsd-hackers" in the body of the message

To Unsubscribe: send mail to majordomo@FreeBSD.org
with "unsubscribe freebsd-hackers" in the body of the message




Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20021001224131.GA85747>