Solved

Sessioning problem with load balancing

Posted on 2004-08-19
5
1,377 Views
Last Modified: 2011-10-03
Hi,
I have two web servers running under a load balancer. They are Windows 2003 servers, run IIS 6.0, and host ASPX pages (.NET version 1.1). My problem is that whenever the load balancer switches from server A to B or vice versa, a new session is created and the Session_Start method fires. This results in the existing session data being lost. Both servers have SQLSessioning enabled, and have the same web.config & machine.config files.

Can somebody help me out in solving this problem?

Thanks,
Karun.
0
Comment
Question by:KarunSK
[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
5 Comments
 
LVL 34

Expert Comment

by:Dave_Dietz
ID: 11849246
What are you using to load balance the servers?

The behavior you describe is exaclty as expected if you don't have some sort of affinity set for sessions.  In WLBS you would set the Affinity.  Some other hardware balancers use different terms for roughly the same meaning (Cisco uses the term Sticky if I remember correctly).  Any decent load balancing technology should be able to handle this since SSL will also break if you switch endpoints in the middle of a session.

Dave Dietz
0
 
LVL 4

Expert Comment

by:philippe_leybaert
ID: 11851685
You should store session state on one of the 2 servers (or a seperate server), and change your session management in web.config to use the session state server like this:

<sessionState mode="StateServer"
  stateConnectionString="tcpip=MYSTATESERVER:42424" />

This way, all your load balanced servers will use the same session database, stored at "MYSTATESERVER". Just make sure the "ASP.NET State Service" is running on "MYSTATESERVER"
0
 
LVL 6

Author Comment

by:KarunSK
ID: 11852664
Thanks for the replies. I have SQLSessioning enabled. The web.config entry is something like this:

<sessionState mode="SQLServer" sqlConnectionString="Server=[servername];UID=[user];PWD=[password]" cookieless="false" timeout="720"/>

Since the same web.config is present in both servers, they both hit the same SQL server for sessioning.

Any more ideas?

Thanks a lot,
Karun.
0
 
LVL 6

Author Comment

by:KarunSK
ID: 11905219
Hi,

I got the solution! This problem arose because the web site ID on both the web servers was different. Once I edited the IIS metadata (an XML file under c:\windows\system32\inetsrv for IIS 6.0) and changed the web site ID so that the numbers matched on both web servers, I no more encountered this problem.
0
 

Accepted Solution

by:
RomMod earned 0 total points
ID: 11909966
The question has been PAQ'd and the 500 points have been refunded.
RomMod
Community Support Moderator
0

Featured Post

What is SQL Server and how does it work?

The purpose of this paper is to provide you background on SQL Server. It’s your self-study guide for learning fundamentals. It includes both the history of SQL and its technical basics. Concepts and definitions will form the solid foundation of your future DBA expertise.

Question has a verified solution.

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

Logparser is the smartest tool I have ever used in parsing IIS log files and there are many interesting things I wanted to share with everyone one of the  real-world  scenario from my current project. Let's get started with  scenario - How do w…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
I've attached the XLSM Excel spreadsheet I used in the video and also text files containing the macros used below. https://filedb.experts-exchange.com/incoming/2017/03_w12/1151775/Permutations.txt https://filedb.experts-exchange.com/incoming/201…

749 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