6 Replies Latest reply on Nov 21, 2012 11:47 AM by robbert1

    Exact behavior of "distribution" mode (with external load balancer)

    robbert1 Newbie

      Currently i'm evaluating the use of the "distribution" mode for usage in a cluster.

      This cluster is to be load balanced by an external load balancer.

       

      given the following scenario:

      4 server each running the same software in "distribution" mode, (with only 2 holding the session).

      what happends to requests that get send to a server that doesn't hold the session (or its backup)?

      do they simply trigger a remote read of the session object or will this actually fail to read the session?

       

      Note that our external load balancer does support sticky sessions, but that doesn't cover a fail-over scenario to the exact server holding the backup.

      I'm asking this because I'm not exactly clear on if any of the clustering functionality only works with mod_cluster/httpd.

       

      Regards,

      Robbert

        • 1. Re: Exact behavior of "distribution" mode (with external load balancer)
          Wolf-Dieter Fink Master

          You should active the sticky-session in your loadbalancer!

           

          As long as this server works its fine.

          If the server crash the LB will choice another server, assuming that everything is configured correct, you might reach the 'backup' server or not.

          Now it depends to the server version and configuration what happen.

          But in any case the session will be replicated to the server where the request now is

          and

          it will be replicated when necessary that you have at minimum one backup (buddy repl) or as many backups as configured

          1 of 1 people found this helpful
          • 2. Re: Exact behavior of "distribution" mode (with external load balancer)
            Radoslav Husar Master

            Let me explain IIRC how failover works with distribution mode, say we have 2 copies of data (numOwners, or 'owners' in AS7 subsystem):

             

            1. loadbalancer gets a request from a new client without session, according to its LB policy say node A is chosen
            2. session is created on node A and will be always on node A using Infinispan's KeyAffinity service
            3. hash will be calculated and say node B will also have a copy, and be a second owner.
            4. node A is always used because of sticky sessions until server A fails
            5. currently, the LB is not aware who owns a backup, so a node is chosen by LB policy, say C
            6. C doesn't own the data so it will do a remote fetch from B known from the hash function
            7. after request is complete, it will modify jvmRoute (instance-id) for LB to next time failover to B directly

             

            Voila! If your load-balancer supports sticky sessions by the same mechanism i.e. appending the route name after the session, the failover will work with your balancer.

             

            If you are really saying though that you dont have sticky sessions on, that is really bad for performance and general stability. Please enable sticky sessions.

             

            Rado

            • 3. Re: Exact behavior of "distribution" mode (with external load balancer)
              robbert1 Newbie

              In response to Wolf-Dieter Fink

               

              Sorry for not making clear I'm talking about JBossAS7 / EAP6.

              we will use sticky sessions if we go for the "dist-async" mode but I'd still like to know the exact behavior of a server that doesn't hold the session object in its own cache.

               

              You say it will be replicated to whatever server calls for it.

              As nice as that sounds to me, it directly conflicts with the design of a predetermined set of 2 servers based on a hash of the key holding the session object.

              If what you say is right (I sure hope so) it would mean

              1. the session object is now in 3 places
              2. One of the old 2 servers doesn't have it anymore (those being the primary and backup server after server crash)
              3. There are no predetermined servers, and a single server has no idea what server holds what data

               

              ps. I marked your answer as helpful but I'd still like to know "exactly" what happens.

               

              Regards,

               

              Robbert

              • 4. Re: Exact behavior of "distribution" mode (with external load balancer)
                robbert1 Newbie

                Thanks Rado for your very complete anwser.

                 

                It is as I thought than afterall;

                We will need to investigate further into how the specific "jvmRoute (instance-id)" logic can be transferred and interpreted to our specific LB to prevent the session from sticking to the wrong new server.

                 

                Regards,

                 

                Robbert

                • 5. Re: Exact behavior of "distribution" mode (with external load balancer)
                  Radoslav Husar Master

                  Cool!

                   

                  What LB are you using? In-house?

                   

                  PS: disregard the previous version of this post, I see you were replying to a different post now.

                  • 6. Re: Exact behavior of "distribution" mode (with external load balancer)
                    robbert1 Newbie

                    I updated my post to better reflect that as it seems we cross-posted.

                     

                    Thanks again.