Skip to content

Instantly share code, notes, and snippets.

@ramr
Created May 23, 2016 20:34
Show Gist options
  • Save ramr/ff0a6a12c99e6233fe2413570635a74e to your computer and use it in GitHub Desktop.
Save ramr/ff0a6a12c99e6233fe2413570635a74e to your computer and use it in GitHub Desktop.
router-disable-sticky-tcp-sessions
diff --git a/images/router/haproxy/conf/haproxy-config.template b/images/router/haproxy/conf/haproxy-config.template
index 82eb147..c06dc80 100644
--- a/images/router/haproxy/conf/haproxy-config.template
+++ b/images/router/haproxy/conf/haproxy-config.template
@@ -239,7 +239,11 @@ backend be_tcp_{{$cfgIdx}}
{{ if ne (env "ROUTER_SYSLOG_ADDRESS" "") ""}}
option tcplog
{{ end }}
+{{ if eq (env "ROUTER_DISABLE_STICKY_SESSIONS" "") "" }}
balance source
+{{ else }}
+ balance leastconn
+{{ end }}
hash-type consistent
timeout check 5000ms
{{ range $idx, $endpoint := endpointsForAlias $cfg $serviceUnit }}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment