1 Reply Latest reply on May 27, 2011 12:17 PM by galder.zamarreno

    Questions regarding Hotrod

    ravinderrana

      I've used Infinispan in one of my previous project and till now am very happy with the preformance. Now, i want to try it out on a very high

      traffic system. I've done a basic stress test and I've some questions. I want to use Hotrod server for caching and following are the requirements and doubts:

       

      1. cache objects will be small -> 500 - 1000 bytes

      2. there will be millions of objects -> If i use FileCacheStore then this will mean there will be millions of files in a directory, won't this make cache slow? (I think there's a log(N) access cost for accessing a file in a folder with N entries, please correct me if am wrong)

      3. I want a non-transactional cache -> Will hotrod client still use a lock in order to assure operation atomicity?

      4. Does Hotrod server have the concept of L1 and L2 caches?

       

      Following is my configuration file:

       

      <?xml version="1.0" encoding="UTF-8"?>

      <infinispan>

        <namedCache name="TestCache">

             <loaders shared="false">

            <loader class="org.infinispan.loaders.file.FileCacheStore" fetchPersistentState="true" ignoreModifications="false" purgeOnStartup="true">

              <properties>

                <property name="location" value="/home/rana/infinispan_cache/"/>

              </properties>

              <!-- write-behind configuration starts here -->

              <async enabled="true" threadPoolSize="10"/>

              <!-- write-behind configuration ends here -->

            </loader>

          </loaders>

        </namedCache>

      </infinispan>

       

      The client-side code to access the cache is:

      CacheContainer cacheManager = new RemoteCacheManager("localhost", 11222);

      cacheManager.start();

      Cache<String, UserObj> cache = cacheManager.getCache("TestCache");

       

      Will this create a non-transactional cache? Anything that am missing in configuration or code that can help improve the performance?

       

      Best Regards,

      Rana

        • 1. Re: Questions regarding Hotrod
          galder.zamarreno

          Re 2. If latency to the file cache store is a problem, you could configure the cache store to be asynchronous or write-behind, rather than synchronous or write through. There's a chapter on that on our wikis.

           

          Re 3. Yeah, locks still used on a per operation basis.

           

          Re 4. We don't have L1s yet, but you could implement Cache Listeners on the server side and use JMS to notify your clients and build an L1 that way.

           

          That configuration looks fine and it's non-transactional. You already have the loader configured with write-behind or async communication.