Oracle Web Cache Stateless Load Balancing

9-18 Oracle Fusion Middleware High Availability Guide For further information about these tools, see the Oracle Fusion Middleware Administrators Guide for Oracle Web Cache.

9.3.2 Oracle Web Cache High Availability Considerations

The following sections describe the high availability solutions available with Oracle Web Cache: ■ Section 9.3.2.1, Oracle Web Cache Stateless Load Balancing ■ Section 9.3.2.2, Oracle Web Cache Backend Failover ■ Section 9.3.2.3, Oracle Web Cache Session Binding ■ Section 9.3.2.4, Oracle Web Cache Cluster-Wide Configuration Changes ■ Section 9.3.2.5, Oracle Web Cache as a Software Load Balancer

9.3.2.1 Oracle Web Cache Stateless Load Balancing

Most Web sites are served by multiple origin servers running on multiple computers that share the load of HTTP and HTTPS requests. All requests that Oracle Web Cache cannot serve are passed to the origin servers. Oracle Web Cache balances the load among origin servers by determining the percentage of the available capacity, the weighted available capacity of each origin server. Oracle Web Cache sends a request to the origin server with the most weighted available capacity. The weighted available capacity is determined by the following formula: Capacity - Load Capacity where: ■ Capacity is the maximum number of concurrent connections that the origin server can accept ■ Load is the number of connections currently in use If the weighted available capacity is equal for multiple origin servers, Oracle Web Cache sends requests to the origin servers using round robin. With round robin, the first origin server in the list of configured servers receives the request, then the second origin server receives the second request. If the weighted available capacity is not equal, Oracle Web Cache sends the request to the origin server with the most available capacity. If the load of origin servers is equivalent, Oracle Web Cache continues to use round robin, even when capacity is not equal for origin servers. Therefore, it is possible to see an even distribution of requests to origin server when the capacities are not configured to be the same. To configure load balancing for a site, set the capacity of each origin server, and create one site-to-server mapping that maps all the applicable origin servers to the site. Figure 9–5 shows two sites, www.company.com:80 and www.server.com:80. The site www.company.com:80 is supported by application Web servers company-host1 and company-host2 with capacities of 50 each. The site www.server.com:80 is supported by application Web servers server-host1, server-host2, and server-host3 with capacities of 150, 50, and 50, respectively. Configuring High Availability for Web Tier Components 9-19 Figure 9–5 Load Balancing Assuming all application Web servers have an initial load of 0, the requests to www.company.com:80 and www.server.com:80 will be distributed in the following manner: ■ The requests to www.company.com:80 are distributed between the two origin servers using round robin. The requests to company-host1 and company-host2 will be distributed between the two origin servers so that they maintain an equal load. The first request is sent to company-host1. The second request is sent to company-host2 if company-host1 is still processing the first request. The third and subsequent requests are sent to the origin server that has the highest weighted available capacity. When the capacities are equal, Oracle Web Cache uses round robin to distribute requests. Application Servers company1-host company2-host Oracle Web Cache Web Browser Web Browser Web Browser Web Browser Incoming Requests to www.company.com:80 Incoming Requests to www.server.com:80 Capacity:50 Capacity:50 Application Servers server1-host server2-host server3-host Capacity:150 Capacity:50 Capacity:50 Load balancing of requests Load balancing of requests Site: www.server.com:80 Site: www.company.com:80 9-20 Oracle Fusion Middleware High Availability Guide ■ The requests to www.server.com:80 are distributed between three origin servers using the weighted available capacity percentage. The first request to www.server.com:80 is sent to server-host1, because it is the first in the configured list. The second request is sent to server2-host, because server-host1 is still processing the first request and has a weighted available capacity of 99.3 percent and server-host2 has a weighted available capacity of 100 percent. The third request is sent to server-host3 because server2-host is still processing a request and has a weighted available capacity of 98 percent and server3-host has a weighted available capacity of 100 percent. The fourth request is sent to server-host1 because server-host2 and server3-host are still processing requests and have weighted available capacities of 98 percent. The fifth request is sent to server-host1 because its weighted available capacity is 98.6 percent, which is still greater than server-host2 and server-host3, respectively. When the capacities and loads are not equal, Oracle Web Cache uses the weighted available capacity to distribute requests. If requests were processed before new requests came in, then it is possible for all three origin servers to have loads of 0. In this case, Oracle Web Cache uses round robin. See the Oracle Fusion Middleware Administrators Guide for Oracle Web Cache for instructions on specifying capacity and creating site-to-server mappings.

9.3.2.2 Oracle Web Cache Backend Failover