Raising number of file handles per process

Robert Dinse (nanook@eskimo.com)
Mon, 13 Sep 1999 09:41:34 -0700 (PDT)


On the 13th day of September 1999, Arie Rudich <arie@chessdev.com> scribbled:
>
> Hi,
> Working on a RedHat 6.0 (kernel 2.2.5),
> we want to have about 5000 file handles open concurrently by each of
> 3 processes on one host.
>
> We have added the following in /etc/rc.d/rc.local
> echo 16384 > /proc/sys/fs/file-max
>
> ulimit -nH and ulimit -nS both return 1024.
>
> We now seem to need to ulimit -nH 5000 and ulimit -nS 5000 before
> running the above processes, BUT this is only allowed from root shells.
> The processes are to run as regular user processes.

You can use su -c to run a command as a specific user.

I would be happy if I could get this to work even AS root. Under 2.2.10:

# id
uid=0(root) gid=0(wheel) groups=0(wheel),6(console),0(wheel),51(staff)
# echo 16384 > /proc/sys/fs/file-max
# ulimit -nH 2000
ksh: ulimit: bad limit: Operation not permitted
#

Values below 1024 work fine. Under 2.0.35 I had the kernel compiled with
NR_OPEN set to 2048 (and some other tweaks were necessary). I tried upping the
value of NR_OPEN to 2048 and when I booted that kernel after adding swap it
said something about getting unused fd 0 not NULL, something along that line
several times then hung.

Can anybody tell me what I'm doing wrong?

-
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/