diff options
author | Maxim Dounin <mdounin@mdounin.ru> | 2021-04-08 00:15:48 +0300 |
---|---|---|
committer | Maxim Dounin <mdounin@mdounin.ru> | 2021-04-08 00:15:48 +0300 |
commit | d9996d6f27150bfb9c9c00d77fac940712aa1d28 (patch) | |
tree | 0dddf15a4e9c9d31cb66677ea7f8746e9402f4c7 /src/core/ngx_resolver.c | |
parent | 5599731c00bd152f765c7cea24a7d257bf13320c (diff) |
Introduced the "keepalive_time" directive.
Similar to lingering_time, it limits total connection lifetime before
keepalive is switched off. The default is 1 hour, which is close to
the total maximum connection lifetime possible with default
keepalive_requests and keepalive_timeout.
Diffstat (limited to 'src/core/ngx_resolver.c')
-rw-r--r-- | src/core/ngx_resolver.c | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/src/core/ngx_resolver.c b/src/core/ngx_resolver.c index 49616b776..793907010 100644 --- a/src/core/ngx_resolver.c +++ b/src/core/ngx_resolver.c @@ -4459,6 +4459,8 @@ ngx_udp_connect(ngx_resolver_connection_t *rec) c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1); + c->start_time = ngx_current_msec; + ngx_log_debug3(NGX_LOG_DEBUG_EVENT, &rec->log, 0, "connect to %V, fd:%d #%uA", &rec->server, s, c->number); @@ -4545,6 +4547,8 @@ ngx_tcp_connect(ngx_resolver_connection_t *rec) c->number = ngx_atomic_fetch_add(ngx_connection_counter, 1); + c->start_time = ngx_current_msec; + if (ngx_add_conn) { if (ngx_add_conn(c) == NGX_ERROR) { goto failed; |