4 ms·
HAProxy has a built in way to do some of this -- you can setup an agent check that lets you dynamically adjust weights: https://cbonte.github.io/haproxy-dconv/2
by mrkurt 7y ago
HAProxy has a built in way to do some of this -- you can setup an agent check that lets you dynamically adjust weights: https://cbonte.github.io/haproxy-dconv/2.0/configuration.html#5.2-agent-check https://cbonte.github.io/haproxy-dconv/2.0/configuration.htm...
I think most proxies are planning to move logic like this to the control plane. Envoy's gRPC stuff has some ways to dynamically throttle traffic to backends.
Load balancers really need to become programming runtimes, imo. Config languages aren't very expressive, and almost everyone needs their own logic at the LB level.
I _just_ put together a demo of latency based load balancing using HAProxy + awk and it's neat, but still very rudimentary compared to what I could express in, say, JavaScript: https://github.com/superfly/multi-cloud-haproxy https://github.com/superfly/multi-cloud-haproxy
- diroussel 7y agoF5 BIG-IP can be programmed in Tcl. While it is a programming language, I have only seen it programmed by non-developers. With copy paste code, repeated string constants all over the place and no unit tests. I agree that load balancer a do need the expressiveness of programming languages, but ideally that would only be with some typing and ability to easily un it test.
- mrkurt 7y agoYes! And a good surface API, OpenResty (nginx + lua) is reasonably powerful but you're really limited based on the events they give you. I'm really hopeful about deno (https://github.com/denoland/deno https://github.com/denoland/deno) for this. TypeScript is nice, the deno TCP perf is good, all it needs is some good proxy libraries.
- mholt 7y agoCaddy 2 has an embedded scripting language that allows this. We have to flush it out some more but it's looking really good. In some of our early testing on basic workloads, we found that it's up to 2x faster than NGINX+Lua, largely because it does not require a VM. (This is a broad generalization, and we need to specifically optimize for these cases -- but this approach holds promise.)
- mrkurt 7y agoOh neat! What language did you all settle on?