i am experiencing a (23: too many open files in system) error on my nginx due to big load of opening web socket connections requests.
the backend service which runs on completely different machine and receives a proxy_pass from this nginx process.
once i reach a certain threshold i receive the error message above.
i tried to dig into the nginx documentation but didn't find something useful.
where are the file descriptors for those web sockets are getting open and created?
is it on the machine where the nginx process runs on, or on the machine where the service runs on?.
i want to increase the limit of allowed open files per process and i am not sure on which machine i need to change it.
Increase the max file descriptors on the nginx server. The increase needs to happen at the kernel and user or nginx level. The tuning guidelines provide an explanation why:
File descriptors are operating system resources used to represent connections and open files, among other things. NGINX can use up to two file descriptors per connection. For example, if NGINX is proxying, it generally uses one file descriptor for the client connection and another for the connection to the proxied server, though this ratio is much lower if HTTP keepalives are used.