Skip Headers
Oracle® Application Server Web Cache Administrator's Guide
10g Release 2 (10.1.2)
B14046-05
  Go To Documentation Library
Home
Go To Product List
Solution Area
Go To Table Of Contents
Contents
Go To Index
Index

Previous
Previous
Next
Next
 

10 Configuring Cache Clusters

This chapter provides instructions for configuring a cache cluster, also known as OracleAS Cluster (Web Cache).

This chapter contains these topics:


See Also:

Chapter 3 for an overview of cache clusters

Configuring a Cache Cluster

To increase the availability and scalability of your Web site, you can configure multiple instances of OracleAS Web Cache to run as members of a cache cluster.

To configure a cache cluster, you configure two or more OracleAS Web Cache instances as cache cluster members, and specify properties for the cluster.

A cache cluster uses one configuration that is propagated from the current cache (the cache to which your client browser is connected) to all cluster members. The configuration contains settings that are the same for all cluster members as well as cache-specific settings for each cluster member.

The following settings pertain to all members of a cluster:

The following settings are specific to each member of the cluster:

This section contains the following topics to help you in configuring a cache cluster:

In addition, see the following information about configuring clusters:

Configuration Prerequisites

Because a cache cluster contains two or more instances of OracleAS Web Cache, you must have two or more instances of OracleAS Web Cache installed on one or more nodes before you configure a cache cluster. The instances must be the same version of OracleAS Web Cache. In addition, the respective passwords for the OracleAS Web Cache administrator, administrator, and the invalidator user, invalidator, must be the same across the cluster members.

You can modify the passwords in the Security page of Application Server Control Console (Web Cache Home page > Administration tab > Properties > Web Cache > Security) or OracleAS Web Cache Manager (Properties > Security).

Understanding Failover Threshold and Capacity Settings

To ease with configuration, take the time to understand the following key configuration settings for a cache cluster and its members:

Failover Threshold for the Cache Cluster

You set the failover threshold when you configure cache cluster properties. This setting reflects the number of allowed consecutive request failures before OracleAS Web Cache considers another cache cluster member to have failed. OracleAS Web Cache considers a request to another cache cluster member to have failed if:

  • There are any network errors

  • The HTTP response status code is either less than 100, or is one of the following: 500 Internal Server Error, 502 Bad Gateway, 503 Service Unavailable, or 504 Gateway Timeout.

For each failed request, OracleAS Web Cache increments the failure counter for that cluster member. This counter is kept separately by each cluster member. When a request is successfully processed by a cluster member, OracleAS Web Cache resets the failure counter.

When the failover threshold is met, OracleAS Web Cache considers the cache cluster member to have failed. OracleAS Web Cache recalculates the relative capacity of the remaining cache cluster members. It then reassigns ownership of cache content.

When a cache cluster member is down, OracleAS Web Cache starts polling the cache cluster member. It does this by sending requests to the ping URL you specify. When OracleAS Web Cache receives a success response from the cache cluster member, it considers that cache cluster member to be up again. It recalculates the relative capacity of the cache cluster members and it reassigns ownership of cache content.

Capacity for Cache Cluster Members

When you configure a cache cluster member, you specify capacity for that member.

OracleAS Web Cache uses capacity in two different ways:

  • As the absolute capacity for the number of concurrent incoming connections to this cache cluster member from all other cache cluster members.

    The connections are used to receive requests for owned content from other cache cluster members. The number of connections are divided among the other cluster members. For example, in a three-cache cluster, if the capacity of Cache_A is 50, Cache_B can open 25 connections to Cache_A and Cache_C can open 25 connections to Cache_A.

    More connections are used when another cache cluster member contains little or no data in its cache, such as when it is initially started, when it recovers from a failure, or after invalidation. During this time, the cluster member sends many of the requests to its peers, the owners of the content. In most cases, these requests are served more quickly than requests to the origin server. Having a higher number of connections increases performance during this time and shortens the time it takes to fully load the cache. After a cache is fully loaded, fewer of the connections are used. There is no overhead for unused connections.

  • As the relative capacity of the cache cluster member.

    The capacity of a cache cluster member is weighted against the total capacity of all active cache cluster members. When you set the capacity, OracleAS Web Cache assigns a percentage of the ownership array to the cluster member, indicating how much of the cached content will be owned by the cluster member. The percentage is calculated using the following formula:

    cluster_member_capacity / total_capacity_of_all_active_cluster_members
    
    

    For example, if cache cluster member Cache_A has a capacity of 100 and cache cluster member Cache_B has a capacity of 300, for a total capacity of 400, Cache_A is assigned 25 percent of the ownership array and Cache_B is assigned 75 percent of the ownership array. That means that Cache_A owns 25 percent of the cached content.

    Note that in calculating the relative capacity, OracleAS Web Cache considers the capacity of active cluster members; it does not consider the capacity of cluster members that it has determined to have failed.

