annotate README @ 46:92125e266aa4 draft

Keepalive: note the module is included into nginx 1.1.4.
author Maxim Dounin <mdounin@mdounin.ru>
date Tue, 26 Jun 2012 02:52:10 +0400
parents 489c5d4318ff
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
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.