News for hackers. Stuff that matters.
Re:Load Balancing by mkl95 on Tuesday April 18, 2023 @09:24AM (#35613659)
Sounds like sticky sessions
Re:Load Balancing by jqpabc123 on Tuesday April 18, 2023 @10:00AM (#35614143)
"Sticky" applies after a session has been assigned to a server. I'm interested in control over the assignment algorithm.
Re:Load Balancing by cett on Tuesday April 18, 2023 @10:22AM (#35614410)
Definitely doable with HAProxy + lua. I've used it extensively for load balancing stateful apps.
Re:Load Balancing by jqpabc123 on Tuesday April 18, 2023 @10:35AM (#35614567)
I'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.

Re:Load Balancing by cett on Tuesday April 18, 2023 @11:04AM (#35614940)
HAProxy can also do redirects
Re:Load Balancing by adql on Wednesday April 19, 2023 @08:02AM (#35627084)
Start here:

https://github.com/haproxy/spoa-example

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-...