11 Replies Latest reply on Sep 26, 2012 9:41 AM by Galder Zamarreño

    Hotrod server - local cache

    Nag Ch Newbie

      Hi,

       

      We have done load testing using HotRod server and hot server client.

       

      When I run hot rod client on the same machine as hot rod server is then performance is good

       

      But when  I run hot rod client on different machine   cache gets are 50% slower. 

       

      Is that as designed?

       

      Is there any way I can use local cache and hot rod server client. If cache is not in local and then use hot rod client.

       

      The reason we are using hotrod sever/client is because we have multiple applications uses same cache and want centralized cache so that in case of one app updates the cache other app should get updated data.

       

       

      Thank you

        • 1. Re: Hotrod server - local cache
          Mircea Markus Master

          When I run hot rod client on the same machine as hot rod server is then performance is good

           

          But when  I run hot rod client on different machine   cache gets are 50% slower.

          The only reason I can think of is the network latency. Try to play with the socket buffers a bit?

           

           

          Is there any way I can use local cache and hot rod server client. If cache is not in local and then use hot rod client.

          That would be triky as data written through hotrod can not be read through a direct cache.

           

          The reason we are using hotrod sever/client is because we have multiple applications uses same cache and want centralized cache so that in case of one app updates the cache other app should get updated data.

          the deployment makes sense. You might even want to use a cluster of caches as HotRod can work with that very nice.

          • 2. Re: Hotrod server - local cache
            Nag Ch Newbie

            I am not sure I understand your response. Can you please explain  little bit more.

             

            I have multiple hot rod clients running on two machines. I have  setup two hotrod servers on machine 1, machine 2 and both are clustered.

             

            How do I force  clients on machine 1 points to only machine 1 hot rod server and clients on machine 2 points to hotrod server on machine 2?

            And at the same time I want both hotrod servers to be in the cluster .  If server1  goes down clients on machine 1 points  to hotrodserver2.

             

            If I have clients on machine 1 goes to machine 2 hot rod server performance is down by 50%.

             

            .Also ,  I noticed that L1 cache in infinispan distrubution mode? How does it work hot rod server and client mode?   Whats L1 in that case ?

             

             

            Thank you

            • 3. Re: Hotrod server - local cache
              Mircea Markus Master

              I have multiple hot rod clients running on two machines. I have  setup two hotrod servers on machine 1, machine 2 and both are clustered.

               

              How do I force  clients on machine 1 points to only machine 1 hot rod server and clients on machine 2 points to hotrod server on machine 2?

              And at the same time I want both hotrod servers to be in the cluster .  If server1  goes down clients on machine 1 points  to hotrodserver2.

              So you'd want to have the client that is on machine A to only access the server on machine A?

              that's not possible I'm afraid, as once a client connects to the cluster it updates its server list dinamically and balances requests between all available servers.

              Have you measured to see where the time is spent though?

              • 4. Re: Hotrod server - local cache
                Nag Ch Newbie

                I want client on Machine A look at server on Machine A  first if the data is not there look Machine B. Machine Both A and B are  in cluster.

                 

                Client A has sever list Machine A and Client B has server list Machine B.   If machine A goes down it should go to Machine B.

                 

                I didn't measure the time where its spent.

                 

                How L1 cache works  in hotrod client server distributed mode?

                 

                Thank you.

                 

                 

                 

                 

                 

                 

                • 5. Re: Hotrod server - local cache
                  Mircea Markus Master

                  I want client on Machine A look at server on Machine A  first if the data is not there look Machine B. Machine Both A and B are  in cluster.

                  The java hotrod client is aware of how data is distributed on the servers, i.e. it knows exactly on which node the data is places. In other words it always go to the machine which contains the data.

                  How L1 cache works  in hotrod client server distributed mode?

                  If you're using the java hotrod client then you don't need to use L1 for the above mentioned reason.

                  • 6. Re: Hotrod server - local cache
                    Nag Ch Newbie

                    Can you please help me understanding when we can use L1 cache or near cache in distributed mode?

                     

                    Is any one using hotrod client in production yet?

                     

                    If I want to do above what cache mode should I use? 

                     

                    Thank you.

                    • 7. Re: Hotrod server - local cache
                      Nag Ch Newbie

                      Can any one help me understanding this?

                      • 8. Re: Hotrod server - local cache
                        Mircea Markus Master

                        Can you please help me understanding when we can use L1 cache or near cache in distributed mode?

                        L1 caching is described at large here: https://docs.jboss.org/author/display/ISPN/Clustering+modes#Clusteringmodes-L1Caching

                        If you have a more specific question that is not covered there happy to help.

                         

                        Is any one using hotrod client in production yet?

                        yes[1], it's also part of our professional support offering[2].

                        [1] https://community.jboss.org/message/606145#606145

                        [2] http://www.redhat.com/products/jbossenterprisemiddleware/data-grid/

                         

                        If I want to do above what cache mode should I use?

                        If your cluster is small (e.g. 2-3 nodes) you might want to try replication. otherwise generally it should be distribution.

                        • 9. Re: Hotrod server - local cache
                          Nag Ch Newbie

                          Thank you . Here is my requirement. I have read all docs and forum questions but I was not clear on which architecture to use.

                           

                          We have  some applictions running on Weblogic and some running on tomcat. 

                           

                          Both apps running on weblogic and tomcat  updates and load data. Currently we have local caches using Ehcache.  The issue is when app in weblogic updates the data  app in tomcat doesn't know that and vice versa. Our permanent data store is database.

                           

                          Now I am looking for a solution to have common cache and playing around different clustring modes.

                           

                          I am trying to figured it out which architecture works? 

                           

                          1) Create centralize cache  and all apps talk to one cache sever ( we can have two infinispan servers and form the cluster) by using HR server client.

                             In this case I can't use local cache because HR client figured it out   where the key is . it looks like which is same for all distribution modes , correct?

                              So which is causing HR client going to different server on different machine.

                           

                          We are concerned about performance hit  when HR client going to sever on different machines.

                           

                          2) Create  Infinispan embedded in weblogic and tomcat  and all form the cluster.

                               In this case can I use L1 cache? This is going to be lot of nodes in the cluster as well.

                           

                          3) Are there any other architecture which is best suited for my scenario?

                           

                          4) Is the HR Client always uses RoundRobin strategy ?

                           

                          5)  When I specify L1 enabled= true  when using two infinispam severs which are clustered and all HR clients, will  L1 setting ignored completely?

                           

                           

                           

                          Thanks

                           

                           

                           

                           

                           

                           

                           

                           

                           

                          • 10. Re: Hotrod server - local cache
                            Nag Ch Newbie

                            Can you please let me know if you have any ideas?

                            • 11. Re: Hotrod server - local cache
                              Galder Zamarreño Master

                              The advantages of server vs embedded and viceversa are explained in https://docs.jboss.org/author/x/2AU5

                               

                              L1 is independent of the mode, it's more to do with distribution mode.

                               

                              We do not yet support near cache or L1 cache for Infinsipan servers natively, but can be implemented using JMS.

                               

                              HR client load balancing depends on the cache mode of the cluster. RR for replicated cache, intelligent mode based on key location resolution for distributed caches.