1 Reply Latest reply on Jan 9, 2014 8:19 AM by mircea.markus

    Overflowing data to disk using max

    cmoen

      Hello community,

       

      I'm a happy new user of Infinispan, but I have a question regarding overflowing data to disk I'm hoping to get some advise on.


      I'd like to use eviction with persistence to overflow "cold" entries to disk.  I believe I can use

       

          <namedCache name="cache">

              <clustering mode="local">

                  <async/>

                  <hash numOwners="1"/>

              </clustering>

              <eviction maxEntries="500000" threadPolicy="DEFAULT" strategy="LIRS"/>

              <persistence passivation="true">

                  <singleFile location="${foobar.home}/data/cache" purgeOnStartup="false"/>

              </persistence>

          </namedCache>

       

      to keep 500,000 entries in memory and overflowing entries to disk.  However, is there a way for me to control the number of entries that can overflow to disk?  I'd like to set a limit on the number of entries to keep on disk to prevent the disk-cache from becoming extremely large, but I haven't found a way to do so.  (I'm fine with pretty much any eviction scheme in the latter case.)

       

      Any advice is appreciated.

       

      Many thanks,

      Christian

        • 1. Re: Overflowing data to disk using max
          mircea.markus

          interesting problem.

          What you can do is set an Expiry time for each entry, and it will be automatically cleaned up after that amount of time from the persistent storage. Or even extend the SingleFileCacheStore with async logic to only keep a fixed number of keys into the storage.