3 Replies Latest reply on Jun 26, 2014 8:50 AM by Roman Jurkov

    sticky session implementation

    Roman Jurkov Newbie

      Hello,

       

      i was looking deeper into how sticky sessions are implemented, and currently application has a responsibility to bake right cookie with node name at the end of the cookie hash, which could be abstracted, and transferred to mod_cluster as a separate cookie all together, which would i think speed up a lookup, since mod_cluster doesn't have to anymore parse out cookie name, and cookie also would be application independent, and in fact, application doesn't have to have any session mechanism at all.

       

      please let me know your thoughts.

        • 1. Re: sticky session implementation
          Jean-Frederic Clere Master

          So you want mod_cluster to add a cookie with the node name (or a hash) to make the routing, correct?

           

          The actual way of mod_cluster is a kind of "common" way for doing sticky sessions (and group failover) for example mod_jk and mod_proxy_balancer are doing the same.

          • 2. Re: sticky session implementation
            Radoslav Husar Master

            which would i think speed up a lookup, since mod_cluster doesn't have to anymore parse out cookie name

            You mean it would eliminate call to

             

            route = strchr(sessionid, '.')
            

             

            but instead add a whole new cookie that would have to be parsed out from the HTTP request? Sorry, but I don't see the performance improvement, but degradation: there is more parsing from the request and the HTTP request would get bigger by the extra cookie name length.


            Nevertheless, all of these are IMHO negligible performance-wise, it's better to stay "standard" and keep doing what others are doing.

            • 3. Re: sticky session implementation
              Roman Jurkov Newbie

              Rado,

               

              i've been looking at different implementations, and actually i cannot find this being a standard, for example AWS allows you to either create a load balancer cookie, or use application cookie, and application cookie does not need to have a route in it, so application is not aware of a cluster at all, and f5 for example not using this methodology all together. also mod_proxy_balancer is not appending anything to existing cookie, nor parsing it, it just sets a routeid cookie.

               

              i would say that mod_cluster is actually not following "standards" in this case, and making clustering implementation very application specific, however we could be trying to make it more independent from application ( i realize it is dynamic clustering, so we can't make it completely independent ).