Solved

Sticky session

Posted on 2014-11-19
3
234 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 24

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

Highfive Gives IT Their Time Back

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

Introduction This article is the second of three articles that explain why and how the Experts Exchange QA Team does test automation for our web site. This article covers the basic installation and configuration of the test automation tools used by…
When it comes to showing a 404 error page to your visitors, you do not want that generic page to show, and you especially do not want your hosting provider’s ad error page to show either. In this article, I will show you how to enable the custom 40…
Viewers will learn how to connect to a wireless network using the network security key. They will also learn how to access the IP address and DNS server for connections that must be done manually. After setting up a router, find the network security…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

707 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

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now