worker_rlimit_nofile

The 'worker_rlimit_nofile' directive sets the maximum number of open files that each NGINX worker process can have.

Syntaxworker_rlimit_nofile number;
Defaultnone
Contextmain
Arguments1

Description

The 'worker_rlimit_nofile' directive specifies the limit on the number of file descriptors a worker process can open. This is crucial for maximizing the potential number of simultaneous connections or file accesses NGINX can handle. When this limit is reached, the worker processes will be unable to open additional files or connections, potentially resulting in failed requests or dropped connections. This directive is essential for high-traffic websites and applications where the default limit may be insufficient. By setting a higher value, administrators can optimize the performance and responsiveness of their NGINX server setup. The value is set in the main context and should be configured based on expected traffic and resource availability on the server.

Config Example

worker_rlimit_nofile 65536;

Setting this directive too high can exhaust server resources, leading to instability.

Make sure the system-level limits (set through 'ulimit') reflect the desired values; otherwise, NGINX will revert to system limits.

Changes made to this directive require a NGINX restart to take effect.

← Back to all directives