The number of enties is counted local on this server and may not reflect the total number. Also it might change everytime you look to.
If you have a replicated cache it will be the same on all nodes.
Does that makes sense to you?
Then if i have 100 entries and maintaining a JBoss distributed cache with 2 HotRod servers with owner = 1,
then Server1 will be having 50 entries(say)
Server2 will be having 50 entries(say)
In server 1 stats,
Number of entries = 50
Total Number of Entries = 100
stores = may vary according to number of put operation.
In case of replicated cache, current Number of Entries will be always equal to total Number of entries.
Am i right in my understanding.Please correct me if i am wrong?????
That's sound correct to me, the balance might vary because of the calculated hash
I am using jbossData grid -6.2.1.
<distributed-cache mode="SYNC" name="circuitgraphcache" owners="2" remote-timeout="30000" segments="30" start="EAGER">
<locking acquire-timeout="30000" concurrency-level="1000" isolation="READ_COMMITTED" striping="false"/>
<eviction max-entries="5" strategy="LRU"/>
For the above configuration, my cache.stat().getStatsMap() method shows output in client
Cache Name :circuitgraphcache
circuitgraphcache size = :: 5
hits :: 39
currentNumberOfEntries :: 4
totalBytesRead :: 90064911
timeSinceStart :: 2366
totalNumberOfEntries :: 11
totalBytesWritten :: 30477556
removeMisses :: 0
removeHits :: 0
retrievals :: 50
stores :: 11
misses :: 11
I am using two hotrod servers with above configuration same in both servers. Even though cache size not increasing above 5(max-entries =5 as i specified). i couldn't still understand the value of currentNumber of entries,Total no. of entries.
What i expect in my case is ,
1)cache size(am using cache.keySet(0.size()) should be always equal to current number of entries.
2) Since distributed cache with owners=2 , 5 entries will be available in both server caches( making it behave like a replicated cache).
So total number of entries should be equal twice current number of entries.
Am i right with my explanation as per previous logic which i told.
Can you explain me why am i getting different output than i expect?
Which attribute should i check to know the exact number of entries in the remote distributed-cache as a whole?
Thanks & Regards,
Please go thru this interface definition to understand what each of them stats mean : ServerStatistics (Infinispan Distribution 7.0.3.Final API) . Disable or remove the Evinction entry for your tests. The max-entries entries here refers to the maximum entries that needs to be held by the cache container but the each segment can carry far less and based on the current design the eviction happens per segment. So you might see a situation that you are never hitting the max-entries limit.
More details below at : 2.4.1 and 2.4.3