mirror of
http://git.haproxy.org/git/haproxy.git/
synced 2024-12-12 22:44:32 +00:00
0173280bfa
Some applications do not have a strict persistence requirement, yet it is still desirable for performance considerations, due to local caches on the servers. For some reasons, there are some applications which cannot rely on cookies, and for which the last resort is to use a parameter passed in the URL. The new 'url_param' balance method is there to solve this issue. It accepts a parameter name which is looked up from the URL and which is then hashed to select a server. If the parameter is not found, then the round robin algorithm is used in order to provide a normal load balancing across the servers for the first requests. It would have been possible to use a source IP hash instead, but since such applications are generally buried behind multiple levels of reverse-proxies, it would not provide a good balance. The doc has been updated, and two regression testing configurations have been added.
24 lines
443 B
INI
24 lines
443 B
INI
# This is a test configuration.
|
|
# It exercises the "url_param" balance algorithm. It looks for
|
|
# an URL parameter named "foo".
|
|
|
|
global
|
|
maxconn 100
|
|
log 127.0.0.1 local0
|
|
|
|
listen vip1
|
|
log global
|
|
bind :8000
|
|
mode http
|
|
maxconn 100
|
|
clitimeout 5000
|
|
contimeout 5000
|
|
srvtimeout 5000
|
|
balance url_param foo
|
|
server srv1 127.0.0.1:80
|
|
server srv2 127.0.0.1:80
|
|
|
|
# control activity this way
|
|
stats uri /stat
|
|
|