Max open file descriptors tuning

From Grid5000
Jump to: navigation, search
See also: RAID tweaking, tuning | Max open file descriptors tuning | TCP bandwidth tuning

Max open file descriptors must be increased to 8192 to allow some experiments to perform well. By default, most of the Linux distribution set this limit to 1024. To view current max open file descriptors limit value:

ulimit -n

This limit can be dynamically changed:

ulimit -n 8192

Upon connection thru oarsub or oarsh

To make this change permanent, ulimit -n 8192 must be added to

  • /etc/default/oar-node
  • /etc/sysconfig/oar-node

Upon connection using ssh (OAR2 -t allow_classis_ssh)

To make this change permanent, /etc/security/limits.conf file must be edited:

*                hard    nofile          8192
*                soft    nofile          8192

This file is used by pam and its module pam_limits. To be sure this module is loaded please see:

  • /etc/pam.d/sshd and /etc/pam.d/system-auth on Redhat-based system
  • /etc/pam.d/ssh and /etc/pam.d/login on Debian-based system
Warning.png Warning

If sshd is configured to use privilege separation, pam_limits becomes partially inoperative, because it is not run as root. A workaround is to dynamically change limit (ie. ulimit -n) in start section of sshd's init.d script. By doing this, limits.conf becomes useless. Moreover watch out sshd's init script during system package upgrade.