archive: Re: maximum file descriptors-linux

Alan Spicer (tech@ebiznet.com)
Tue, 29 Sep 1998 12:12:53 -0400


* Hello,
I have a Linux box (P400 256Mb Ram, 6Gb IDE Drive) running uname -r
2.0.34 kernel from RedHat 5.0 in a high web traffic environment.
Apache 1.3.1 Web Server (Hard Server Limit: 512). I am still running
into problems at 256 servers (256 * [Apache httpd]). The problem
manifests itself when CGI programs refuse to run at 256 servers up.
"error_log" entries indicate: Resource Temporarily Unavailable. I
haven't checked lately but before the below checks/changes the
problem gets worse somewhere above 300, ... maybe 350? Anyway in
the 300's somewhere other programs fail to run ... syslog: Fork:
Resource Temporarily Unavailable.

Any suggestions are appreciated. Do the system 'C' Libraries need
to be recompiled also? Or is this some other limitation? If this
can be done, I need to be able to run this server at least up to
500 httpd's. If there is something else that I need to do ... the
steps to do it would be greatly appreciated! ;-)

>Date: Tue, 22 Sep 1998 08:16:01 -0400
>From: Alan Spicer <aspicer@ebiznet.com>
>Organization: Electronic Business Network
>X-Mailer: Mozilla 4.05 [en] (Win95; I)
>To: aspicer@ebiznet.com
>Subject: archive: Re: maximum file descriptors-linux
>
>http://www.netmud.com/~glenn/mushhacks/0492.html archive: Re:
>maximum file descriptors-linux Re: maximum file descriptors-linux
>
> Samuli K{rkk{inen (hskarkka@cc.hut.fi)
> Tue, 10 Sep 1996 20:52:21 +0300 (EET DST) Messages sorted by: [ date ][
>thread ][ subject ][ author ] Previous message: Leaf: "maximum file
>descriptors-linux" In reply to: Leaf: "maximum file descriptors-linux"
>> I am wondering if in pursuit of larger logins anyone has solved the
> > problem of increasing the file descriptors in linux...
> >
> > I recognize this is a linux question and not a real mush question but I
> > think the answer is important to anyone who wishes to raise the number of
> > users beyond 150 or so...
> A way to do that on Linux 2.0 was recently given on the linux-kernel
mailing
> list
> Date: Fri, 16 Aug 1996 16:14:47 -0400 (EDT)
><>
> Cc: linux-kernel@vger.rutgers.edu
> Subject: Re: Number of FD's available to a process
> The following might be of use to you and others attempting the same:
> In Linux 2.0.x, you can raise the 256 file descriptors per process
> limit to 1024 with the following changes:
> WARNING: Please be very careful. If you don't know how to compile
> and install a Linux kernel and don't know the proper precautions to take
> first, DON'T DO THIS.
> In /usr/include/linux/fs.h change NR_OPEN from 256 to 1024.
> In /usr/include/linux/limits.h, change NR_OPEN to 1024 and OPEN_MAX
> to 1024.
> In /usr/include/linux/posix_types.h, change __FD_SETSIZE to 1024.
> (Later versions of Linux may already have this change made.)
> In /usr/include/gnu/types.h, change __FD_SETSIZE to 1024.
> In /etc/rc.d/rc.M add the following two lines:
>> /proc/sys/kernel/file-max
>> /proc/sys/kernel/inode-max
> In /usr/src/linux type: 'make clean; make dep; make zlilo' (Or
> whatever rebuilts the kernel completely on your system.)
> Reboot with the new kernel and, from bash, do a 'ulimit -a' and make
> sure 'open files' reads 1024. You may also compile the test program included
> below and run it. It should read 1024 for both limits.
> Recompile any applications that need to select on more than 256
> files. (Applications that don't try to use more than 256 files at a time
> will not notice any changes and do not need to be recompiled.)
> Once you get your real applications running using all those file
> descriptors, you should check '/proc/sys/kernel/file-nr' and
> '/proc/sys/kernel/inode-nr' a few times to make sure you have enough room.
> If necessary, raise the values in '/etc/rc.d/rc.M'.
> David Schwartz
> davids@wiznet.net
> -------------
> <>
><>
><>
> void main(void)
> {
> int k=3;
> while((dup(0))!=-1) k++;
> printf("Opens=%d Fdsize=%d\n",k,sizeof(fd_set)*8);
> }
> -----------------------------------------------------------------------
> "Under Communism, state control of the economy eliminates organized
> crime, and none of your cities suffer corruption or waste."
> -- Civilization II instruction manual
> -----------------------------------------------------------------------
> On Fri, 16 Aug 1996, Mailing List Account wrote:
> > Okay after hacking around in the kernel (2.0.xxx) sources for a few
days I
> > am now declaring myself partially stumped. I am trying to setup an IRC
> > server on a Linux box and need to be able to support a minimum of 600
> > users on the server. Well to do this requires that the process be able to
> > open at least 600 FD's. Now by default the system allows for 256 FD's per
> > process and a maximum of 1024 for the whole system (at least that's what I
> > make of the sources). Now I have managed to successfully up the max
> > number for the system from 1024 by modifying include/linux/fs.h, but any
> > attempt to modify the 256 to a larger number causes my system to no longer
> > boot. I know this has to be possible, and any help would be greatly
> > appreciated.
> >
> > I am doing my testing on an Intel system, but the targeted system (once I
> > figure it out) is a Alpha Linux system running redhat 3.0.3.
> >
> > Thanks in advance.
> >
> > ------------------------------------------------
> > Greg Rumple grumple@magg.net
> > M.A.G. Information Services System Administrator
> > ------------------------------------------------
> -- Samuli.Karkkainen@hut.fi --- http://www.hut.fi/~hskarkka/
>Previous message: Leaf: "maximum file descriptors-linux" In reply to:
>Leaf: "maximum file descriptors-linux"

---
Alan Spicer (tech@ebiznet.com)

- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.rutgers.edu Please read the FAQ at http://www.tux.org/lkml/