Discussion:
Balance based on network/cpu load
Jessy van Baal
2018-11-13 08:27:50 UTC
Permalink
Hi there!

Is there a way that HAProxy 1.8 can balance based on the network or CPU load on the backend servers?
Let's say, a backend server has 90% CPU usage, it gets out of the load balancing pool for a while until it gets stable.

Thanks in advance.

Yours sincerely,

Jessy van Baal
Bruno Henc
2018-11-13 08:37:00 UTC
Permalink
Hello,


Not sure if there is a direct way to do this, but you can always create
a monitoring process that will use the haproxy runtime API to MAINT or
DRAIN a server until the CPU / network load drops. So you have a simple
watchdog process which reads the output from your monitoring tools to
decide if a server needs to be disabled or re-enabled.


Hope this helps.


Best regards,


Bruno Henc
Post by Jessy van Baal
Hi there!
Is there a way that HAProxy 1.8 can balance based on the network or
CPU load on the backend servers?
LetÂ’s say, a backend server has 90% CPU usage, it gets out of the load
balancing pool for a while until it gets stable.
Thanks in advance.
Yours sincerely,
Jessy van Baal
Pavlos Parissis
2018-11-13 10:35:05 UTC
Permalink
Post by Bruno Henc
Hello,
Not sure if there is a direct way to do this, but you can always create a monitoring process that
will use the haproxy runtime API to MAINT or DRAIN a server until the CPU / network load drops. So
you have a simple watchdog process which reads the output from your monitoring tools to decide if a
server needs to be disabled or re-enabled.
Another approach is to use agent-check from haproxy to query a sidecar process on the backend
servers. That sidecar process determines, based on various criteria, the load of the server and
instructs haproxy to either drain or reduce the percentage of traffic that it gets.

Cheers,
Pavlos
Aaron West
2018-11-13 10:42:29 UTC
Permalink
Hi Jessy,

We made an opensource feedback agent which you can use if you like,
it'll save you the need to make anything:

https://www.loadbalancer.org/blog/open-source-windows-service-for-reporting-server-load-back-to-haproxy-load-balancer-feedback-agent/

Aaron West

Loadbalancer.org Ltd.

Loading...