Set the initial capacity for each cache cluster member to 10 percent of the maximum number of incoming connections. You can find this setting in the Resource Limits and Timeouts page of Application Server Control Console (Web Cache Home page > Administration tab > Properties > Web Cache > Resource Limits and Timeouts) or the Resource Limits page of OracleAS Web Cache Manager (Properties > Resource Limits.

Once you have a better idea of the site's capacity needs and hit rates, fine tune the capacity. If these two assumptions apply to your cache cluster, then apply the following formula to determine the capacity for each cluster member:

  1. Incoming traffic will be distributed equally to all the cache cluster members.

  2. Ownership of content will be distributed equally among all the cache cluster members.

In the following formula, pick the highest value between the default value or the max_incoming_connections formula:

max(default_value, (max_incoming_connections * (cacheable_misses%/100) * (number_of_caches - 1) / number_of_caches))

In the formula:

  • default_value is one of the following:

    • 100 for production environments

    • 30 for test environments

    • 0 for invalidation-only clusters

    When the capacity increases, the number of file descriptors needed by OracleAS Web Cache also increases.


    See Also:


  • max_incoming_connections is the maximum number of incoming connections.

    You can find this setting in the Resource Limits and Timeouts page of Application Server Control Console (Web Cache Home page > Administration tab > Properties > Web Cache > Resource Limits and Timeouts) or the Resource Limits page of OracleAS Web Cache Manager (Properties > Resource Limits).

  • cacheable_misses% is the percentage of requests for cacheable objects that were not served directly by OracleAS Web Cache, but were served by OracleAS Web Cache after it fetched the content from the origin server.

    You can find the Cacheable Misses setting in the Performance page of Application Server Control Console (Web Cache Home page > Performance tab) or the Web Cache Statistics page of OracleAS Web Cache Manager (Monitoring > Web Cache Statistics). Use the statistic reported in the Average (per second) column of the Performance page and the Since Start column of the Web Cache Statistics page, respectively.

For example, assume a cache cluster with four members. If OracleAS Web Cache is operating at 1500 maximum incoming connections, with a 30 percent cacheable miss rate, then the equation to calculate capacity for this configuration looks like the following:

(1500 * (30/100) * (4 - 1) / 4

The equation calculates to 337.5. You would round up to 338, which is the capacity you would then enter for each cache cluster member.

1500 * .3 * 3 / 4 = 337.5

If you assign a capacity of 0 to a cluster member, that cluster member will not receive requests from other cluster members. However, that cluster member will forward requests to other cluster members, the owners of the content. If you assign a capacity of 0 to all cluster members, no requests will be forwarded between cluster members. Even when capacity is set to 0, you can still propagate the configuration and OracleAS Web Cache can automatically propagate invalidation requests to cluster members.

Task 1: Configure Cache Cluster Settings

To configure settings for a cache cluster in Application Server Control Console, navigate to Web Cache Home page > Administration tab > Cluster Properties > Members and Properties.


See Also:

"Configuring Cache Cluster Settings" in Enterprise Manager Online Help for instructions

To configure settings for a cache cluster in OracleAS Web Cache Manager:

  1. In the navigator frame, select Properties > Clustering.

    The Clustering page appears. The General Cluster Information section displays the default clusterwide values for failover and invalidation propagation. The Cluster Members table displays the current cache (the cache to which you are connected) as the only cluster member. OracleAS Web Cache ignores the cluster information if there is only one cluster member.

  2. In the General Cluster Information section of the Clustering page, click Edit.

    The Edit General Cluster Information dialog box appears.

  3. In the Cluster Name field, enter a name for the cluster.

  4. In the Failover Threshold field, enter the number of allowed consecutive request failures before OracleAS Web Cache considers another cache cluster member to have failed.

    The default is five failures.

    See "Failover Threshold for the Cache Cluster" for further information about this field.

  5. In the Ping URL field, enter the URL that cache cluster members will use to attempt to contact a cache cluster member that has reached its failover threshold.

    Use a URL that is cacheable and that you can guarantee is stored in each cache. The default is _oracle_http_server_webcache_static_.html, which is stored in the cache.

  6. In the Ping Interval field, enter the time, in seconds, between attempts by a cluster member to reach the failed cluster member.

    The default, 10 seconds, is a reasonable interval for most situations.

  7. In the Propagate Invalidation field, select Yes or No to specify whether or not you want all invalidation requests from any cache cluster member to be propagated to other cache cluster members.

  8. Click Submit.

  9. In the Cluster Members table of the Clustering page, default values are displayed for the current cache. Select the cache and click Edit Selected.

    The Edit Cluster Member dialog box appears.

  10. In the Cache Name field, enter a name for the OracleAS Web Cache instance. The name must be unique from the names of other caches in the cache cluster.

  11. By default, the Host Name field contains the host name of the node on which OracleAS Web Cache is installed. Usually, you do not need to modify this field.

  12. By default, the Oracle Home field contains the file specification for the Oracle home in which OracleAS Web Cache is installed. Usually, you do not need to modify this field. Note that the combination of Host Name and Oracle Home must be unique in a cache cluster.

  13. In the Capacity field, enter the number of concurrent incoming connections from other cache cluster members that OracleAS Web Cache can sustain.

    See "Capacity for Cache Cluster Members" for further information about this field.

  14. Click Submit.

    You now have one cache, the current cache, in the cluster. However, the cluster information is ignored until you have more than one OracleAS Web Cache instance in the cluster.

Task 2: Add Caches to the Cluster

Before you can add a cache to the cluster, the following conditions must be met:

  • The cache must exist and must be started. See "Task 12: Restart OracleAS Web Cache" for information about starting OracleAS Web Cache.

  • The administrator password of the cache to be added must be the same as the administrator password of the cache to which you are connected. If it is different, you must connect to the cache's admin server and modify the administration password, as described in "Task 2: Modify Security Settings".

To add another cache to the cluster in Application Server Control Console, navigate to Web Cache Home page > Administration tab > Cluster Properties > Members and Properties.


See Also:

"Adding a Cache to a Cluster" in Enterprise Manager Online Help for instructions

To add another cache to the cluster in OracleAS Web Cache Manager:

  1. In the navigator frame, select Properties > Clustering.

    The Clustering page appears.

  2. In the Cluster Members section of the Clustering page, click Add.

    The Add Cache to Cluster dialog box appears.

  3. In the Host Name field, enter the host name of the cache to be added to the cluster.

  4. In the Admin Port field, enter the administration port for the cache to be added to the cluster.

    The administration port is the listening port for administrative requests.

  5. In the Protocol for Admin Port field, select either HTTP or HTTPS to accept HTTP or HTTPS client requests.

  6. In the Cache Name field, enter a name for the cache. The name must be unique from the names of other caches in the cache cluster.

  7. In the Capacity field, enter the number of concurrent incoming connections from other cache cluster members that OracleAS Web Cache can sustain.


    See Also:

    Step 13 in "Task 1: Configure Cache Cluster Settings" for more information about capacity

  8. Click Submit.

    The cache is now part of the cluster and is listed in the Cluster Member table.

  9. To add more OracleAS Web Cache instances to the cache cluster, repeat Steps 2 through 8.

  10. When you have completed adding members to the cache cluster, click Apply Changes.

OracleAS Web Cache adds the cache-specific information from the new cache cluster members to the cluster configuration.

You can add more OracleAS Web Cache instances to the cluster at any time by choosing Add. You can modify the settings for a cache cluster member by choosing Edit Selected. You can delete a cache cluster member, other than the current cache, by choosing Delete Selected.

Task 3: Enable Tracking of Session Binding

In a cache cluster, all cache cluster members must be able to determine which origin server established the session, although the request was routed originally through only one cache cluster member. To configure session binding in a cache cluster, you select a session binding mechanism of Cookie-based. Setting this mechanism adds a cookie that tracks session information so that it can be read by all cluster members. OracleAS Web Cache includes a Set-Cookie response-header in the response so that subsequent requests from the client include the cookie. The cookie provides information so that any of the cluster members can resolve the binding regardless of which cache handled the initial request.


See Also:


Task 4: Propagate the Configuration to Cluster Members

When you modify the cluster and apply changes, OracleAS Web Cache adds the cache-specific information from the new cache cluster members to the configuration. For those changes to take affect in all cluster members, you must propagate the configuration and restart the cache server process of the cluster members.

To propagate the configuration to new cluster members in Application Server Control Console, navigate to Web Cache Home page > Administration tab > Cluster Properties > Cluster Operations.


See Also:

"Propagate the Configuration to Cluster Members" in Enterprise Manager Online Help for instructions

To propagate the configuration to new cluster members in OracleAS Web Cache Manager:

  1. In the navigator frame, select Operations > Cache Operations.

    The Cache Operations page appears. The Operation Needed column indicates the caches to which the configuration should be propagated.

  2. Propagate the configuration to all cache cluster members:

    1. Select All caches in the Operate On field.

    2. Select an Interval of Immediate. (No other interval is allowed for propagation.)

    3. Click Propagate.

    (Alternatively, you can propagate the configuration to one cluster member at a time. Click Selected cache in the Operate On field, and then click Propagate.)

    When the operation completes, the Operation Needed column in the Cache Operations page indicates the cluster members that need to be restarted.

  3. Stop and restart all cluster members:

    1. Select All caches in the Operate On field.

    2. Select an Interval to stagger the time that operation begins on the caches, and then click Restart.

    (Alternatively, you can restart one cluster member at a time.) Choose Selected cache in the Operate On field and then click Restart.)

When the operation completes, the Operation Needed column in the Cache Operations page indicates that no operations are needed. The cache cluster is ready to use.

Removing Caches from a Cluster

To remove a cache from a cluster, you must not only make sure that remaining cluster members no longer include that cache in cluster, but that the removed cache no longer considers itself to be part of the cluster.

To remove a cache from a cluster in Application Server Control Console, navigate to Web Cache Home page > Administration tab > Cluster Properties > Members and Properties.


See Also:

"Removing a Cache from a Cluster" in Enterprise Manager Online Help for instructions

The script chgiphost.sh enables you to change the host name or IP address of a computer. If the computer contains a middle-tier instance that is part of OracleAS Web Cache cluster, you must remove the instance from the cache prior to running this script.


See Also:

Oracle Application Server Administrator's Guide for more information about using the chgiphost.sh script

To remove a cache from a cluster in OracleAS Web Cache Manager:

  1. Enter the URL for the OracleAS Web Cache Manager of one of the caches in cluster, but not the cache that you want to remove from the cluster. If prompted, enter the user name and password for the ias_admin or administrator user.

  2. In the navigator frame, select Properties > Clustering.

  3. In the Cluster Members section of the Clustering page, select the cache you want to remove from the cluster and click Delete Selected.

  4. In the OracleAS Web Cache Manager main window, click Apply Changes.

  5. Propagate the change to the other remaining cache cluster members:

    1. In the navigator frame, select Operations > Cache Operations.

    2. Select All caches in the Operate On field.

    3. Select an Interval of Immediate.

    4. Click Propagate.

      The change is propagated to all the remaining cluster members, but not to the removed cluster member.

  6. Restart all cluster members:

    1. In the Cache Operations page, select All caches in the Operate On field.

    2. Select an Interval to stagger the time that operation begins on the caches, and then click Restart.

    All remaining caches in the cluster no longer consider the removed cache to be part of the cluster. However, the removed cache still considers itself to be part of the cluster. To remedy that situation, take the next steps.

  7. Enter the URL for the OracleAS Web Cache Manager of the cache you removed from the cluster. Enter the username and password for the ias_admin or administrator user.

  8. In the navigator frame, select Properties > Clustering.

    The Clustering page appears. The Cluster Members section still shows all members of the cluster.

  9. In the Cluster Members section of the Clustering page, select each cache except the current one, and click Delete Selected. Repeat until only the current cache remains in the Cluster Members list.

  10. In the OracleAS Web Cache Manager main window, click Apply Changes.

  11. In the navigator frame, select Operations > Cache Operations.

  12. Select the cache and click Restart.

Configuring Administration and Invalidation-Only Clusters

You can configure a cluster that supports propagating the configuration and invalidation requests across all cache cluster members, but that does not forward requests between cache cluster members. That is, in processing requests, each cluster member acts as an individual cache and does not request objects from its peer cluster members. However, configuration changes and invalidation requests can be propagated to cluster members.

You can use this configuration to simplify administration of many caches. It may be needed in a cluster where members are separated by a firewall. For example, you can have a cluster where two caches are located on either side of a firewall that separates the intranet from Internet. (The network settings of such a setup—of sending Internet traffic to one cache and intranet traffic to another—is beyond the scope of this document.)

To manage these caches as a cluster and avoid sharing contents between the caches, take the following steps:

  1. Create a cluster and add members to it as discussed in "Task 1: Configure Cache Cluster Settings" and "Task 2: Add Caches to the Cluster", with the exception noted in the following step.

  2. For each cluster member, set the capacity to 0. (Select Properties > Clustering. Then, select a cluster member and click Edit. In the Edit Cluster Member dialog box, set the Capacity to 0.)

  3. Propagate the configuration to all cluster members, as described in "Task 4: Propagate the Configuration to Cluster Members".

Propagating Configuration Changes to Cache Cluster Members

If you have made changes to the configuration of a cache cluster or if a cache cluster member is unreachable when OracleAS Web Cache tries to propagate the configuration to it, you must propagate the configuration to that cluster member when it is reachable again. Then, you must restart the cache.

OracleAS Web Cache keeps track of the configuration of all cluster members to ensure that all cluster members are using the same version of the configuration. It compares the configuration of the current cache (the cache to which you are connected) to that of the other cluster members.

To check that all cluster members are using the same configuration and to propagate the configuration in Application Server Control Console, navigate to Web Cache Home page > Administration tab > Cluster Properties > Cluster Operations.


See Also:

"Propagate the Configuration to Cluster Members" in Enterprise Manager Online Help for instructions

To check that all cluster members are using the same configuration and to propagate the configuration, if necessary, in OracleAS Web Cache Manager:

  1. In the navigation pane, select Operations > Cache Operations.

    The Cache Operations page appears.

  2. In the Operation Needed column of the table, check whether or not Propagate Configuration is noted for any cluster member.

    Propagate Configuration means that the configuration of the cluster member is different than the configuration of the current cache. You should verify that the configuration of the current cache is the most valid configuration before proceeding with propagation.

    If it is not, connect to the cache with the valid configuration and view the Cache Operations page.

  3. For each cluster member that needs the configuration propagated, select the cache. Then, in the Operate On field, choose Selected cache and click Propagate. (Alternatively, to operate on all caches in the cluster, in the Operate On field, choose All caches. For the Interval, select Immediate, and then click Propagate.)

    OracleAS Web Cache propagates the configuration from the current cache to the selected cluster member. When the operation completes, the Operation Needed column in the Cache Operations page indicates that the cache needs to be restarted.

  4. Restart all cluster members, either individually or all caches:

    • To restart one cluster member, select the cache. Then, in the Operate On field, choose Selected cache and click Restart.

    • To restart all caches in the cluster, in the Operate On field, choose All caches and specify an interval to stagger the times of the operations, and then click Restart.)