Solved

Sticky session

Posted on 2014-11-19
3
255 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
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 28

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

Get proactive database performance tuning online

At Percona’s web store you can order full Percona Database Performance Audit in minutes. Find out the health of your database, and how to improve it. Pay online with a credit card. Improve your database performance now!

Question has a verified solution.

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

During and after that shift to cloud, one area that still poses a struggle for many organizations is what to do with their department file shares.
This article explains the fundamentals of industrial networking which ultimately is the backbone network which is providing communications for process devices like robots and other not so interesting stuff.
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…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
Suggested Courses
Course of the Month9 days, 23 hours left to enroll

623 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