comparison src/stream/ngx_stream_upstream.h @ 6863:54cf51c4f07a

Stream: speed up TCP peer recovery. Previously, an unavailable peer was considered recovered after a successful proxy session to this peer. Until then, only a single client connection per fail_timeout was allowed to be proxied to the peer. Since stream sessions can be long, it may take indefinite time for a peer to recover, limiting the ability of the peer to receive new connections. Now, a peer is considered recovered after a successful TCP connection is established to it. Balancers are notified of this event via the notify() callback.
author Roman Arutyunyan <arut@nginx.com>
date Mon, 26 Dec 2016 14:27:05 +0300
parents d1d0dd69a419
children 5a3ab1b5804b
comparison
equal deleted inserted replaced
6862:abb0a4189cf7 6863:54cf51c4f07a
20 #define NGX_STREAM_UPSTREAM_MAX_FAILS 0x0004 20 #define NGX_STREAM_UPSTREAM_MAX_FAILS 0x0004
21 #define NGX_STREAM_UPSTREAM_FAIL_TIMEOUT 0x0008 21 #define NGX_STREAM_UPSTREAM_FAIL_TIMEOUT 0x0008
22 #define NGX_STREAM_UPSTREAM_DOWN 0x0010 22 #define NGX_STREAM_UPSTREAM_DOWN 0x0010
23 #define NGX_STREAM_UPSTREAM_BACKUP 0x0020 23 #define NGX_STREAM_UPSTREAM_BACKUP 0x0020
24 #define NGX_STREAM_UPSTREAM_MAX_CONNS 0x0100 24 #define NGX_STREAM_UPSTREAM_MAX_CONNS 0x0100
25
26
27 #define NGX_STREAM_UPSTREAM_NOTIFY_CONNECT 0x1
25 28
26 29
27 typedef struct { 30 typedef struct {
28 ngx_array_t upstreams; 31 ngx_array_t upstreams;
29 /* ngx_stream_upstream_srv_conf_t */ 32 /* ngx_stream_upstream_srv_conf_t */