0

We have HAProxy 1.4 successfully performing sticky session routing based on a value in the request querystring with the following configuration command.

balance url_param userId

This works great and if application server A fails, then you can see subsequent requests being routed to a new target server B which is the desired behaviour.

However, if application server A comes back online we see the requests for certain users once again being routed there which causes the users to experience 2 dropped sessions instead of just 1.

Is there any way to tell HAProxy to pin requests for active sessions to server B for some minimum timeout period so that requests only return to Server A once those user sessions have expired?

  • What version of HAproxy are you using. I think some of this behavior has changed recently. – jeffatrackaid Oct 31 '13 at 19:57
  • May want to check into stick-tables but would encourage looking into using distributed/replicated sessions on the backend. – jeffatrackaid Oct 31 '13 at 20:11
  • @jeffatrackaid We are using 1.4 right now. I'll update the question details. I think I'll try 1.5 based on what you have said. – Duncan Mason Nov 04 '13 at 11:43
  • @jeffatrackaid Thanks. Upgrading to 1.5 did the trick using the following stick-table setting: stick-table type string len 50 size 100k expire 30m – Duncan Mason Nov 06 '13 at 12:29

0 Answers0