I'm trying to increase the number open file handles on a server of mine and the usual places don't seem to be taking effect:

root@dev:~# sysctl -p |grep file
fs.file-max = 200000

root@dev:~# grep nofile /etc/security/limits.conf
*       soft    nofile  400000
*       hard    nofile  1000000

root@dev:~# ulimit -n
1024

I wish to increase the root user's file count to a much larger count that 1,024 (e.g. 200k or higher) but as you can see from the output, something is blocking me. I know I can use ulimit on the CLI but I want the setting to be persistent & apply automatically.

What other locations might be affecting the user's file limit? Am I missing a command to apply these settings permanently?

(Running Ubuntu Hardy 8.04.4 LTS.)

link|improve this question
feedback

1 Answer

The ulimit can be set from the .profile and .bashrc, etc files, so you can add

ulimit -n <number>

to any one of the following files:

/etc/profile
/etc/profile.d/*.sh
/etc/bash.bashrc
/root/.bashrc
/root/.profile

as well as any other shell script these files call.

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

Not the answer you're looking for? Browse other questions tagged or ask your own question.