How to increase file descriptor limits

Your rating: None

Concern:

There are a lot of messages like "Too many open files" in /var/log/messages and you would like to increase the number of file descriptors on the system.
You can see the current file descriptor limits with: ulimit -aS
The hard limits can be seen with: ulimit -aH

You will have to change the kernel parameteres in /proc to change the hard limits.

Solution:

1. Edit /etc/security/limits.conf and add the lines:
* soft nofile 1024
* hard nofile 4096

2. Edit /etc/pam.d/login, adding the line:
session required /lib/security/pam_limits.so

3. The system file descriptor limit is set in /proc/sys/fs/file-max.
echo 65535 > /proc/sys/fs/file-max
increases the limit to 65535

4. Increase the file descriptor limits to the hard limit specified in
/etc/security/limits.conf

with:
ulimit -n 4096

Open-Xchange | Impressum