Hacker News new | ask | show | jobs
by aidos 1855 days ago
I last used HAProxy about a decade ago for fairly simple load balancing and caching - worked really well.

Question about the suitability for a dynamic backend case. I have a system where clients are assigned to backends exclusively for the duration of a session. At the moment I have a pool of backends and each client is explicitly told which backend to use so they can route to it. Ideally I’d make this transparent so it was easier to reassign on the fly. Is this case reasonably supported with HAProxy and which features should I be looking at to get a sense of it?

I’m working under the assumption that I’ll need to build the machinery to maintain the pool and registry of where clients should be routed to.

1 comments

While I have not tested this specific use case, I would start by exploring map files [1] and/or stick tables [2]. Map files can be updated on-the-fly through the HAProxy Runtime API. With stick tables you can persist a session/client based on anything found within the request headers, which would include a users session id.

[1] https://www.haproxy.com/blog/introduction-to-haproxy-maps/

[2] https://www.haproxy.com/blog/introduction-to-haproxy-stick-t...

Excellent, thanks for the info, will check it out.