1、http://wiki.nginx.org/HttpUpstreamKeepaliveModule
Num specifies the max number of connections to keep open before, if the max is reached it will close the least recently used connections
2、http://nginx.org/en/docs/http/ngx_http_upstream_module.html#keepalive
It should be particularly noted that keepalive
directive does not limit the total number of connections that nginx worker process can open to upstream servers
上面两个文章应该都是对upstream的keepalive指令的说明。
我对前者的理解是,keepalive限制了每个worker最大能与上游server的并发连接数不能超过num,如果超过会关闭最近没有使用的连接
我对后者的理解是,keepalive限制了每个worker最大维持与上游server的空闲连接数不能超过num,但并不限制与上游的并发连接数。