Commit b398f31d authored by Romain Courteaud's avatar Romain Courteaud

Add timeoutless haproxy configuration.

parent 114984ab
......@@ -67,8 +67,15 @@ class Recipe(GenericBaseRecipe):
# is not an issue if you have more than (maxqueue * node_quantity) requests
# because haproxy will handle a top-level queue
if self.options.get('no-timeout', ''):
snippet_filename = self.getTemplateFilename(
'haproxy-no-timeout-server-snippet.cfg.in')
template_filename = self.getTemplateFilename('haproxy-no-timeout.cfg.in')
else:
snippet_filename = self.getTemplateFilename(
'haproxy-server-snippet.cfg.in')
template_filename = self.getTemplateFilename('haproxy.cfg.in')
# Prepare all filestorages
server_snippet = ""
i = 0
......@@ -87,7 +94,6 @@ class Recipe(GenericBaseRecipe):
port=self.options['port'],
server_text=server_snippet,
server_check_path=self.options['server-check-path'],)
template_filename = self.getTemplateFilename('haproxy.cfg.in')
configuration_path = self.createFile(
self.options['conf-path'],
self.substituteTemplate(template_filename, config))
......
server %(name)s %(address)s cookie %(name)s check inter 3s rise 1 fall 2 maxqueue 1 maxconn %(cluster_zope_thread_amount)s
global
maxconn 4096
defaults
log global
mode http
option httplog
option dontlognull
retries 1
option redispatch
maxconn 2000
# Do not accept connection longer than 30s
timeout server 30s
# Do not wait in queue for a zope to become available.
timeout queue 0s
# The connection should be immediate on the same partition,
timeout connect 1s
# As requested in haproxy doc, make this "at least equal to timeout server".
timeout client 30s
# Use "option forceclose" to not preserve client & server persistent connections
# while handling every incoming request individually, dispatching them one after
# another to servers, in HTTP close mode. This is really needed when haproxy
# is configured with maxconn to 1, without this options browser are unable
# to render a page
option forceclose
listen %(name)s %(ip)s:%(port)s
cookie SERVERID insert
balance roundrobin
%(server_text)s
option httpchk GET %(server_check_path)s
stats uri /haproxy
stats realm Global\ statistics
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment