0
votes

With Ignite Native Persistence enabled, is there a way to know if the query result is being fetched from cache or disk?

I am using Apache Ignite 2.7.5 with 2 nodes running in PARTITIONED mode with the following configuration at each node.

            <bean class="org.apache.ignite.configuration.DataStorageConfiguration">
                <!-- Redefining the default region's settings -->
                <property name="pageSize" value="#{4 * 1024}"/>
                <!--<property name="writeThrottlingEnabled" value="true"/>-->
                <property name="defaultDataRegionConfiguration">
                    <bean class="org.apache.ignite.configuration.DataRegionConfiguration">
                        <property name="persistenceEnabled" value="true"/>
                        <property name="initialSize" value="#{105L * 1024 * 1024 * 1024}"/>
                        <property name="name" value="Default_Region"/>
                        <!--Setting the size of the default region to 4GB. -->
                        <property name="maxSize" value="#{120L * 1024 * 1024 * 1024}"/>
                        <property name="checkpointPageBufferSize"
                                  value="#{4096L * 1024 * 1024}"/>
                        <!--<property name="pageEvictionMode" value="RANDOM_2_LRU"/>-->
                    </bean>
                </property>
            </bean>
1

1 Answers

2
votes

All data is stored in so-called pages located in off-heap memory, it could be either a RAM or a disk, though, for the latter Ignite needs to load pages to the off-heap first, and it doesn't perform reads from a disk directly. On-heap memory is required for data processing, like merging data sets for an SQL query, processing communication requests, and so on.

There is no solid way of detecting if a piece of required data was already preloaded into RAM, though there are some metrics that could help you to see what's happening to the cluster in general. I.e. how often page eviction happens and so on.

You might want to check the following metrics for a data region.

These three give an estimate of the data size loaded to a data region:

  • TotalAllocatedPages
  • PagesFillFactor
  • EmptyDataPages

When persistence is enabled, these provide information on how intensively we use disk for reads (smaller is better): ​

  • PagesReplaceRate
  • PagesRead
  • PagesReplaced

Some implementation details that might be useful: Ignite Durable Memory, Ignite Persistent Store - under the hood