Solved

How can I solve the problem of  ASP Session management in Load Balance?

Posted on 2004-09-30
5
584 Views
Last Modified: 2013-12-03
Please any Experts help me to solve the problem of ASP Sesson in Load Balance.
I have developed a Web System by ASP+COM and have user login management in system.
After User login , I have used a lot of session to store the variable (include Key value) .
Now I have encountered one problem , we have to setup two or three server to load balance the system loading.  But after Session stored , it will be in one server's memory . Another page request of the same user get in system, load balance will maybe redirect the page to another server . The Session Fail to maintain and Function fail to work.

Experts have any suggestion?

ps. We have try to maintain the session in load Balance like Local Director , it will set the same session always be in the same server(Maintain by IP) . But this is a bad idea . Cause a lot of user pass through ISP( have the same IP ) . Then a lot of people be affected by one person logout. <:~
0
Comment
Question by:cowcowlin
  • 2
5 Comments
 
LVL 5

Accepted Solution

by:
cristy56 earned 250 total points
Comment Utility
Session state can be easily stored on a different machine.

Original ASP always stored session state on the server machine on which it was created. This architecture didn’t scale well to a Web farm in which every request is potentially handled by a different server. ASP.NET allows each application to specify the machine on which it wants its session state to be stored. You do this by setting the stateConnectionString attribute in the web.config file. In this way, any machine that handles a subsequent call can access the session state stored by a previous call handled by a different machine. Obviously, you now incur the overhead of another network round-trip, so maybe you’d rather set up your load balancer to route subsequent requests to the same machine. You can swap out that machine by simply changing its name in the configuration files of all the clients.

You can also store session state in a SQL Server database.

You can also store session state in SQL Server for better management of large collections. You do this by setting the mode attribute to sqlserver and providing a SQL connection string in the sqlConnectionString attribute. The current setup scripts create a temporary database for holding session state. This provides fast access because the data isn’t written to the slow iron disk, but it also means that the session state won’t survive a crash. If you want that durability and don’t mind paying the performance penalty for it, you can change the database attributes yourself to use a permanent table.

ASP.NET also provides another state collection for data at an application level.

ASP.NET also helps you manage application state, where an application represents a top-level IIS virtual directory and all of its subdirectories. Application-level state is stuff that changes from time to time, so you don’t want to hard code it, but it applies to all users of the application and isn’t tied to an individual user. An example of application state might be the current unadvertised special offer that every page would display. Each application contains one state object named Application, similar in use to the Session object, except that all accesses of the Application object operate on the same data regardless of the user on the other end.


==========================
Cristy
0
 
LVL 31

Assisted Solution

by:alorentz
alorentz earned 250 total points
Comment Utility
0
 
LVL 31

Expert Comment

by:alorentz
Comment Utility
0

Featured Post

Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

Join & Write a Comment

Suggested Solutions

I recently decide that I needed a way to make my pages scream on the net.   While searching around how I can accomplish this I stumbled across a great article that stated "minimize the server requests." I got to thinking, hey, I use more than one…
I have helped a lot of people on EE with their coding sources and have enjoyed near about every minute of it. Sometimes it can get a little tedious but it is always a challenge and the one thing that I always say is:  The Exchange of information …
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …

772 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

Need Help in Real-Time?

Connect with top rated Experts

11 Experts available now in Live!

Get 1:1 Help Now