Opened 2 years ago

Last modified 2 years ago

#1421 new enhancement

worker_rlimit_nofile description is not clear

Reported by: vsg@… Owned by:
Priority: minor Milestone:
Component: documentation Version: 1.13.x
Keywords: worker_rlimit_nofile worker_rlimit_core Cc:
uname -a: -
nginx -V: -

Description

Currently documentation for "worker_rlimit_nofile" configuration parameter says

Changes the limit on the maximum number of open files
(RLIMIT_NOFILE) for worker processes.

and correspondingly

Изменяет ограничение на максимальное число открытых файлов 
(RLIMIT_NOFILE) для рабочих процессов.

It's not clear whether the limit is applied for each worker separately, or it's the maximum number of files which can be opened by all workers in total.

There is the same issue with "worker_rlimit_core" parameter.

Change History (1)

comment:1 by Maxim Dounin, 2 years ago

Both directives clearly reference to corresponding OS limits, RLIMIT_NOFILE and RLIMIT_CORE. Quoting setrlimit() description as available in POSIX:

RLIMIT_CORE
This is the maximum size of a core file, in bytes, that may be created by a process. A limit of 0 shall prevent the creation of a core file. If this limit is exceeded, the writing of a core file shall terminate at this size.

RLIMIT_NOFILE
This is a number one greater than the maximum value that the system may assign to a newly-created descriptor. If this limit is exceeded, functions that allocate a file descriptor shall fail with errno set to [EMFILE]. This limit constrains the number of file descriptors that a process may allocate.

That is, both limits are for a given process - unless your OS does something completely non-standard. And this should be immediately obvious for anybody who understands what RLIMIT_NOFILE means.

We may consider linking to something appropriate for ones who don't know what RLIMIT_NOFILE means. Though I don't think that the above link to POSIX is appropriate here, mostly because POSIX structure suggests that linking there might not be a good idea (and I believe opengroup.org even asked an email before providing access to onlinepubs), and I'm not aware of other good and OS-neutral links.

(Also, clearly there is no such thing as a core file size limit for "all workers in total", it simply doesn't make sense.)

Note: See TracTickets for help on using tickets.