2

This is a variant of the previous question I asked: Possible to use Single URL for multiple tomcats

I noticed that Tomcat's load balancer, JK, supports round-robin weighted load balancing.

I'm wondering if it is possible for me to implement a custom load balancing policy that I can somehow plug into JK, or some alternative load balancer that works with Tomcat?

The only references to custom load balancer policies I could find are from Tomcat 5.x, which allows you to extend org.apache.webapp.balancer.Rule to implement a custom load balancer rule... but I'm not sure if this is still possible with Tomcat 7.

Community
  • 1
  • 1
Jin Kim
  • 16,562
  • 18
  • 60
  • 86

1 Answers1

1

Tomcat6/7 can be configure with Apache+mod_cluster.

http://www.devx.com/Java/Article/48086/0/page/1
http://www.jboss.org/mod_cluster

In mod_cluster it is possible to calculate load on different factor.

http://docs.jboss.org/mod_cluster/1.1.0/html/java.AS7config.html

mod_cluster uses load balance factors calculated and provided by the application servers, rather than computing these in the proxy

Hitesh
  • 375
  • 6
  • 17
  • +1 **but**, please, do not refer to the old documentation for mod_cluster 1.1.x and definitely use mod_cluster [1.2.0+](http://docs.jboss.org/mod_cluster/1.2.0/html_single/). The best version that one can get is 1.2.6, yet, there are no zips to download yet, so one has to compile it... We will prepare the zips presently :-) – Michal Karm Babacek Sep 19 '13 at 07:16
  • And here they are mod_cluster 1.2.6 binaries: http://www.jboss.org/mod_cluster/downloads/1-2-6-Final-bin – Michal Karm Babacek Nov 14 '13 at 10:57