Mercurial > hg > ngx_http_upstream_keepalive
view README @ 45:489c5d4318ff draft
Keepalive: "single" parameter deprecated.
The original idea was to optimize edge cases in case of interchangeable
backends, i.e. don't establish a new connection if we have any one
cached. This causes more harm than good though, as it screws up
underlying balancer's idea about backends used and may result in
various unexpected problems.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Mon, 25 Jun 2012 22:55:53 +0400 |
parents | a84573f16a0c |
children | 92125e266aa4 |
line wrap: on
line source
Keepalive balancer module for nginx. This module implements cache for backend connections. As of now, it may be used with memcached upstreams. Support for fastcgi, http and https requires expiremental patches for nginx. Configuration directives: keepalive <num> [single] Scope: upstream Switches on keepalive module for the upstream in question. Parameters: - <num> Maximum number of connections to cache. If there isn't enough room to cache new connections - last recently used connections will be kicked off the cache. Sample configuration: upstream memd { server 127.0.0.1:11211; server 10.0.0.2:11211; keepalive 10; } This module was tested to work with standard round-robin balancing, but it's believed to be compatible with more sophisticated balancers. The only requirement is to activate them *before* this module, e.g.: upstream memd { server 127.0.0.1:11211; server 10.0.0.2:11211; ip_hash; keepalive 10; } To compile nginx with keepalive module, use "--add-module <path>" option to nginx configure.