Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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?

share|improve this question
    
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 4 '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 6 '13 at 12:29

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Browse other questions tagged or ask your own question.