Welcome! Log In Create A New Profile

Advanced

Re: [PATCH] Events: closed unused listening fds in worker processes.

Maxim Dounin
April 18, 2019 09:34AM
Hello!

On Thu, Apr 18, 2019 at 06:18:09PM +0800, Zexuan Luo wrote:

> When reuseport is enabled in the 'listen ...' directive and a great
> number of worker processes are used, each worker will inherit lots of
> listening fds from the master process.
> In one of our environments, one worker could have 1.5k fds before it
> starts to accept any request. This situation is too scary to the
> system administrator.

Thank you for your patch.

If the problem is how scared your system administrators are, I
think one of these approaches might be better:

- Avoid configuring things which scare them. In particular, you
may want to avoid using reuseport when using very large number
of worker processes and large number of distinct listening sockets.

- Train your system administrators to not be scared in such
cases.

Note well that regardless of the number of file descriptors open
by a particular worker process, corresponding listening sockets
are open. Closing this file descriptors might save some slots in
the process file descriptor table, but that's all. And that's more
or less nothing in terms of resources, even with 1.5k file
descriptors.

--
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] Events: closed unused listening fds in worker processes.

Zexuan Luo 302 April 18, 2019 06:14AM

Re: [PATCH] Events: closed unused listening fds in worker processes.

Zexuan Luo 122 April 18, 2019 06:20AM

Re: [PATCH] Events: closed unused listening fds in worker processes.

Maxim Dounin 151 April 18, 2019 09:34AM



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

Online Users

Guests: 322
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