From b50a748d44d0664e57d3c3fef9a3cfd2e97ebcb9 Mon Sep 17 00:00:00 2001 From: Clark Boylan Date: Tue, 28 May 2019 08:17:05 -0700 Subject: [PATCH] Switch git lb to source balance method We were using the leastconn method which sends new connections to the backend with the least number of connections. Unfortunately git clients seem to have trouble with varying backend repo state (due to GC and packing) and the thought is sending all requests from a single client to a single backend will alleviate this. To do this we switch to the source balance method which hashes the source IP and finds a stable backend to talk to. This method handles backend outages fine as it will hash to a new backend if the older one goes offline. Change-Id: I2c7a4ec0809a2f4ef6556833ac6a0ff3651904dd --- playbooks/roles/haproxy/templates/haproxy.cfg.j2 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/playbooks/roles/haproxy/templates/haproxy.cfg.j2 b/playbooks/roles/haproxy/templates/haproxy.cfg.j2 index 8e217e5c63..5d96f92804 100644 --- a/playbooks/roles/haproxy/templates/haproxy.cfg.j2 +++ b/playbooks/roles/haproxy/templates/haproxy.cfg.j2 @@ -25,7 +25,7 @@ listen {{ listener.name }} bind {{ bind }} {% endfor %} mode tcp - balance leastconn + balance source option tcplog {% for server in listener.servers %}