Re: kernel limits : safe to change ?

Martin Guindon (likwid@likwid.qc.ca)
Wed, 19 Aug 1998 17:04:04 -0400


Hi,

I did the modification on one of my server, allowing 1024 fds, and
everything is working fine (NOTE: I tried with higher values, like 2048
fbs, but it wasn't working at all, so if someone knows how, email me please
:)) ).

Here is 1024 file descriptors trick on the linux kernel 2.0.x:

First, edit /usr/src/linux/include/linux/fs.h and set "#define NR_OPEN
1024" and add 1024 to NR_INODE and NR_FILE (ie. "#define NR_INODE 4096" and
"#define NR_FILE 2048"). NR_FILE is the maximum number of fds of the whole
OS. You can alternatively not change it, but at boot time do the following
because it'S dynamically configurable...

echo "2048" > /proc/sys/kernel/file-max
echo "4096" > /proc/sys/kernel/inode-max

Then modify /usr/src/linux/include/linux/limits.h and set again "#define
NR_OPEN 1024" (Yeah, it's defined on two places... anyone knows why??)

Then recompile and install your kernel, reboot and you should be fine.

You can test with the command "ulimit -n".

Martin.

At 08:07 PM 8/19/98 +0200, you wrote:
>a) NR_OPEN is defined in limit.h, and redefined in fs.h ???
>b) is it safe to increase the limits in limits.h ?
>CHILD_MAX, OPEN_MAX and NR_OPEN come to my mind :
>i'm heavily useing threads, currently playing around with 200,
>and i always run out of file handles ...
>(think of a multi threaded web server under heavy load).
>
>i have already raised themits in task.h, and got no problems ...
>
>thanks for your help.
>
>andreas

likwid` @ IRC
. --- -- --- - - -- ---- --- - --- -- - -- --- -- -- - -- --- -- --- - .
« ...two roads diverged in a wood, and i - i took the one
less traveled by and that has made all the difference... »
. --- -- --- - - -- ---- --- - --- -- - -- --- -- -- - -- --- -- --- - .

-
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.altern.org/andrebalsa/doc/lkml-faq.html