In the simplest form, you can deploy Web pages that consist only of static HTML pages and images in a multi-server configuration by copying the files to multiple Web servers and then configuring a load balancing mechanism to distribute requests between the Web servers.
As the Web site complexity increases, the difficulty of synchronizing files and configurations between the servers also increases. Dynamic sites require multiple servers to have access to a single database and to share state information among themselves. This article describes how to design multi-server ASP.NET solutions that include databases and sessions.
back to the top
By default, ASP.NET stores session information in the server memory. This configuration is known as in process. Although this configuration provides the best performance possible, you lose the session information if you restart the ASP.NET server. Additionally, in multi-server architectures, a single user’s request can be sent to a different server. A user may start a session at one server, but later requests are sent to a different in-process server. This results in a new session being created for that user and all earlier information that was stored in the session is lost.
ASP.NET provides two solutions for sharing state information between multiple servers: the ASP.NET State Server service, and Microsoft SQL Server. You can use either of these solutions to store state information between server restarts, and to allow users to move between servers during a single session.
For additional information, click the following article numbers to view the articles in the Microsoft Knowledge Base:
You can copy configuration files to servers by using any standard file copy or synchronization method, including DFS, the File Replication service, and Microsoft Application Center 2000. The following batch file will work in environments where each Web server has the virtual server root folder shared as wwwroot$:
XCOPY \\source-server\wwwroot$ \\destination-server#\wwwroot$ /D /E /O /X
When you replicate updated .config files to a Web server, that Web application automatically restarts.
Note If you put assemblies in the Global Assembly Cache, you cannot replicate them by using file synchronization.
back to the top
- Request distribution: Incoming HTTP requests must be distributed among all servers by using a mechanism such as round-robin DNS, Microsoft Application Center 2000, or a third-party load distribution device.
- Log aggregation: Before you process HTTP usage logs, it is a good idea to combine the logs to create a single log that includes requests sent to all systems.
- Monitoring: To detect problems that affect a single server or the whole site, you must monitor both the external URL for the site and the URLs for each of the Web servers.
- Centralized database: Web applications that use a database must have a single database that is shared between multiple Web servers. In environments that require no single point of failure, cluster the database server.
back to the top
Article ID: 815162 - Last Review: Mar 29, 2017 - Revision: 3