Mercurial > hg > ngx_http_upstream_keepalive
annotate README @ 49:32e9e4b4b5e1 draft default tip
Keepalive: remove "master_process off" to match other tests.
While here, remove extra spaces in "daemon off" as they are no longer
logical after "master_process" removal.
author | Maxim Dounin <mdounin@mdounin.ru> |
---|---|
date | Thu, 24 Jan 2013 02:05:31 +0400 |
parents | 92125e266aa4 |
children |
rev | line source |
---|---|
7
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
1 Keepalive balancer module for nginx. |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
2 |
46
92125e266aa4
Keepalive: note the module is included into nginx 1.1.4.
Maxim Dounin <mdounin@mdounin.ru>
parents:
45
diff
changeset
|
3 This module implements cache for backend connections. |
92125e266aa4
Keepalive: note the module is included into nginx 1.1.4.
Maxim Dounin <mdounin@mdounin.ru>
parents:
45
diff
changeset
|
4 |
92125e266aa4
Keepalive: note the module is included into nginx 1.1.4.
Maxim Dounin <mdounin@mdounin.ru>
parents:
45
diff
changeset
|
5 As of nginx 1.1.4 the module is included into nginx, and compiled in |
92125e266aa4
Keepalive: note the module is included into nginx 1.1.4.
Maxim Dounin <mdounin@mdounin.ru>
parents:
45
diff
changeset
|
6 by default. There is no need to install this module separately. |
7
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
7 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
8 Configuration directives: |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
9 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
10 keepalive <num> [single] |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
11 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
12 Scope: upstream |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
13 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
14 Switches on keepalive module for the upstream in question. |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
15 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
16 Parameters: |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
17 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
18 - <num> |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
19 Maximum number of connections to cache. If there isn't enough |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
20 room to cache new connections - last recently used connections |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
21 will be kicked off the cache. |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
22 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
23 Sample configuration: |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
24 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
25 upstream memd { |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
26 server 127.0.0.1:11211; |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
27 server 10.0.0.2:11211; |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
28 keepalive 10; |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
29 } |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
30 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
31 This module was tested to work with standard round-robin balancing, but |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
32 it's believed to be compatible with more sophisticated balancers. The only |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
33 requirement is to activate them *before* this module, e.g.: |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
34 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
35 upstream memd { |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
36 server 127.0.0.1:11211; |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
37 server 10.0.0.2:11211; |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
38 ip_hash; |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
39 keepalive 10; |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
40 } |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
41 |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
42 To compile nginx with keepalive module, use "--add-module <path>" option to |
c1a2ef20a2a7
Keepalive: add license and some documentation.
Maxim Dounin <mdounin@mdounin.ru>
parents:
diff
changeset
|
43 nginx configure. |