i have two servers that i want to balance. i want to use a consistent hashing method to balance them accross both servers. if one server goes down i want all customers on this server to fail over to the other, but i also want them to return once the server comes back online. this happens often enough that a stick table would just cause all the traffic to be sent to the other server for rest of the day.
The second part of this is that we need each customer to be on the same server. so customer 1 would have 5 users and they should be using the same backend server. as you can probably tell we don’t have a stateless design and there are some state issues that require this.
below is my ideal config. but obviously doesn’t work. my idea was to set a cookie from the web app per customer and have that be hashed so as to indicate which server they log into.
backend servers
hash-type consistent sdbm
balance req.cook(server_indicator)
server s8000 127.0.0.1:8000 check
server s8001 127.0.0.1:8001 check