4

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.)

1 Answer 1

3

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.

1
  • While this didn't fix my problem, it is a good answer. It's been long enough without any other responses so you win :) Aug 8, 2012 at 5:53

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .