Process File Descriptor Tuning
In addition to configuring system-wide global file-descriptor values, you must also consider per-process limits.
The following example describes how to raise the maximum number of file descriptors per process to 4096 on the RedHat?CentOS distibution of Linux:
-
Allow all users to modify their file descriptor limits from an initial value of 1024 up to the maximum permitted value of 4096 by changing
/etc/security/limits.conf
* soft nofile 1024
* hard nofile 4096In /etc/pam.d/login, add:
session required /lib/security/pam_limits.so
-
Increase the system-wide file descriptor limit by adding the following line to the /etc/rc.d/rc.local startup script:
echo -n "8192" > /proc/sys/fs/file-max
or, on 2.6 kernels:
echo -n "8192" > $( mount | grep sysfs | cut -d" " -f 3 )/fs/file-max
Now restart the system or run these commands from a command line to apply these changes.
-
You will then need to tell the system to use the new limits:
ulimit -n unlimited
(bash)or
ulimit -n 65535
(bash)or
unlimit descriptors
(csh, tcsh). - Verify this has raised the limit by checking the output of:
ulimit -a
(bash) or limit (csh, tcsh)
No comments:
Post a Comment