added a comment about balancing and documented the
new proxy.balance option git-svn-id: svn://svn.lighttpd.net/lighttpd/branches/lighttpd-1.3.x@385 152afb58-edef-0310-8abb-c4023f1b3aa9
This commit is contained in:
parent
01afa1ca5b
commit
b54ea0c621
|
@ -35,6 +35,16 @@ lighttpd provides the Proxy support via the proxy-module
|
|||
Proxy module. Currently only 0 and 1 are used. Use 1 to
|
||||
enable some debug output, 0 to disable it.
|
||||
|
||||
:proxy.balance:
|
||||
might be one of 'hash', 'round-robin' or 'fair' (default).
|
||||
|
||||
'round-robin' choses another host for each request, 'hash'
|
||||
is generating a hash over the request-uri and makes sure
|
||||
that the same request URI is sent to always the same host.
|
||||
That can increase the performance of the backend servers
|
||||
a lot due to higher cache-locality. 'fair' is the normal
|
||||
load-based, passive balancing.
|
||||
|
||||
:proxy.server:
|
||||
tell the module where to send Proxy requests to. Every
|
||||
file-extension can have its own handler. Load-Balancing is
|
||||
|
@ -43,30 +53,52 @@ lighttpd provides the Proxy support via the proxy-module
|
|||
structure of proxy.server section: ::
|
||||
|
||||
( <extension> =>
|
||||
( <handle> =>
|
||||
(
|
||||
( "host" => <string> ,
|
||||
"port" => <integer>
|
||||
)
|
||||
),
|
||||
( <handle> => ...
|
||||
)
|
||||
"port" => <integer> ),
|
||||
( "host" => <string> ,
|
||||
"port" => <integer> )
|
||||
),
|
||||
<extension> => ...
|
||||
)
|
||||
|
||||
:<extension>: is the file-extension or prefix
|
||||
(if started with "/")
|
||||
:<handle>: is just a unique handle name
|
||||
:<extension>: is the file-extension or prefix (if started with "/")
|
||||
might empty to match all requests
|
||||
:"host": is ip of the proxy server
|
||||
:"port": is tcp-port on the "host" used by the proxy
|
||||
server
|
||||
server (default: 80)
|
||||
|
||||
e.g.: ::
|
||||
|
||||
proxy.server = ( ".php" =>
|
||||
( "grisu" =>
|
||||
(
|
||||
"host" => "192.168.0.2",
|
||||
"port" => 1026
|
||||
)
|
||||
)
|
||||
proxy.server = ( ".jsp" =>
|
||||
( (
|
||||
"host" => "10.0.0.242",
|
||||
"port" => 81
|
||||
) )
|
||||
)
|
||||
|
||||
Example:
|
||||
========
|
||||
|
||||
Using lighttpd + mod_proxy in front of 8 Squids which handle the
|
||||
caching of dynamic content for you. All requests for the host
|
||||
www.example.org should be forwarded to the proxy. All proxies
|
||||
listen on port 80 for requests. ::
|
||||
|
||||
$HTTP["host"] == "www.example.org" {
|
||||
proxy.balance = "hash"
|
||||
proxy.balance = ( "" => ( ( "host" => "10.0.0.10" ),
|
||||
( "host" => "10.0.0.11" ),
|
||||
( "host" => "10.0.0.12" ),
|
||||
( "host" => "10.0.0.13" ),
|
||||
( "host" => "10.0.0.14" ),
|
||||
( "host" => "10.0.0.15" ),
|
||||
( "host" => "10.0.0.16" ),
|
||||
( "host" => "10.0.0.17" ) ) )
|
||||
}
|
||||
|
||||
If one of the hosts goes down the all requests for this one server are
|
||||
moved equally to the other servers. If you want to know more about
|
||||
the algorithm used here google for 'Microsoft CARP'.
|
||||
|
||||
|
||||
|
|
Loading…
Reference in New Issue