Understanding the cache data report
Clicking Download on the Server Tools Cache Info screen downloads a CSV-formatted file containing information on the current state of the server cache.
In looking at the cache data provided in the downloaded report, Guidewire recommends that you first calculate the cache miss ratio around the time of the performance degradation. The cache miss ratio is the ratio of (misses) / (misses + hits).
The cache miss ratio is a useful metric in that it normalizes the cache values. For example, suppose that you have the following hit and miss cache values that you use to calculate each individual cache miss ratio.
Timestamp |
# cache misses |
# cache hits |
Cache miss ratio |
|---|---|---|---|
Time 1 |
12345 |
2345 |
12345 / (12345 + 2345) = 0.8404 |
Time 2 |
1234 |
23456 |
1234 / (1234 + 23456) = 0.4998 |
The calculation of the cache miss ratio enables you to compare the data in way that is not possible by simply examining the raw data.
High miss ratio
If the miss ratio is high, it is very likely that the performance issue involves the cache. Thus, you need to look at the reasons for the cache misses, especially the following:
- Number of misses because item was evicted when cache was full
- Number of misses because item was evicted due to reaping
If the number of misses is high due to the cache being full, you can try increasing the size of the cache and observing the result. However, keep in mind that the cache uses the heap. Thus, increasing the size of the cache can potentially reduce the amount of heap memory available for other computations.
If the number of cache misses is high due to reaping, you can try increasing the reaping time and observing the result. Another approach would be to examine ways to reduce the time since the last access of the cache objects. For example, how long does it take to reuse objects that have already been fetched from the database? Is it possible to hold onto the objects without having to fetch the objects again from the database?
Cache misses and hits
The cache miss count and the cache miss ratio are probably the most important data points in the download cache data report. Essentially, the more cache hits the better, as it means the cache was able to service that many requests.
Each cache miss is expensive. It means that the looked-for object was not in the cache. Regardless of the hit count, a high miss count can indicate a problem with the cache. However, keep in mind that the miss count is relative. A cache miss can occur simply because it is the first time a request is made to the cache for an object. Thus, the object is not in the cache. A cache miss can also occur as the sought-after object may have already been evicted from the cache. The downloaded cache report provides data on the various reasons for object eviction from the cache.
Using the assumption that there is a constant cost for each cache miss, it is possible to compare the miss counts directly. The cost of a cache hit is essentially zero, or very, very small compared with the cost of a cache miss. A cache miss may take a 10 millisecond trip to the database to access the data whereas a cache hit is essentially zero time.
