You need to identify bottlenecks caused by poor design or implementation early in the application life cycle. Bottlenecks that cannot be optimized or tuned need to be identified as constraints during the design phase of the life cycle, so that they can be ctored in the design to minimize the impact on performance.
If the value of% Processor Timeis high, then queuing occurs, and in most scenarios the value ofSystem\Processor Queue Lengthwill also be high. Figure 17.6 shows a sample System Monitor graph that indicates a high percentage of processor time and a high processor queue length.
Figure 17.1: Performance tuning categories
Use Diskpar.exe on Windows 2000to reduce performance loss due to misaligned disk tracks and sectors. You can use get the Diskpar.exe from the Windows 2000 Resource Kit.
Avg. Disk sec/Transfer
Note Processor utilization depends on your system and application characteristics. The 75% threshold value given in Bottlenecks (following) is based on typical observations. Increase or decrease this threshold based on your system characteristics.
A high value ofPages/secindicates that your application does not have sufficient memory. The average ofPages Input/secdivided by average ofPage Reads/secgives the number of pages per disk read. This value should not generally exceed five pages per second. A value greater than five pages per second indicates that the system is spending too much time paging and requires more memory (assuming that the application has been optimized). The System Monitor graph shown in Figure 17.8 is symptomatic of insufficient memory.
This content is outdated and is no longer being maintained. It is provided as a courtesy for individuals who are still using these technologies. This page may contain URLs that were valid when originally published, but now link to sites or pages that no longer exist.
Continuing with the example introduced earlier, if you are performing a remote database call, you can measure the time taken by the database call to complete. Monitor the metrics related to indexes, locks, number of tables scanned, resource utilization levels, and so forth on the database to identify the reason why the query is taking a long time to execute.
Application. Includes the application configuration parameters.For .NET applications, these parameters are primarily located in configuration files. ASP.NET applications use Web.config configuration files.
Memory
Tune the amount of memory allocated if you can control the allocation. For example, you can tune this for ASP.NET and SQL Server.
Use Chapter 15,Measuring .NET Application PerformanceBefore implementing the steps in the current chapter, make sure you have Chapter 15 available, because it provides details about the measurements that you need to identify bottleneck causes.
Processor% Processor Time% Privileged Time
patterns & practices Library
Memory consists of physical and virtual memory. You need to consider how much memory is allocated to your application. When you evaluate memory-related bottlenecks, consider unnecessary allocations, inefficient clean up, and inappropriate caching and state management mechanisms. To resolve memory-related bottlenecks, optimize your code to eliminate these issues and then tune the amount of memory allocated to your application. If you determine during tuning that memory contention and excessive paging are occurring, you may need to add more physical memory to the server.
Platform. Includes the host operating system and the .NET Framework, together with Web and database servers such as Internet Information Services (IIS) and Microsoft SQL Server. The .NET Framework configuration is maintained in Machine.config. Settings in this file affect all of the .NET applications on the server.
Web Services Tuning
Figure 17.2: The performance tuning process
A low value ofAvailable MBytesindicates that your system is low on physical memory, caused either by system memory limitations or an application that is not releasing memory. Monitor each process objects working set counter. IfAvailable MBytesremains high even when the process is not active, it might indicate that the object is not releasing memory. Use the CLR Profiler tool at this point to identify the source of any memory allocation problems. For more information, see How To: Use CLR Profiler in the How To section of this guide.
The tuning process is an iterative processing that consists of the following set of activities.
Fix issues in a prioritized order. Address the issues that are likely to provide maximum payoff. For example, instead of fine-tuning ASP.NET, you might achieve better initial results by creating an index on a database table that you identified was missing.
Summary:This chapter provides an iterative process to systematically identify, tune, and eliminate bottlenecks until your application meets its performance objectives. The chapter covers tuning the ASP.NET thread pool for various scenarios, including burst load and COM interop . It also shows you how to tune timeouts such as session timeouts, script timeouts, execution timeout and deadlock intervals. It also explains how to tune Web gardens, the Enterprise Services object pool, and much more.
A bottleneck is the device or resource that constrains throughput. Most of the time, performance bottlenecks in your application relate to resource issues that may include server resources such as CPU, memory, disk I/O, and network I/O or other external resources such as available database connections or network bandwidth.
You should be able to identify and isolate the areas that need further tuning. This assumes that you have already optimized your code and design for any changes, and that only the configuration settings need tuning.
Analyze and tune the application that is causing the high CPU utilization. You can dump the running process by using the ADPLUS utility and analyze the cause by using Windbg. These utilities are part of the Windows debugging toolkit. You can download these tools from