5 ms·
I found it interesting because such a simple task (requiring at least a number of on-line servers before the load-balancer starts serving requests), required a
by ciprian_craciun 6y ago
I found it interesting because such a simple task (requiring at least a number of on-line servers before the load-balancer starts serving requests), required a custom binary controlled the webserver and had to cross-monitor each server.
For example with HAProxy (my favorite load-balancer and HTTP "router") this can be easily achieved by using `nbsrv`, creating an ACL and only routing requests to the backend based on that ACL. Based on the documentation bellow:
* http://cbonte.github.io/haproxy-dconv/2.1/configuration.html#7.3.1-nbsrv http://cbonte.github.io/haproxy-dconv/2.1/configuration.html...
* http://cbonte.github.io/haproxy-dconv/2.1/configuration.html#4.2-monitor%20fail http://cbonte.github.io/haproxy-dconv/2.1/configuration.html...
One can write this:
~~~~
frontend www
mode http
acl site_alive nbsrv(dynamic) gt 2
use_backend dynamic if site_alive
~~~~
[This article was linked from the original article described in (https://news.ycombinator.com/item?id=23099347 https://news.ycombinator.com/item?id=23099347).]
- jefftk 6y agoThings are a lot easier these days, mostly because there's been more time for people to have problems and code up good generalizable solutions
- ciprian_craciun 6y agoI just wanted to mention that I didn't fault the original author for the proposed solution. It was 2011, they seemed to use some commercial load-balancer, and the customer didn't seem to want to actually solve the solution. I actually found the original solution interesting, and I also proposed an alternative achievable with HAProxy as an load-balancer.
- dumbfounder 6y agoThis was written in 2011, I think it's something that happened many years before. Sounds more like a 2001 thing to do.
- wrkronmiller 6y agoThat config looks like it kills the site if there are 2 or fewer back-end servers (similar to the setup in the article). Wouldn't it make more sense simply to limit the number of connections per back-end server?
- ciprian_craciun 6y agoIndeed if I were to configure the load-balancer I would limit both the number of concurrent requests and the number of queued requests. (In fact this is what I do in my HAProxy deployments.) However I assume that the customer (the original author was referring to) didn't want to apply any limitations. (Why is beyond my reasoning...)