10 Replies Latest reply on Nov 28, 2012 2:53 PM by Radim Kolář

    Very slow FileCacheStore

    Radim Kolář Newbie

      There must be some error in inf 5.1.6, i did my best to avoid fsynces and writing is still very slow. I guess it still does fsync after each write. 1000 writes takes 76 seconds. Final file is just 41 KB.

       

      <namedCache name="sipdb">

      <loaders passivation="false" shared="false" preload="false">

      <loader class="org.infinispan.loaders.file.FileCacheStore">

         <async enabled="true" modificationQueueSize="100"/>

         <properties>

            <property name="location" value="target/cache"/>

            <property name="fsyncMode" value="periodic"/>

            <property name="fsyncInterval" value="20000"/>

            <property name="streamBufferSize" value="16384"/>

         </properties>

      </loader>

      </loaders>

      </namedCache>

       

      code:

      static void fillCache(int records) {
      Cache <Integer, String> cache = manager.getCache("sipdb");
      for (int i=1;i<=records;i++) {
      cache.put(i, i+"@customer" + RandomStringUtils.randomNumeric(3) + ".sip.ourdomain.net");
      }
      }