Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos-caddy
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Guillaume Hervier
slapos-caddy
Commits
b398f31d
Commit
b398f31d
authored
Oct 04, 2012
by
Romain Courteaud
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Add timeoutless haproxy configuration.
parent
114984ab
Changes
3
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
47 additions
and
3 deletions
+47
-3
slapos/recipe/haproxy/__init__.py
slapos/recipe/haproxy/__init__.py
+9
-3
slapos/recipe/haproxy/template/haproxy-no-timeout-server-snippet.cfg.in
...haproxy/template/haproxy-no-timeout-server-snippet.cfg.in
+2
-0
slapos/recipe/haproxy/template/haproxy-no-timeout.cfg.in
slapos/recipe/haproxy/template/haproxy-no-timeout.cfg.in
+36
-0
No files found.
slapos/recipe/haproxy/__init__.py
View file @
b398f31d
...
@@ -67,8 +67,15 @@ class Recipe(GenericBaseRecipe):
...
@@ -67,8 +67,15 @@ class Recipe(GenericBaseRecipe):
# is not an issue if you have more than (maxqueue * node_quantity) requests
# is not an issue if you have more than (maxqueue * node_quantity) requests
# because haproxy will handle a top-level queue
# 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
(
snippet_filename
=
self
.
getTemplateFilename
(
'haproxy-server-snippet.cfg.in'
)
'haproxy-server-snippet.cfg.in'
)
template_filename
=
self
.
getTemplateFilename
(
'haproxy.cfg.in'
)
# Prepare all filestorages
# Prepare all filestorages
server_snippet
=
""
server_snippet
=
""
i
=
0
i
=
0
...
@@ -87,7 +94,6 @@ class Recipe(GenericBaseRecipe):
...
@@ -87,7 +94,6 @@ class Recipe(GenericBaseRecipe):
port
=
self
.
options
[
'port'
],
port
=
self
.
options
[
'port'
],
server_text
=
server_snippet
,
server_text
=
server_snippet
,
server_check_path
=
self
.
options
[
'server-check-path'
],)
server_check_path
=
self
.
options
[
'server-check-path'
],)
template_filename
=
self
.
getTemplateFilename
(
'haproxy.cfg.in'
)
configuration_path
=
self
.
createFile
(
configuration_path
=
self
.
createFile
(
self
.
options
[
'conf-path'
],
self
.
options
[
'conf-path'
],
self
.
substituteTemplate
(
template_filename
,
config
))
self
.
substituteTemplate
(
template_filename
,
config
))
...
...
slapos/recipe/haproxy/template/haproxy-no-timeout-server-snippet.cfg.in
0 → 100644
View file @
b398f31d
server %(name)s %(address)s cookie %(name)s check inter 3s rise 1 fall 2 maxqueue 1 maxconn %(cluster_zope_thread_amount)s
slapos/recipe/haproxy/template/haproxy-no-timeout.cfg.in
0 → 100644
View file @
b398f31d
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
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment