If you are getting “too many open files” error this is how to fix it.
To change the file descriptor setting you need to add the line fs.file-max=50000 to the kernel parameters file /etc/sysctl.conf
fs.file-max = 500000” >> /etc/sysctl.conf
Open /etc/sysctl.conf file with any editor and add the fs.file-max=50000 line to the file.
To apply all changes run the following command:
The final step is to change the ulimit setting hard and soft limits.
Open /etc/security/limits.conf file and set the hard and soft limits by adding the following lines:
* soft nofile 60000
* hard nofile 60000
Now to apply the changes you need to reboot: