diff options
| author | Maxim Dounin <mdounin@mdounin.ru> | 2018-08-10 21:54:46 +0300 |
|---|---|---|
| committer | Maxim Dounin <mdounin@mdounin.ru> | 2018-08-10 21:54:46 +0300 |
| commit | d817ceae729914e7423c4c206165fc244513f021 (patch) | |
| tree | 556b398cd41a7ad290cf92fac7ab7f1346159248 /src/http/ngx_http_upstream.c | |
| parent | 7de808990b8e49e2e18c2a013e4cca82a092fdbc (diff) | |
| download | nginx-d817ceae729914e7423c4c206165fc244513f021.tar.gz nginx-d817ceae729914e7423c4c206165fc244513f021.tar.bz2 | |
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.
Diffstat (limited to '')
| -rw-r--r-- | src/http/ngx_http_upstream.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/src/http/ngx_http_upstream.c b/src/http/ngx_http_upstream.c index 63fa5d998..605ae3486 100644 --- a/src/http/ngx_http_upstream.c +++ b/src/http/ngx_http_upstream.c @@ -1546,6 +1546,8 @@ ngx_http_upstream_connect(ngx_http_request_t *r, ngx_http_upstream_t *u) c = u->peer.connection; + c->requests++; + c->data = r; c->write->handler = ngx_http_upstream_handler; |
