51a7 Tomcat - Load Balancing v Clustering - The Java Programming language
Training, Open Source computer languages
PerlPHPPythonMySQLApache / TomcatTclRubyJavaC and C++LinuxCSS 
Search for:
Home Accessibility Courses Diary The Mouth Forum Resources Site Map About Us Contact
Tomcat - Load Balancing v Clustering

Posted by admin (Graham Ellis), 11 June 2006
On last week's Apache httpd and Tomcat course, the majority of the delegates were concerned with sharing an intensive task between a number of servers due to potential loading issues.

There are several ways of doing this. Using load balancing, requests are (re) written to different processors, and each processor handles the requests that it gets.  Any changes that will effect subsequent requests are written back to a central database.   Load Balancing can be undertaken by Tomcat itself, by an Apache httpd front end (good solution, that one), or by a hardware box that acts as a load balancer.

If you're clever with your load balancer, you can ensure that the second and subsequent pages of a session are all called up from the same host on which the first page was generated, thus slashing the requirement to write back to the central database at every action.  We have sample configuration files here and here to help you see how such a scheme works.

If you need near-instant communication between all the processors - if, for example, you were running a very busy auction site, you might go for clustering instead.   With Clustering, requests can be made of any of the Tomcat servers in your pool.  All the servers broadcast changes made every (default) 500 ms, and the other servers keep note of the changes.   Works well enough, but all the servers need to be on the same subnet, and the resource loading can be intrusive.   There's a configuration sample here




This page is a thread posted to the opentalk forum at www.opentalk.org.uk and archived here for reference. To jump to the archive index please follow this link.

You can Add a comment or ranking to this page

© WELL HOUSE CONSULTANTS LTD., 2013: Well House Manor • 48 Spa Road • Melksham, Wiltshire • United Kingdom • SN12 7NY
PH: 01144 1225 708225 • FAX: 01144 1225 899360 • EMAIL: info@wellho.net • WEB: http://www.wellho.net • SKYPE: wellho
0