我思故我在我有我精彩--liangqihui

爱欲追而情已逝,子欲孝而亲不待。人生的困苦又怎能用一个难字囊尽百味
  博客园  :: 首页  :: 新随笔  :: 联系 :: 订阅 订阅  :: 管理

HOW TO: Tune and Scale Performance of Applications That Are Built on the .NET Framework

Article ID : 818015
Last Review : May 16, 2007
Revision : 4.4

SUMMARY

This step-by-step article describes important considerations for performance tuning and scaling of applications that are built on the .NET Framework. This is one of a series of articles that provide detailed information for applications built on the .NET Framework.

The articles in this series include the following:
818016 (http://support.microsoft.com/kb/818016/EN-US/) HOW TO: Deploy Applications That Are Built on the .NET Framework
818013 (http://support.microsoft.com/kb/818013/EN-US/) HOW TO: Support Applications That Are Built on the .NET Framework
818015 (http://support.microsoft.com/kb/818015/EN-US/) HOW TO: Tune and Scale Performance of Applications That Are Built on the .NET Framework
818014 (http://support.microsoft.com/kb/818014/EN-US/) HOW TO: Secure Applications That Are Built on the .NET Framework

Back to the top

Configure Sessions for ASP.NET Applications

ASP.NET applications include sophisticated support for tracking user information between multiple requests. To enable applications to scale to thousands of users, you can store sessions in many flexible ways. The default method is to store session information in-process. This stores user information in the memory of a single server. The in-process method offers the fastest performance. Two other methods offer slower performance but greater scalability: storing session information on a state server, or storing session information on a computer running SQL Server.

For additional information about how to configure ASP.NET sessions by using any of the three standard methods, click the following article number to view the article in the Microsoft Knowledge Base:
317604 (http://support.microsoft.com/kb/317604/EN-US/) HOW TO: Configure SQL Server to Store ASP.NET Session State


Back to the top

Set the Timeout Period for ASP.NET Sessions

Depending on the application, ASP.NET sessions can use a lot of memory. When the user load and the quantity of information that is stored about each user increases, memory-constrained systems may experience performance problems. One way to reduce the memory that sessions require is to shorten the time that sessions are stored. When you reduce the session timeout period, session information is discarded before the default 20-minute idle period. Alternatively, when you increase the session timeout period, users can return to an active session without losing their logon information, their shopping cart contents, or other session-specific details.

For more information about how to set the timeout for a session state, visit the following Microsoft Web site:
http://msdn2.microsoft.com/en-us/library/h6bb9cz9(vs.71).aspx (http://msdn2.microsoft.com/en-us/library/h6bb9cz9(vs.71).aspx)

Back to the top

Test ASP.NET Applications and Web Services by Using the Web Application Stress Tool

The Web Application Stress (WAS) tool is useful for testing Web application performance and scalability. You can use this tool for both ASP.NET Web applications and Web services. However, there are differences in how you use the WAS tool for each type of service.

For additional information about how to use WAS to test ASP.NET applications, click the following article numbers to view the articles in the Microsoft Knowledge Base:
815161 (http://support.microsoft.com/kb/815161/EN-US/) HOW TO: Measure ASP.NET Responsiveness with the Web Application Stress Tool
815160 (http://support.microsoft.com/kb/815160/EN-US/) HOW TO: Test ASP.NET Web Services with the Web Application Stress Tool

Back to the top

Use the Performance Administration Tool to Analyze Windows-based Applications That Are Built on the .NET Framework

The .NET Framework manages assemblies as they run. Therefore, the .NET Framework has access to a lot of information about each assembly. Much of this information is exposed through performance counters. As an administrator, you can gain access to these counters by using the Performance administration tool.

You can gain access to more information about ASP.NET applications than is available from standard Windows-based applications that are built on the .NET Framework. There are dozens of counters that you can monitor. However, most administrators must understand only a few of these counters.

For additional information about the most significant performance counters that the .NET Framework exposes, click the following article numbers to view the articles in the Microsoft Knowledge Base:
815158 (http://support.microsoft.com/kb/815158/EN-US/) HOW TO: Use the Performance Administration Tool to Analyze Performance of .NET Framework-based Windows Application

815159 (http://support.microsoft.com/kb/815159/EN-US/) HOW TO: Analyze ASP.NET Web Application Performance by Using the Performance Administration Tool

Back to the top

Set Up Multiserver ASP.NET Web Applications and Web Services

Web applications may have to scale beyond a single server to meet performance, scalability, or reliability requirements. There are several unique factors to consider when you scale an ASP.NET application to multiple servers.

For additional information about how to scale an ASP.NET application to more than one server, click the following article number to view the article in the Microsoft Knowledge Base:
815162 (http://support.microsoft.com/kb/815162/EN-US/) HOW TO: Set Up Multi-Server ASP.NET Web Applications and Web Services

Back to the top

Disable Debugging for ASP.NET Applications

During development and troubleshooting, developers may enable debugging on an ASP.NET application. Although debugging offers much useful information to developers, it significantly affects the performance of the application. You may have to disable debugging on systems that have had debugging unnecessarily enabled.

For additional information about how to disable debugging for ASP.NET applications, click the following article number to view the article in the Microsoft Knowledge Base:
815157 (http://support.microsoft.com/kb/815157/EN-US/) HOW TO: Disable Debugging for ASP.NET Applications

Back to the top

Restrict ASP.NET to Specific Processors in a Multiprocessor System

By default, an ASP.NET application uses all the processors in a system. This works well for most environments. However, if you are tuning performance on multiprocessor systems, you may have to restrict ASP.NET to one or more specified processors.

For additional information about how to restrict ASP.NET to specified processors on a multiprocessor system, click the following article number to view the article in the Microsoft Knowledge Base:
815156 (http://support.microsoft.com/kb/815156/EN-US/) HOW TO: Restrict ASP.NET to Specific Processors in a Multiprocessor System