0

I'm trying to increase open file limit in Ubuntu 8.04.4 LTS. Followed information posted in this question: How do I increase the open files limit for a non-root user?

  • Added to /etc/sysctl.conf following line: fs.file-max=500000
  • Added to /etc/security/limits.conf following lines:

    * soft nofile 10000

    * hard nofile 10000

  • Added to /etc/pam.d/common-session (My system do not have any other files prefixed with common-session at /etc/pam.d/) following line: session required pam_limits.so
  • Did system restart

But the value of open file limit is still same 1024:

# ulimit -n
1024
# cat /proc/{PID}/limits
Limit                     Soft Limit           Hard Limit           Units
Max open files            1024                 1024                 files

# cat /proc/sys/fs/file-max
500000

# sysctl fs.file-max
fs.file-max = 500000

What I'm doing wrong and how to increase open file limit?

Index
  • 275

1 Answers1

2

You can increase the maximum number of open files by setting a new value in kernel variable /proc/sys/fs/file-max as follows (login as the root):

sysctl -w fs.file-max=500000

Above command forces the limit to 500000 files. You need to edit /etc/sysctl.conf file and put following line so that after reboot the setting will remain as it is:

vi /etc/sysctl.conf

Append a config directive as follows:

fs.file-max = 500000

Save and close the file.

Users need to log out and log back in again to changes take effect or just type the following command:

sysctl -p

Verify your settings with command:

cat /proc/sys/fs/file-max

OR

sysctl fs.file-max

Source

LnxSlck
  • 12,256