4 Replies Latest reply on Oct 19, 2010 2:37 AM by Michal Glowacki

    Infinispan usecase

    Michal Glowacki Novice

      hi,

       

         I want to make a move from JBoss Cache 3 to Infinispan as I am bit tired of "Unable to acquire write lock on Fqn...". This datagrid looks very promising, however I am not sure if I am going to do it right way.

       

      So, I got 2 separate web applications deployed as WARs. They share same java libraries written also by me - common tools for both of them. This java library is the place also where I replace usage of jboss cache for infinispan. This part I believe is fine, however I would like to run infinispan on minimum two servers for better performance. If I just run my jboss those applications will use only 1 instance of infinispan(?). To create cluster with two machines I want to create simple java application which will be running on another machine:

       

      public class Infinispan {

       

      Cache<Integer, Object> cache;

      EmbeddedCacheManager manager;

       

      public Infinispan() throws IOException {
      manager = new DefaultCacheManager("com/scandicbookmakers/jgroups/infinispan.xml");
      String newCacheName = "live_betting_cache";
      cache = manager.getCache(newCacheName);

      public Infinispan() throws IOException {

      manager = new DefaultCacheManager("com/domain/cache/infinispan.xml");

      String newCacheName = "my_cache";

      cache = manager.getCache(newCacheName);

      }

      }

       

      I tried above with simple java applications. I was able to create cache cluster on 2 machines.

       

      Is it enough? Or did I loose the concept somewhere?

        • 1. Re: Infinispan usecase
          Mircea Markus Master
          This part I believe is fine, however I would like to run infinispan on minimum two servers for better performance.

          Not sure what you mean by this. Infinispan in local mode (i.e. single instance) would always be faster than infinspna in replicated/distributed mode - simply because for replicated mode you always do remote calls.

          If I just run my jboss those applications will use only 1 instance of infinispan(?)

          If the application you deploy only creates an DefaultCacheManager this would be a single instance.

          Is it enough? Or did I loose the concept somewhere?

          This should be enough, as you have the cluster formed. Can you please detail a bit on your use case? - why do you need a cluster for?

          1 of 1 people found this helpful
          • 2. Re: Infinispan usecase
            Michal Glowacki Novice

            My idea is to create cluster on two separate machines in LAN - I thought I can take off some stress from primary machine where jboss is running? My experience with jboss cache 3 resulted in idea of cluster But if you say clustering will not speed up the read, then I think I can run in local mode.

            • 3. Re: Infinispan usecase
              Mircea Markus Master

              IMO, for your scenario it would only make sense to use a cluster if: a) the data infinispan holds cannot be held within AS's VM because of its size (dist would be needed for that) or b) you would need some sort of fault tollerane, i.e. if the AS's VM crashes then a restart can be initialized with whatever it had before the crash from the survining node.

              1 of 1 people found this helpful
              • 4. Re: Infinispan usecase
                Michal Glowacki Novice

                thanks for clarification Mircea