Keep stick table entry when connection is active

We have an online mobile game using websocket for connections. Recently I setup haproxy for load balancing players across server samples. I use stick tables for tracking users connections and connect them to the same server they’re playing match in it.

The problem is stick table entries timeout start immediately after connection, so for example if I set table expire time to 30m and player keeps playing matches for 40 minutes and then disconnects, his entry is removed from the table and may reconnect to wrong server.

I temporarily solved this situation by setting expire to 6h. But the preferable option is to keep entries on the table while the connection is active.

Is there any way to hold expire timeout when connection is active or refresh it when there is activity on the connection?

Thank you in advance

Did you ever get this one figured out? We’re interested in a similar behavior, and could go down the route of client-side ‘ping’ requests to regularly keep the stick table active, but hoped to find something more like what you described here.

Hello, I have read available docs but there’s nothing mentioned about altering the timeout behavior.

I think one should patch HAproxy stick-table code to achieve this.

Could you guys file a feature request at github:

Good idea: https://github.com/haproxy/haproxy/issues/1480