Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

Sessioning problem with load balancing

Posted on 2004-08-19
5
Medium Priority
?
1,380 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

Comprehensive Backup Solutions for Microsoft

Acronis protects the complete Microsoft technology stack: Windows Server, Windows PC, laptop and Surface data; Microsoft business applications; Microsoft Hyper-V; Azure VMs; Microsoft Windows Server 2016; Microsoft Exchange 2016 and SQL Server 2016.

Question has a verified solution.

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

Running classic asp applications under Windows Server 2008 R2 (x64) and IIS 7 is not as easy as one may think. It took me a while to figure it out while getting error 8002801d a few times. After you install the OS you will need to install the fol…
Lync server 2013 or Skype for business Backup Service Error ID 4049 – After File Share Migration
In this video you will find out how to export Office 365 mailboxes using the built in eDiscovery tool. Bear in mind that although this method might be useful in some cases, using PST files as Office 365 backup is troublesome in a long run (more on t…
In this video, Percona Solution Engineer Dimitri Vanoverbeke discusses why you want to use at least three nodes in a database cluster. To discuss how Percona Consulting can help with your design and architecture needs for your database and infras…

704 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