expiry policy

classic Classic list List threaded Threaded
2 messages Options
narges saleh narges saleh
Reply | Threaded
Open this post in threaded view
|

expiry policy

Hi All,

I understand that expiry policy applies to off heap cache along with the persistent durable storage. Is there a way to apply different expiry policy to cache and disk? I need to retain the data on disk a lot longer than I can afford in cache.

thanks.
akorensh akorensh
Reply | Threaded
Open this post in threaded view
|

Re: expiry policy

This post was updated on .
Hi,
  Expiry policies are designed to set the lifetime of an entry.
  If you configure your data region to have a small max size, and load more
data than the max size of the data region, then most of your entries will be
kept in persistent storage.
 After configuring your data region, set your expiry policy to be as needed,
and your entries will be deleted when necessary.

 see:
https://www.gridgain.com/docs/latest/developers-guide/memory-configuration/data-regions
 
https://ignite.apache.org/releases/latest/javadoc/org/apache/ignite/configuration/DataRegionConfiguration.html#setMaxSize-long-

 use the corresponding messages in the log to determine how much data is in memory and what % is on disk only.


In this example, the data region is large enough to accommodate all current entries in memory
see:  maxCfg=3247MB, usedRam=30MB,

When the amount of memory is not large enough for all entries, you would
see that "Ignite persistence" is larger than maxCfg

    ^-- Off-heap memory [used=30MB, free=99.17%, allocated=3447MB]
    ^--   default region [type=default, persistence=true, lazyAlloc=true,
      ...  initCfg=256MB, maxCfg=3247MB, usedRam=30MB, freeRam=99.07%,
allocRam=3247MB, allocTotal=29MB]
    ^-- Ignite persistence [used=29MB]



To understand what happens when Ignite hits the limits of a data region see
"page replacement" section here:
https://ignite.apache.org/docs/latest/memory-configuration/eviction-policies


Thanks, Alex



--
Sent from: http://apache-ignite-users.70518.x6.nabble.com/