Is it possible in HAProxy balancing a little disappointed depending on CPU load?

Good afternoon, colleagues! Deployed HAProxy and multiple servers behind it. Everything works as it should, however, there are times when the users pull expensive operations that should be treated immediately. In this case, the download of a single server may reach 100 percent while other servers are idle at 5-10%.
I would like at the time of peak loading to make users moved to another server until the operation is completed and the CPU load will not fall again.

Is it possible? And how to implement?
July 12th 19 at 17:24
3 answers
July 12th 19 at 17:26
Solution
July 12th 19 at 17:28
You can configure.

View the decision as a balancing percona xtradb cluster.
Namely:

- xinetd
script on top of xinetd on the specified port, which returns http status 200 or the other depending on something
http haproxy check that accesses xinetd, running the script returns the code
- haproxy balancing based on the verification

About the script.
Can be configured to return status 200 when cpuload rolls

Even more specifically
https://serverfault.com/questions/466059/haproxy-p...
Yes, thank you. I imagine how to implement. However, this method will allow you to inform HAProxy about whether server is available or not. However, if the first server is loaded at 99% and the second at 95% and both do not give a 200 status, then HAProxy will show the error for new users. However, I would still connect them to the less loaded server, what to do in this way is impossible =) - Agnes.Zie commented on July 12th 19 at 17:31
Haproxy have a lot of options. You can pay not just 200, and a specific value in the body. With this value you can then use in weight. Read the sections about conditions, L7 server, weight - celestino.Flatley commented on July 12th 19 at 17:34
July 12th 19 at 17:30
Means only one Haproxy - no
Do you know any ready-made solutions that will allow to solve this task? - Agnes.Zie commented on July 12th 19 at 17:33

Find more questions by tags MeteorHAproxyLinuxNode.js