Load balancing

Load balancing is transparent to the client. The redirector detects and directs requests from existing sessions to EAServer using either the J2EE cookie or the J2EE session identifier that is part of the HTTP request. If the cookie or identifier is missing, the client is treated as a new client, otherwise, the redirector sends the request to the EAServer that originally established the session.

New requests are directed to different application servers that share and balance the load. Load balancing is based on a round-robin scheme. If a redirector is configured to service n number of application servers, and a new request arrives at the redirector, it is directed to the next application server in its list (as defined by the redirector configuration file) that has not previously serviced a request. The next new request is sent to the next available server, and so on.

Apache Web server

Apache Web servers handle load balancing differently than IIS, iPlanet, Netscape, and Sun Java System. Apache Web servers spawn multiple processes to handle the client load, whereas the other Web servers use only a single process. Since Apache spawns multiple processes, client request loads are balanced for each Apache Web server process, not for all Apache processes. Therefore, while monitoring connection requests from an Apache Web server to multiple EAServer installations, you might initially see many new client requests from multiple Apache processes being directed to a single EAServer. In time, and as the number of client requests to the Apache Web server increases, the load is evenly distributed across all EAServer installations.

In Figure 4-2, the Web server redirector has an entry in the redirector configuration file that directs requests for the “examples” Web application to three application servers: jag1, jag2, and jag3. Requests for the Web application are distributed evenly across all three servers.

Figure 4-2: redirector configuration file entry