]> git.kaiwu.me - nginx.git/commit
The "reuseport" option of the "listen" directive.
authorMaxim Dounin <mdounin@mdounin.ru>
Wed, 20 May 2015 12:51:56 +0000 (15:51 +0300)
committerMaxim Dounin <mdounin@mdounin.ru>
Wed, 20 May 2015 12:51:56 +0000 (15:51 +0300)
commitf7f1607bf2b8b7c45834b66cb45f6445bee65587
tree8a458d848d86e6b0e7f9108fd1b792d709091965
parentd5c34785bc55164afb7cfe7de1badcebdb05fb8d
The "reuseport" option of the "listen" directive.

When configured, an individual listen socket on a given address is
created for each worker process.  This allows to reduce in-kernel lock
contention on configurations with high accept rates, resulting in better
performance.  As of now it works on Linux and DragonFly BSD.

Note that on Linux incoming connection requests are currently tied up
to a specific listen socket, and if some sockets are closed, connection
requests will be reset, see https://lwn.net/Articles/542629/.  With
nginx, this may happen if the number of worker processes is reduced.
There is no such problem on DragonFly BSD.

Based on previous work by Sepherosa Ziehau and Yingqi Lu.
12 files changed:
auto/unix
src/core/ngx_connection.c
src/core/ngx_connection.h
src/core/ngx_cycle.c
src/event/ngx_event.c
src/event/ngx_event_accept.c
src/http/ngx_http.c
src/http/ngx_http_core_module.c
src/http/ngx_http_core_module.h
src/stream/ngx_stream.c
src/stream/ngx_stream.h
src/stream/ngx_stream_core_module.c