diff src/http/ngx_http_upstream.c @ 7340:70c6b08973a0

Upstream keepalive: keepalive_requests directive. The directive configures maximum number of requests allowed on a connection kept in the cache. Once a connection reaches the number of requests configured, it is no longer saved to the cache. The default is 100. Much like keepalive_requests for client connections, this is mostly a safeguard to make sure connections are closed periodically and the memory allocated from the connection pool is freed.
author Maxim Dounin <mdounin@mdounin.ru>
date Fri, 10 Aug 2018 21:54:46 +0300
parents 696df3ac27ac
children 15ea84e65d07
line wrap: on
line diff
--- a/src/http/ngx_http_upstream.c
+++ b/src/http/ngx_http_upstream.c
@@ -1546,6 +1546,8 @@ ngx_http_upstream_connect(ngx_http_reque
 
     c = u->peer.connection;
 
+    c->requests++;
+
     c->data = r;
 
     c->write->handler = ngx_http_upstream_handler;