4 ms·
Sounds like sticky sessions
by mkl95 4y ago
Sounds like sticky sessions
- jqpabc123 4y ago"Sticky" applies after a session has been assigned to a server. I'm interested in control over the assignment algorithm.
- cett 4y agoDefinitely doable with HAProxy + lua. I've used it extensively for load balancing stateful apps.
- jqpabc123 4y agoI'll definitely take a look at this. What I have in mind isn't really a "proxy" but more of a login/redirection server. A "proxy" is middleware which directs all communication through a single server which adds to latency. What I have in mind will run logins through a single server. But once the login is complete, any further communication is redirected to the proper work server to continue without any proxy middleware involved. This won't entirely eliminate downtime issues but it does limit the effects to a reasonable level while offering increased efficiency and decreased latency.
- cett 4y agoHAProxy can also do redirects
- adql 4y agoStart here: https://github.com/haproxy/spoa-example https://github.com/haproxy/spoa-example https://www.haproxy.com/blog/extending-haproxy-with-the-stream-processing-offload-engine/ https://www.haproxy.com/blog/extending-haproxy-with-the-stre... We used that to make an SSO login site that works independently on what is on the backend. Logic was basically: * if there is no/invalid SSO cookie, SPOA set a flag which made haproxy redirect to the SSO app * if there is valid cookie, decode it and send the data (usually just logged user name) to the app in header Once cookie is correct it doesn't need SSO server so it is pretty fast for users that already logged in. It can be also used for blocking requests based on external engine, it's pretty flexible overall https://docs.fastly.com/signalsciences/install-guides/other-modules/haproxy-spoe-module/ https://docs.fastly.com/signalsciences/install-guides/other-...