A
A
Alexander Wolf2016-04-28 11:43:10
linux
Alexander Wolf, 2016-04-28 11:43:10

Is it possible to set up balancing in HAProxy depending on the CPU load?

Good afternoon, colleagues! Deployed HAProxy and several servers behind it. Everything works as it should, however, there are times when users pull expensive operations that must be processed immediately. In this case, the load of one server can reach 100%, while other servers are idle at 5-10%.
I would like to make it so that users move to another server at the time of peak load, until the operation is completed and the CPU load drops again.
Is it possible? And how to implement?

Answer the question

In order to leave comments, you need to log in

3 answer(s)
L
Lynn "Coffee Man", 2016-04-29
@mannaro

https://github.com/reincubate/haproxy-dynamic-weight

V
viiy, 2016-04-28
@viiy

can be customized.
Look at the solution how percona xtradb cluster is balanced.
Namely:
- xinetd
- a script on top of xinetd on a specific port that returns http status 200 or another depending on something
- http haproxy check that refers to xinetd where the script is running that returns code
- haproxy balancing based on check
O script.
You can set it to return a NOT 200 status when cpuload goes over the top
Even more specifically
https://serverfault.com/questions/466059/haproxy-p...

K
Konkase, 2016-04-28
@Konkase

By means of Haproxy alone - no

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question