Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Fix ngx_max_sockets variable, set actual value after use setrlimit(RLIMIT_NOFILE)

Maxim Dounin
October 24, 2019 11:54AM
Hello!

On Thu, Oct 24, 2019 at 01:38:38PM +0000, i@morfi.ru wrote:

> # HG changeset patch
> # User Andrey Kolyshkin <i@morfi.ru>
> # Date 1571924112 -10800
> # Thu Oct 24 16:35:12 2019 +0300
> # Node ID dfae615e676214a83b91abfbb51c334cfb1ecfdd
> # Parent 89adf49fe76ada86d84e2af8f5cee9ca8c3dca19
> Fix ngx_max_sockets variable, set actual value after use setrlimit(RLIMIT_NOFILE)
>
> diff -r 89adf49fe76a -r dfae615e6762 src/os/unix/ngx_process_cycle.c
> --- a/src/os/unix/ngx_process_cycle.c Mon Oct 21 20:22:30 2019 +0300
> +++ b/src/os/unix/ngx_process_cycle.c Thu Oct 24 16:35:12 2019 +0300
> @@ -811,6 +811,8 @@
> ngx_log_error(NGX_LOG_ALERT, cycle->log, ngx_errno,
> "setrlimit(RLIMIT_NOFILE, %i) failed",
> ccf->rlimit_nofile);
> + } else {
> + ngx_max_sockets = ccf->rlimit_nofile;
> }
> }
>

I'm not what the intended semantics of the ngx_max_sockets
variable is, but given that it is not used - I don't think it
matters, and the existing semantics of being rlimit_nofile at the
time of nginx start is good enough.

On the other hand, the change suggested breaks any possible
intended semantics, as successful setrlimit() does not mean that
the specified limit was actually applied.

--
Maxim Dounin
http://mdounin.ru/
_______________________________________________
nginx-devel mailing list
nginx-devel@nginx.org
http://mailman.nginx.org/mailman/listinfo/nginx-devel
Subject Author Views Posted

[PATCH] Fix ngx_max_sockets variable, set actual value after use setrlimit(RLIMIT_NOFILE)

Anonymous User 260 October 24, 2019 09:40AM

Re: [PATCH] Fix ngx_max_sockets variable, set actual value after use setrlimit(RLIMIT_NOFILE)

Maxim Dounin 133 October 24, 2019 11:54AM



Sorry, you do not have permission to post/reply in this forum.

Online Users

Guests: 309
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready