typedef struct {
ngx_uint_t max_cached;
+ ngx_uint_t requests;
ngx_msec_t timeout;
ngx_queue_t cache;
offsetof(ngx_http_upstream_keepalive_srv_conf_t, timeout),
NULL },
+ { ngx_string("keepalive_requests"),
+ NGX_HTTP_UPS_CONF|NGX_CONF_TAKE1,
+ ngx_conf_set_num_slot,
+ NGX_HTTP_SRV_CONF_OFFSET,
+ offsetof(ngx_http_upstream_keepalive_srv_conf_t, requests),
+ NULL },
+
ngx_null_command
};
ngx_http_upstream_keepalive_module);
ngx_conf_init_msec_value(kcf->timeout, 60000);
+ ngx_conf_init_uint_value(kcf->requests, 100);
if (kcf->original_init_upstream(cf, us) != NGX_OK) {
return NGX_ERROR;
goto invalid;
}
+ if (c->requests >= kp->conf->requests) {
+ goto invalid;
+ }
+
if (!u->keepalive) {
goto invalid;
}
*/
conf->timeout = NGX_CONF_UNSET_MSEC;
+ conf->requests = NGX_CONF_UNSET_UINT;
return conf;
}