We have infinispan cache with config (CustomCacheMaxCount is 100000):
new ConfigurationBuilder().clustering() .partitionHandling().mergePolicy(MergePolicy.REMOVE_ALL) .clustering() .cacheMode(CacheMode.INVALIDATION_SYNC) .statistics().enable() .memory() .maxCount(cacheSettingsHolder.getCustomCacheMaxCount()) .whenFull(EvictionStrategy.REMOVE)
After the last redeployment with some updates we noticed too slow responses. We found out that infinispan does not work properly.
We have no evictions and cluster partitioning.
But we have more misses than hits
And cache size is changing. Growing and decreasing, although it shouldn't decrease because there wasn't any eviction. While L2 cache works just fine.
Any ideas how to find the reason of this behavior and stop this cache from losing entries?
Solution is to use
Cache#putForExternalRead
to prevent cache on other nodes from invalidation after Cache#put