Linux – Nginx’s Too many open files, is setting of worker_rlimit_nofile enough

linuxmax-file-descriptorsnginxUbuntuulimit

Is setting the right value of worker_rlimit_nofile in nginx.conf enough solve the issue of Too many open files in nginx?

Or do I still need to update the sysctl.conf and limits.conf?

Best Answer

In Linux, you can see if that option has changed the limits of the process by running:

cat /proc/<PID>/limits

Where <PID> is the process ID of nginex. Test on a development environment.

If that option is not changing the limits or if you have a too restrictive hard limit you need to change the nofile in the /etc/security/limits.conf file.