Merge "Set some amphora driver optimizations"
This commit is contained in:
commit
4155922a74
|
@ -210,7 +210,7 @@
|
|||
|
||||
[controller_worker]
|
||||
# workers = 1
|
||||
# amp_active_retries = 10
|
||||
# amp_active_retries = 30
|
||||
# amp_active_wait_sec = 10
|
||||
# Glance parameters to extract image ID to use for amphora. Only one of
|
||||
# parameters is needed. Using tags is the recommended way to refer to images.
|
||||
|
|
|
@ -315,7 +315,7 @@ controller_worker_opts = [
|
|||
default=1, min=1,
|
||||
help='Number of workers for the controller-worker service.'),
|
||||
cfg.IntOpt('amp_active_retries',
|
||||
default=10,
|
||||
default=30,
|
||||
help=_('Retry attempts to wait for Amphora to become active')),
|
||||
cfg.IntOpt('amp_active_wait_sec',
|
||||
default=10,
|
||||
|
|
|
@ -41,6 +41,9 @@ defaults
|
|||
{% endif %}
|
||||
retries 3
|
||||
option redispatch
|
||||
option splice-request
|
||||
option splice-response
|
||||
option http-keep-alive
|
||||
|
||||
{% block peers %}{% endblock peers %}
|
||||
|
||||
|
|
|
@ -203,6 +203,12 @@ backend {{ pool.id }}
|
|||
{% else %}
|
||||
mode {{ pool.protocol }}
|
||||
{% endif %}
|
||||
{% if (pool.protocol.lower() == constants.PROTOCOL_HTTP.lower() or
|
||||
(pool.protocol.lower() == constants.PROTOCOL_PROXY.lower() and
|
||||
listener.protocol_mode.lower() ==
|
||||
constants.PROTOCOL_HTTP.lower()))%}
|
||||
http-reuse safe
|
||||
{% endif %}
|
||||
balance {{ pool.lb_algorithm }}
|
||||
{% if pool.session_persistence %}
|
||||
{% if (pool.session_persistence.type ==
|
||||
|
|
|
@ -36,7 +36,10 @@ class HAProxyCompatTestCase(base.TestCase):
|
|||
"defaults\n"
|
||||
" log global\n"
|
||||
" retries 3\n"
|
||||
" option redispatch\n\n\n\n"
|
||||
" option redispatch\n"
|
||||
" option splice-request\n"
|
||||
" option splice-response\n"
|
||||
" option http-keep-alive\n\n\n\n"
|
||||
"frontend sample_listener_id_1\n"
|
||||
" option httplog\n"
|
||||
" maxconn {maxconn}\n"
|
||||
|
|
|
@ -45,6 +45,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
maxconn=constants.HAPROXY_MAX_MAXCONN)
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -89,6 +90,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
maxconn=constants.HAPROXY_MAX_MAXCONN)
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -122,6 +124,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_http(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -148,6 +151,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_member_backup(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -185,6 +189,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
maxconn=constants.HAPROXY_MAX_MAXCONN)
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -221,6 +226,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
maxconn=constants.HAPROXY_MAX_MAXCONN)
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -249,6 +255,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_member_monitor_addr_port(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -343,6 +350,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_no_monitor_http(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" fullconn {maxconn}\n"
|
||||
|
@ -363,6 +371,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_disabled_member(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" fullconn {maxconn}\n"
|
||||
|
@ -384,6 +393,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_ping_monitor_http(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -466,6 +476,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_no_persistence_http(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" fullconn {maxconn}\n"
|
||||
" option allbackups\n"
|
||||
|
@ -484,6 +495,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_sourceip_persistence(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" stick-table type ip size 10k\n"
|
||||
" stick on src\n"
|
||||
|
@ -510,6 +522,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_appcookie_persistence(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" stick-table type string len 64 size 10k\n"
|
||||
" stick store-response res.cook(JSESSIONID)\n"
|
||||
|
@ -615,6 +628,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
maxconn=constants.HAPROXY_MAX_MAXCONN)
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -631,6 +645,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
"\n"
|
||||
"backend sample_pool_id_2\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -652,6 +667,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_http_xff(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -680,6 +696,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_http_xff_xfport(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -710,6 +727,7 @@ class TestHaproxyCfg(base.TestCase):
|
|||
def test_render_template_pool_proxy_protocol(self):
|
||||
be = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -852,7 +870,10 @@ class TestHaproxyCfg(base.TestCase):
|
|||
defaults = ("defaults\n"
|
||||
" no log\n"
|
||||
" retries 3\n"
|
||||
" option redispatch\n\n")
|
||||
" option redispatch\n"
|
||||
" option splice-request\n"
|
||||
" option splice-response\n"
|
||||
" option http-keep-alive\n\n")
|
||||
rendered_obj = j_cfg.render_loadbalancer_obj(
|
||||
sample_configs.sample_amphora_tuple(),
|
||||
sample_configs.sample_listener_tuple()
|
||||
|
|
|
@ -839,6 +839,7 @@ def sample_base_expected_config(frontend=None, backend=None,
|
|||
if backend is None:
|
||||
backend = ("backend sample_pool_id_1\n"
|
||||
" mode http\n"
|
||||
" http-reuse safe\n"
|
||||
" balance roundrobin\n"
|
||||
" cookie SRV insert indirect nocache\n"
|
||||
" timeout check 31s\n"
|
||||
|
@ -863,7 +864,10 @@ def sample_base_expected_config(frontend=None, backend=None,
|
|||
defaults = ("defaults\n"
|
||||
" log global\n"
|
||||
" retries 3\n"
|
||||
" option redispatch\n\n")
|
||||
" option redispatch\n"
|
||||
" option splice-request\n"
|
||||
" option splice-response\n"
|
||||
" option http-keep-alive\n\n")
|
||||
return ("# Configuration for loadbalancer sample_loadbalancer_id_1\n"
|
||||
"global\n"
|
||||
" daemon\n"
|
||||
|
|
Loading…
Reference in New Issue