Solved

Sticky session

Posted on 2014-11-19
3
243 Views
Last Modified: 2014-11-26
what  I understands is, sticky session is a session which is  located in the central location of the server so that load balancer can be used for the particular user session in switching between the servers. My question is whether sticky session is same as the cookies.. ? what happens if the server goes down ?  did the sticky session stays...

People who have practical knowledge on this  please reply...

Thank you
0
Comment
Question by:roy_sanu
3 Comments
 
LVL 25

Accepted Solution

by:
dgrafx earned 167 total points
ID: 40455904
For web applications, clustering is a load-balancing technique in which multiple application servers are set up to behave as one big server. Generally this requires replicating HttpSession data across the servers, to ensure that a user's web interactions will continue without interruption regardless of which server handles the next request. Session replication achieves very high reliability, but it incurs an extra performance cost (due to the serializing and deserializing of session data and the extra network traffic required).
In contrast, Sticky Sessions (also called session persistence or sticky persistence) is a load balancing technique in which each session is assigned to a particular server for the duration of the session. This approach doesn't require copying HTTPSession data between servers, so it's very scalable. But if a server goes down, all of its sessions are lost.
In general, the sticky sessions approach is the way to go when possible (that is, when performance is more important than session survival). It represents a much more efficient use of resources ... you are scaling out not up, which is always cheaper. It also means that you don't have to be as careful about what goes into the HTTPSession.

Here is a whole bunch of info: https://support.f5.com/kb/en-us/products/lc_9_x/manuals/product/lc_config_guide_10_1/lc_persist_profiles.html#1184508
0
 
LVL 26

Assisted Solution

by:dpearson
dpearson earned 167 total points
ID: 40456223
Just to augment what dgrafx said which is all correct:

My question is whether sticky session is same as the cookies.. ?

No - cookies are stored in the user's browser.  A session is something that exists on the server.

Also beyond having either session replication or sticky sessions, another option is a hybrid approach.  In that model, the session is always backed by data stored in a database.  If the request is sent to a server, it first checks to see if it has the session in memory and if not loads it from the database.

With this model, if your load balancer supports sticky sessions then you get the performance benefits of sticky sessions (the same server gets all requests and has the session in memory).  However, if the server crashes and the requests need to go to a different server, it will load the session data from the database and proceed.  So then you get failover support as well.  I mention this because it's the approach we take to sessions - seems to give the benefits of both approaches without the weaknesses.

Doug
0
 
LVL 57

Assisted Solution

by:giltjr
giltjr earned 166 total points
ID: 40459477
Although a cookie and a session are two different things, application servers use cookies to know which session object is yours.  If you have a J2EE server they typically use a cookie named JSESSIONID for tracking your session id.

Some load balancer use cookies to track which server your session is currently associated with.

So cookies and sessions are different, but cookies are used to identify your session.
0

Featured Post

3 Use Cases for Connected Systems

Our Dev teams are like yours. They’re continually cranking out code for new features/bugs fixes, testing, deploying, testing some more, responding to production monitoring events and more. It’s complex. So, we thought you’d like to see what’s working for us.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Join Greg Farro and Ethan Banks from Packet Pushers (http://packetpushers.net/podcast/podcasts/pq-show-93-smart-network-monitoring-paessler-sponsored/) and Greg Ross from Paessler (https://www.paessler.com/prtg) for a discussion about smart network …
PRTG Network Monitor lets you monitor your bandwidth usage, so you know who is using up your bandwidth, and what they're using it for.
After creating this article (http://www.experts-exchange.com/articles/23699/Setup-Mikrotik-routers-with-OSPF.html), I decided to make a video (no audio) to show you how to configure the routers and run some trace routes and pings between the 7 sites…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…

777 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question