What are Sticky Sessions?

Answer Posted / venky

Sticky sessions work with the load balancer to improve
efficiency of Persistent Sessions in a clustered configuration.

In a clustered configuration, the load balancer sends
requests to multiple backend Resin servers. Each session has
an owning Resin server and a backup Resin server. The load
balancer will send a session's request to the owning server
or to the backup if the owning server is not available. The
association of a session with a backend server is called
"sticky sessions".

Because the load balancing occurs before any interpretation
of the Virtual Host or Web Application, it's a <server>
configuration variable, with the <session-cookie> directive.

Sticky sessions encodes the session cookie with the owning
server. The encoding using a simple prefix value. 'a' refers
to the first server in the cluster, 'b' refers to the second
server, ..., 'z' refers to the 26th server.

So the session cookie JSESSIONID=cnn8x02mPph_4sOKlbn would
go to the third server, 192.168.0.12 in the following
configuration

<cluster>
<srun id="a" host="192.168.0.10" port="6802"/>
<srun id="b" host="192.168.0.11" port="6803"/>
<srun id="c" host="192.168.0.12" port="6803"/>
</cluster>

Is This Answer Correct ?    5 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

What are the parts of an http response?

673


How many types of Cookies are available in ASP.NET?

783


Explain the steps needed to be performed in order to create an animation in xaml?

758


How tooltip is set through code-behind in ASP.NET?

797


What is ashx file in asp.net?

731






8. Why do you want to work here?

1645


Explain how cookies work.

777


Differentiate between Server.Transfer and Response.Redirect with functionality? Why we can choose one over the other?

836


What is preprocessor in .net and type, where it use?

857


What is the syntax for datagrid and specifying columns?

2267


Define a web service in .net?

799


What do you mean by View State and what is its role?

728


Where is the session stored?

824


What is data reader in asp.net?

728


Describe the sequence of action takes place on the server when ASP.NET application starts first time?

823