In order to obtain maximum benefit from distributed hybrid caching mode, it is important to set the following attributes correctly:
Set the size of each item cache that participates in distributed hybrid caching to the maximum number of items. This must be done on each repository instance, on all servers.
Set the GSACacheServerManager’s
defaultItemCacheSize
property to the maximum number of items that use distributed hybrid caching across all client servers. This can be expressed by the following formula:item-cache-size *
num-clients
[
+ item-cache-size *
num-clients
]...
For example, a site might be set up as follows:
The item descriptor
user
in the ProfileAdapterRepository is set todistributedHybrid
caching mode.The site has 10 servers in the page serving cluster and 5 servers in the agent cluster, and they all require access to
user
items; thus, each server must have an instance of the ProfileAdapterRepository.The number of stored
user
items is currently just over 700. Allowing for future growth, each instance of ProfileAdapterRepository has itsuser
cache size set to 1000. This ensures that all user caches have the capacity to store all potentialuser
items.
If no other item descriptors specify distributed hybrid caching, the GSACacheServerManager should set defaultItemCacheSize
to 15 thousand. With this setting, it can keep track of all the user
items that might be cached across all servers.
Setting the item cache size or defaultItemCacheSize
too low is liable to incur increased network activity as follows:
Insufficient item cache capacity: For each new item that is loaded into the cache, an old item must be unloaded; each action requires a separate call to the GSACacheServerManager to update its routing information.
defaultItemCacheSize is less than the total number of cached (distributed hybrid) items on all servers: For each newly cached item, the GSACacheServerManager must unload routing information for another (older) cached item. As a result, routing information is liable to be missing for some cached items; attempts to access those items requires an invalidation message to be broadcast to all servers, whether or not they cache the item. This behavior is similar to Distributed TCP Caching.
Overall, the additional network activity can cause a slowdown in site performance that significantly overshadows the benefit of real-time updates. In general, if memory is limited, it is best to limit usage of distributed hybrid caching to item types that store a relatively small number of items, in order to minimize network overhead.