Session affinity

Session affinity is an expression that designates the persistent assignment of a client to a particular server in a load-balanced infrastructure. We use the word session to describe a set of requests performed by a client to a server. When a visitor browses a website, they often visit more than one page: they log in to their account, they add a product to their shopping cart, they check out, and so on. Until they close their web browser (or a tab), all of their subsequent page views are part of a session, which is most of the time stateful: the server conserves data relative to the operations performed during the visit. In our example, that server would remember the contents of the shopping cart and the login credentials.

If at some point during the session the visitor were to switch servers and connect to Server B, they would lose any session information contained on Server A. The visitor would then lose the contents of their shopping cart, as well as their login credentials (they would get logged out):

For that reason, it is of utmost importance to maintain session affinity: in other words, to ensure that a visitor remains assigned to a particular server at all times. The DNS load-balancing method does not ensure session affinity, but fortunately, Nginx will help you achieve it.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
52.14.24.191