Configure cache replication

After you have enabled cache replication, you need to further configure it. Select the Enable cache replication link on the Dynamic Caching Services configuration panel to get into the cache replication configuration. Figure 14-23 is an example for Trade3Server1.

The advanced replication settings include fields for choosing the initial replicator entry that connects to the replicator domains. As an alternative, you can specify the IP addresses and ports (in the form address:port) for connections to replicators outside of the cell that the server is administered under. By default, if a replicator is defined on the server you are configuring, that server is the one chosen for cache replication. The replicator acts as a broker and distributes messages to the cluster.

Important: When adding a new server into an already existing cluster, also add the new server into the internal replication domain.

Figure 14-23 Cache replication configuration

These are the Enable cache replication configuration options: Internal messaging server

Specifies a domain from which your data is replicated. You can choose any of the replicators defined under that domain. You can use the default domain or choose one from the drop-down menu. In our caching scenarios we configure replicators to be local to the server, for example a replicator for Trade3Server1 is Trade3Server1. Runtime mode

Specifies the global sharing policy for this server. The following settings are available: Push and Pull

In Push and Pull mode, cache entries are shared between appservers on demand. When an application server generates a cache entry, it broadcasts the cache ID of the created entry to all cooperating application servers. Each server then knows whether an entry exists for any given cache ID and for a given request for that entry, the application server knows whether to generate the entry or pull it from somewhere else. These entries cannot store non-serializable data.

In the scenario shown in Figure 14-24, Trade3Server1 serves the cacheable/shareable object. It stores it in the Trade3Server1 cache. In addition, it also acts as a broker and sends a cache ID to the other servers in the cluster (steps An). When Trade3Server3 receives a request for this published cache ID, it uses the cache ID to retrieve the object from the Trade3Server1 cache (steps Bn).

Figure 14-24 Pull and Push cache replication

An advantage of the Push and Pull option is that the content is distributed on demand. This has a positive effect on the total number of objects in the cache.

A small disadvantage is that retrieving the content from the remote cache can take longer comparing to the local cache. However, under normal circumstances it is significantly faster than re-generating the content. Push only

In Push only mode, the cache ID and cache content are automatically distributed to the dynamic caches in other appservers or cooperating JVMs. Each cache has a copy of the entry at the time it is created. These entries cannot store non-serializable data.

In the scenario shown in Figure 14-25, Trade3Server1 serves the cacheable/shareable object. It stores it in the Trade3Server1 cache and it also acts as a broker and sends the cache ID and the content to other servers in the cluster (steps An). When Trade3Server3 receives a request for this cache ID, it retrieves the object from its own cache (steps Bn).

Figure 14-25 Push only cache replication

An advantage of the Push option is that all caches are synchronized, so even when Trade3Server1 crashes, Trade3Server3 does not need to regenerate the object again.

However, in the case when the total size of cached object is very high, synchronizing all objects can have a performance impact. Pull only

In Pull only mode, cache entries are shared between appservers on demand. If an application server gets a cache miss for an object, it queries the cooperating application servers to see if they have the object. If no application server has a cached copy of the object, the original application server executes the request and generates the object. These entries cannot store non-serializable data.

In the scenario shown in Figure 14-26, Trade3Server1 gets a request for an object which is not in the Trade3Server1 local cache. It queries both Trade3Server2 and Trade3Server3 for this object, but none of them has the object in the cache. Therefore, Trade3Server1 executes the request and generates the object, which is cached in Trade3Server1's local cache (steps An). Then Trade3Server3 receives a request for the same object and queries the cooperating appservers. This time the object is found in Trade3Server1's cache (steps Bn).

Figure 14-26 Pull only cache replication Not Shared

In Not Shared mode, cache entries are not shared among different appservers.

The default setting for a non-clustered environment is Not Shared. When enabling replication, the default value is Push only.

Note To summarize the sharing policy, it is important to understand that the "push only" mode is good for workloads with a high probability of other clusters handling cache hits, "push and pull" is good for unknown or variable probability of cross-cluster cache hits, and "pull only" mode is good for low probability cache hits across the cluster.

Push frequency

Specifies the time in seconds to wait before pushing new or modified cache entries to other servers. A value of 0 (zero) means send immediately.

This is used by the dynamic cache service to provide a batch update option. Specifically, for the Push or Push and Pull options, the dynamic cache broadcasts the update asynchronously, based on a timed interval rather than sending them immediately. However, invalidators are sent immediately. Distribution of invalidations addresses the issue of stale data residing in a cluster.

Setting this property to a value greater than 0 (zero) causes a "batch" push of all cache entries that are created or modified during the time period.

  Prev | Home | Next

 

WebSphere is a trademark of the IBM Corporation in the United States, other countries, or both.

 

IBM is a trademark of the IBM Corporation in the United States, other countries, or both.