# Can I implement switching depending on load on the Tomcat server processors?

**URL:** <https://discourse.haproxy.org/t/can-i-implement-switching-depending-on-load-on-the-tomcat-server-processors/2522>\
**Category:** Help!\
**Created:** [May 22, 2018, 7:27am UTC](https://discourse.haproxy.org/t/can-i-implement-switching-depending-on-load-on-the-tomcat-server-processors/2522 "2018-05-22T07:27:20Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![MinistrBob](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/ministrbob/32/1396_2.png) [@MinistrBob](https://discourse.haproxy.org/u/MinistrBob)\
**Post date:** [May 22, 2018, 7:27am UTC](https://discourse.haproxy.org/t/can-i-implement-switching-depending-on-load-on-the-tomcat-server-processors/2522/1 "2018-05-22T07:27:20Z")

</div>

Hello!

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.

---

<div class="post-metadata">

**Author:** ![lukastribus](https://avatars.discourse-cdn.com/v4/letter/l/7ea924/32.png) [@lukastribus](https://discourse.haproxy.org/u/lukastribus)\
**Post date:** [May 22, 2018, 7:47am UTC](https://discourse.haproxy.org/t/can-i-implement-switching-depending-on-load-on-the-tomcat-server-processors/2522/2 "2018-05-22T07:47:12Z")

</div>

You can [influence servers weight](http://cbonte.github.io/haproxy-dconv/1.8/management.html#set%20weight) 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.

---

<div class="post-metadata">

**Author:** ![MinistrBob](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.haproxy.org/ministrbob/32/1396_2.png) [@MinistrBob](https://discourse.haproxy.org/u/MinistrBob)\
**Post date:** [May 22, 2018, 8:16am UTC](https://discourse.haproxy.org/t/can-i-implement-switching-depending-on-load-on-the-tomcat-server-processors/2522/3 "2018-05-22T08:16:18Z")

</div>

I found [Herald](https://github.com/helpshift/herald) agent - it looks like he knows how to do it
