comparison src/stream/ngx_stream.h @ 6153:4f6efabcb09b

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.
author Maxim Dounin <mdounin@mdounin.ru>
date Wed, 20 May 2015 15:51:56 +0300
parents 187aa751ad62
children f654addf0eea
comparison
equal deleted inserted replaced
6152:3c344ea7d88b 6153:4f6efabcb09b
42 #if (NGX_STREAM_SSL) 42 #if (NGX_STREAM_SSL)
43 unsigned ssl:1; 43 unsigned ssl:1;
44 #endif 44 #endif
45 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY) 45 #if (NGX_HAVE_INET6 && defined IPV6_V6ONLY)
46 unsigned ipv6only:1; 46 unsigned ipv6only:1;
47 #endif
48 #if (NGX_HAVE_REUSEPORT)
49 unsigned reuseport:1;
47 #endif 50 #endif
48 unsigned so_keepalive:2; 51 unsigned so_keepalive:2;
49 #if (NGX_HAVE_KEEPALIVE_TUNABLE) 52 #if (NGX_HAVE_KEEPALIVE_TUNABLE)
50 int tcp_keepidle; 53 int tcp_keepidle;
51 int tcp_keepintvl; 54 int tcp_keepintvl;