Skip to content

evaluate stickiness settings on haproxy backends

Currently the haproxy backend configuration is such that every pool of servers is round-robin with the exception of websockets, ssh and pages.

  • websockets
    balance roundrobin
    cookie _gitlab_session prefix nocache
  • ssh
    balance source
    hash-type consistent
  • pages_http and pages_https
    balance source
    hash-type consistent

The other backends:

  • api: all of the api-xx nodes
  • https_git: all of the git-xx nodes
  • web: all of the web-xx nodes
  • canary_web: all of the web-cny-xx nodes
  • registry: all of the registry-xx nodes

Use roundrobin load balancing. As now we are starting to put some production traffic on canary we should probably consider making requests sticky so that clients do not potentially see multiple versions of the applications on a single page load.

For web and canary_web this would mean modifying our load balancing algorithm to use the session cookie:

    balance roundrobin
    cookie _gitlab_session prefix nocache

For the api this would mean modifying our load balancing algorithm to use the source ip:

    balance source
    hash-type consistent

but I wonder how smart this will be since most of our traffic is coming from the CICD. Until we are able to separate that traffic we should probably leave it roundrobin.

For the registry I'm not sure whether it matters much but we could also use source ip here as well:

    balance source
    hash-type consistent
Edited by John Jarvis