By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
446,266 Members | 1,736 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 446,266 IT Pros & Developers. It's quick & easy.

Session varibles, loan balancing, and sticky sessions

P: n/a
We've encountered a "flaky" situation with a Session variable holding
a data set on load balanced servers; server session with cookies is
set up.

Background:
Session variable holds a dataset.

Dataset is retrieved and updated periodically. Eventually the dataset
is sent to a web service for processing.

In production, the asp.net application is deployed on load balanced
servers, server session using cookies is configured.

Periodically, not always, the dataset does not update in the Session
variable. Then when the dataset is later retrieved, it retains its
origial values, losing updates. No error is encountered.

The problem has only occurred in the load balanced environment. In
general the session state seems to work. It just behaves oddly from
time-to-time when the Session variable is being used to hold a
dataset.

Any ideas on what configuration setting might be missing, and thus
causing the sporadic bad behavior? Appreciate any assistance.
Nov 17 '05 #1
Share this Question
Share on Google+
4 Replies


P: n/a
Did you switch from InProc sessionState to StateServer or SQLServer? If
not, this is the problem.

InProc session state does not work in a balanced environment unless you
enable server affinity. Server affinity indicates that all requests from a
specific IP always go to a specific web server (so server affinity defeats
some of the purpose of load balancing).

Jeff

"DeeAnn" <de***********@suntrust.com> wrote in message
news:2e**************************@posting.google.c om...
We've encountered a "flaky" situation with a Session variable holding
a data set on load balanced servers; server session with cookies is
set up.

Background:
Session variable holds a dataset.

Dataset is retrieved and updated periodically. Eventually the dataset
is sent to a web service for processing.

In production, the asp.net application is deployed on load balanced
servers, server session using cookies is configured.

Periodically, not always, the dataset does not update in the Session
variable. Then when the dataset is later retrieved, it retains its
origial values, losing updates. No error is encountered.

The problem has only occurred in the load balanced environment. In
general the session state seems to work. It just behaves oddly from
time-to-time when the Session variable is being used to hold a
dataset.

Any ideas on what configuration setting might be missing, and thus
causing the sporadic bad behavior? Appreciate any assistance.

Nov 17 '05 #2

P: n/a
DeeAnn,
Jeff is right about having to use server affinity if you want to use InProc
Sessions. I just wanted to mention to keep in mind that InProc session are
somewhat volatile, and are subject to being lost when the asp_net process
decides to recycle itself, which it does on occasion. If you want to ensure
that you session will not be lost, you might want to look into using one of
the other session state management methods.

You can look here for a bit more information:
http://msdn.microsoft.com/library/de...sp12282000.asp

HTH
-Cliff

"Jeff Siver" <js****@nospan.dls.net> wrote in message
news:eW**************@TK2MSFTNGP11.phx.gbl...
Did you switch from InProc sessionState to StateServer or SQLServer? If
not, this is the problem.

InProc session state does not work in a balanced environment unless you
enable server affinity. Server affinity indicates that all requests from a specific IP always go to a specific web server (so server affinity defeats
some of the purpose of load balancing).

Jeff

"DeeAnn" <de***********@suntrust.com> wrote in message
news:2e**************************@posting.google.c om...
We've encountered a "flaky" situation with a Session variable holding
a data set on load balanced servers; server session with cookies is
set up.

Background:
Session variable holds a dataset.

Dataset is retrieved and updated periodically. Eventually the dataset
is sent to a web service for processing.

In production, the asp.net application is deployed on load balanced
servers, server session using cookies is configured.

Periodically, not always, the dataset does not update in the Session
variable. Then when the dataset is later retrieved, it retains its
origial values, losing updates. No error is encountered.

The problem has only occurred in the load balanced environment. In
general the session state seems to work. It just behaves oddly from
time-to-time when the Session variable is being used to hold a
dataset.

Any ideas on what configuration setting might be missing, and thus
causing the sporadic bad behavior? Appreciate any assistance.


Nov 17 '05 #3

P: n/a
We do have server affinity specified and this works for fine for all
our Session variables, and generally for this one as well. However,
with the one tha is storing a dataset, the original dataset is stored
and retrieved fine. It is just sometimes, the dataset is retrieved
(correctly) and stored again but when it is retrieved again, the
updated values are not there. Since the processd the developer used
(there are reasons for this), retrieves the dataset on a server post
(code behind file), makes changes, retrieves the dataset again and
then forwards it to a web service. All this is happening in the same
code routine, so the same server is being used. So, what seems to be
happening in the update of the dataset is not really occurring. It
generally works, and always works outside a load-balanced environment.
Nov 17 '05 #4

P: n/a
If I had to guess, I would say that somewhere you are re-writing the session
out - maybe the garbage collector is running and disposing of an object that
is updating the session state. Or, an object is writing the session out
with the non-updated dataset after the updated dataset has been written out
(but I would have expected this to occur in all environments; not just a
load-balanced environment).

Jeff
"DeeAnn" <de***********@suntrust.com> wrote in message
news:2e**************************@posting.google.c om...
We do have server affinity specified and this works for fine for all
our Session variables, and generally for this one as well. However,
with the one tha is storing a dataset, the original dataset is stored
and retrieved fine. It is just sometimes, the dataset is retrieved
(correctly) and stored again but when it is retrieved again, the
updated values are not there. Since the processd the developer used
(there are reasons for this), retrieves the dataset on a server post
(code behind file), makes changes, retrieves the dataset again and
then forwards it to a web service. All this is happening in the same
code routine, so the same server is being used. So, what seems to be
happening in the update of the dataset is not really occurring. It
generally works, and always works outside a load-balanced environment.

Nov 17 '05 #5

This discussion thread is closed

Replies have been disabled for this discussion.