473,406 Members | 2,894 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,406 software developers and data experts.

Session varibles, loan balancing, and sticky sessions

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
4 4936
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Jeff | last post by:
We're running a fairly busy and complex e-commerce website. It's an online retailer. We utilize MySQL for most of our site-based dynamic data, and then we use Oracle to access inventory and place...
3
by: Max | last post by:
Frankly, i need session variables to persist regardless of load balancing. My hoster says save them in files, yuk. Are there any other thoughts The problem is that the session variables are lost...
8
by: Anthony P. Mancini | last post by:
I'm working on a proof of concept that will ultimately be deployed on a load balancer. For the sake of a preliminary demonstration I created a C# object and marked it's attributes as Public...
4
by: Daniel | last post by:
Hi I am having a problem sharing session between SSL and non-SSL asp.net pages I have F5 BigIP with sticky sessions working fine, but the problem is tha sticky session applies at the port level...
31
by: Harry Simpson | last post by:
I've come from the old ASP camp where session variables were not used. When i started using ASP.NET in 2001, I started using them again because it was ok from what I'd read. I've been merrily...
8
by: bdeviled | last post by:
I am deploying to a web environment that uses load balancing and to insure that sessions persist across servers, the environment uses SQL to manage sessions. The machine.config file determines how...
6
by: Andrew Robinson | last post by:
I am running two servers with a hardware network load balancing device. I know that to share session information between the two servers I need to implement some type of SQL based session...
2
by: gavkel | last post by:
We are building a system with ASP.NET. Currently running through the optimisation of the system using different caching mechanisms. Were using Linux LBS for load balancing - this does not employ...
1
by: Vidyadhar Joshi | last post by:
I have the following scenario in a true load balanced environment (without sticky sessions): There are 2 ASPX pages. I want to pass an object from the first page to the second page. On the...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.