Hi,

I'm trying to understand how balance url_param hash-type consistent should work. Haproxy 1.7.11.

Lets say, we have a config of two haproxy instances that balance content between local and remote (sibling).

server0 (10.0.0.1) would have config section like this:

backend load_balancer
  balance url_param file_id
  hash-type consistent
  server local_backend /path/to/socket id 1
  server remote_backend 10.0.0.2:80 id 2

backend local_backend
  balance url_param file_id
  hash-type consistent
  server server0 127.0.0.1:100
  server server1 127.0.0.1:200

server1 (10.0.0.2) would have config section like this:

backend load_balancer
  balance url_param file_id
  hash-type consistent
  server local_backend /path/to/socket id 2
  server remote_backend 10.0.0.1:80 id 1

backend local_backend
  balance url_param file_id
  hash-type consistent
  server server0 127.0.0.1:100
  server server1 127.0.0.1:200

Assuming that all requests indeed have URL parameter "file_id", should requests on both servers only reach single "local_backend" server since they are already balanced and are not anymore divided in "local_backend" because of identical configuration on both "load_balancer" and "local_backend"?

thanks in advance,
Veiko

Reply via email to