简体   繁体   中英

How to implement load balancer in tomcat when 2 tomcats are in different machines?

I have a web application which runs on 32 bit JDK and tomcat. This web application is intermittently crashing with OOMs and timeouts waiting for connection pool threads. So i am trying to install the application in 2 different tomcats on 2 different machines. 2 different machines so that more heap space will be available to help with the OOM.

Requirement is to direct the user to freely available tomcat when there are multiple parallel sessions in progress.

After reading about load balancing vs clustering, it looks like load balancing might be more suitable as i want all the requests from a user session to go to the same tomcat. Is this correct understanding?

however, clustering and load balancing do not seem to be supporting tomcats on 2 different machines. I need tomcats on different machines so that the application(JVM) can utilize more memory.

More reading resulted in more confusion in terms on "terracotta", "memcached", "session replication" etc.

It would be highly helpful if someone can point me in the right direction on what a possible solution can be in terms on increasing the resources the web application can utilize.

You can do this very easily with Apache HTTPD and its mod_proxy_loadbalancer . I've had a configuration like this running for years. It can do session stickiness and all that, and you can control it dynamically at runtime.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM