Infinispan Cache Number of Entries

From NovaOrdis Knowledge Base
Revision as of 20:26, 25 October 2016 by Ovidiu (talk | contribs) (→‎Overview)
Jump to navigation Jump to search

Internal

Overview

The number of entries is a read-only Infinispan cache metric representing the current number of cache entries (key/value pairs) maintained by the cache node being interrogated. Note that for distributed or replicated caches, the node may maintain "original" entries and duplicated entries. The value of "number of entries" accounts for all entries, either original or duplicates, physically present on the node that is being interrogated. The value has no bearing on the total number of distinct entries in the logical cache, which is exposed as "clusterwide number of entries". Unlike the "clusterwide number of entries", the "number of entries" seems to be synchronized across the cluster on each write.

The number of entries is maintain as an Integer. May return null if the cache is not started.

For configuration details see:

owners

The metric is available as JMX and CLI attributes:

JDG 6 JMX container level and individual JDG 6 CLI container level and individual
JDG 7 JMX container level and individual JDG 7 CLI container level and individual

Clusterwide Number of Entries

The clusterwide number of entries is a read-only Infinispan cache metric representing the cluster-wide number of distinct entries in the logical cache maintained by the cluster being interrogated. May return null if the cache is not started. The metrics is different than the "number of entires" metric.


There are cases cases where clusterwide-number-of-entries is 0 for a non-zero number of keys, and owners=2. In general, it seems it is not continuously updated under load. The metric seems to "catch up" as more keys are added, so it does not seem to be very reliable.

For configuration details see:

owners

Relationship Between the Number of Entries and Clusterwide Number of Entries

For a distributed cache, this relationship holds true (provided that clusterwide number of entries is correctly syncrhonized across the cluster and it has an updated value):


number-of-entries[1] + number-of-entries[2] + .. number-of-entries[n] = clusterwide-number-of-entries * owners
                            

where the cluster consists in 1 ... n nodes.