Can I implement switching depending on load on the Tomcat server processors?
In the documentation of anything like this I do not find…
There is an algorithm - at leastconn, but we use the traffic to Tomcat servers. As I understand it, this algorithm does not quite fit.
We have individual requests that can load the Tomcat server for a long time. And I would like so that on such loaded servers there would not be distribution of other requests until they are freed.
You can influence servers weight and other settings externally, so yes, if you are willing to build a solution around that you can probably achieve what you want.
But haproxy is not gonna check the CPU load on your backend servers for you. You have to do it yourself. Also, if this is setup to drastic, you may be causing oscillations instead of a balanced situation. That is an important question to think about when trying to achieve load-based balancing.
I found Herald agent - it looks like he knows how to do it