Chapter 17: Clustering Clustering Benefits Clustering in Tomcat
Chapter 17: Clustering Clustering Benefits Clustering in Tomcat 6 enables a set of Tomcat instances on a LAN (called a cluster) to appear to incoming users as a single server. This enables the distribution of work among the servers, called load balancing. Chapter 11 covers a load-balancing configuration with the AJP Connector and mod_proxywith Apache 2.2.x (as well as mod_jkfor Apache 1.3. x and Apache 2.0. x). Figure 17-1 illustrates load-balancing. Without load balancing With load balancing Increasing load from incoming requests Increasing load from incoming requests mod_proxy or mod_jk Apache AJP tomcat1 mod_proxy or mod_jk Apache AJP tomcat2 Overloaded Tomcat server AJP tomcat3 AJP tomcat1 Figure 17-1: Load balancing with Tomcat 6 In Figure 17-1 , if an increasing stream of incoming requests were sent to the tomcat1 server, at some point the server will overload and crash by running out of resources. By deploying a load-balanced cluster, however, more requests can be handled. Scalability and Clustering Using the load-balanced configuration shown in Figure 17-1 , incoming requests are distributed over the tomcat1, tomcat2, and tomcat3 servers. This means that each server is handling only a portion of the incoming requests. If the load-balancing distributor and algorithm are efficient, the system as a whole can handle significantly more requests before overloading. Scalability refers to the capability to provide service for an increasing number of users. Formerly, scaling an application to more users required an upgrade to expensive, multiple-CPU systems and corresponding memory expansion. This approach is often called scaling up. The way that clustering is handled in Tomcat 6 leverages inexpensive high-speed LAN interconnections to share the computing resources of multiple server machines. This approach is called scaling out or horizontal scaling. It provides an obvious cost advantage, as a server farm of low-cost commodity hardware is less expensive than a single multiple-CPU server. Load balancing can solve the scalability problem by enabling the cluster to handle significantly more simultaneous requests than a single nonclustered server. Tomcat servers can support horizontal scaling through the use of the AJP Connector and the mod_jk plug-in with the Apache Web server.
For high quality website hosting services please check cheap web hosting website.