# Set max open files on CentOS 6/7

137

Let's say we want to increase max open file descriptors to 65535. To do that:

Open /etc/sysctl.conf for editing and add the following line or replace one if it is already there:

fs.file-max = 65535

Open /etc/security/limits.conf for editing and put the following lines at the end of file or update values if they're already set:

* hard nofile 65535
* soft nofile 65535
* hard nproc 65535
* soft nproc 65535

Make sure that OS limits has been updated:

ulimit -n

You should see updated value which is now 65535.