To provide a satisfactory experience for users, you must make sure that server performance is optimal. Hardware needs vary depending on the service provided. For example, the FTP service uses less memory than the Web service. In addition, Active Server Pages (ASP) applications, Common Gateway Interface (CGI) scripts, database queries, and video files are more processor-intensive than static HTML pages. Performance also changes over time as traffic and site content change. To efficiently tune performance, the server administrator must plan a monitoring strategy using a variety of tools.
This topic includes the following sections:
Performance testing and tuning is an ongoing process. To test and tune effectively, you must begin by planning your evaluation strategy. The first step is to measure the current level of performance. Because performance of the server can vary greatly over time, be sure to monitor long enough to capture a true picture of activity on the server.
To improve server performance, examine all parts of the system for potential bottlenecks. Bottlenecks can be caused by inadequate or improperly configured hardware, or by software settings in either IIS or Windows XP. A good monitoring plan checks on performance in all areas.
Once you know how your server is performing, you can begin to make changes aimed at improving performance. Changes should be made one change at a time because it becomes difficult to assess the impact of multiple changes.
After each change is made, continue to monitor to see if the change had the desired effect, or if it had undesirable side effects. Because changes to one resource can cause bottlenecks to appear in other areas, you need to check on the performance of all resources after you make a change. Once you have assessed the impact of a change, you can determine whether further changes are necessary.
Monitoring the server is a crucial part of server administration. By using appropriate monitoring tools, you can detect server problems, evaluate the result of changes to your Web site content, and plan upgrades to make your sites more accessible to users.
The best choice of monitoring tool and method depends on the information you need. For example, if you are trying to measure the overall load on your Web server, you can use Performance Monitor to render a week-long plot, showing information such as the number of computer connections and file transfers. As another example, if you notice a slowdown in your server's performance, you can check for errors in Event Viewer, the tool for viewing logs generated by Windows XP.
You can also monitor your server by examining logs generated by IIS. These logs extend beyond those generated by Windows XP. For information about logging, see the topics listed in Logging Site Activity.
The following monitoring tools, available in some editions of Windows XP, can provide both moment-to-moment and summary information:
In addition to the tools built into Windows XP, you can use other performance monitoring tools. For more information, see Performance and Scalability Testing.
Performance Monitor is a powerful MMC snap-in that you can use to monitor your servers activity and summarize its performance at selected intervals. With this tool, you can display performance data in real time charts or reports, collect data in files, and generate alerts when critical events occur. The data can be used to determine the cause of system bottlenecks and to fine-tune system and application performance.
The following are three methods to access the Performance Monitor:
Performance Monitor examines the output of Performance Counters that monitor the activity of specific Performance Objects, that is, specific services or mechanisms controlling server resources. For example, if you click on the button with a plus sign in Performance Monitor, you can view a performance object called Web Service and a list of counters that monitor such things as bytes received per second or connection attempts per second. From this window, you can add and remove counters to the graphic display of Performance Monitor, or you can configure the counters to log in a particular way. Numerous counters running at the same time can cause a small decrease in performance, so be selective.
Windows XP includes hundreds of counters such as those for disk usage and TCP activity. IIS installs its own counters, including Web service counters, FTP service counters, counters for Active Server Pages applications, and global counters for IIS. The Web and FTP service counters and Active Server Pages object counters monitor connection activity for scripts, while the Internet Information Services global counters monitor things such as bandwidth usage and caching activity for all IIS services. Counters typically measure in terms of how much, how many, or how long. Keep this in mind when selecting what counters you want to display.
Performance Monitor is designed to provide both short-term and long-term information about the load on your server and sites. The following table lists some Performance Monitor counters that are useful to monitor your server, and provides ideal average values for each counter. The Performance Monitor graph plots on a scale of zero to 100, so it may be necessary to change the scale for individual counters that register small values.
| Object\Counter | Ideal Value |
|---|---|
| Memory\Pages/sec | 020 (if over 80, indicates trouble). |
| Memory\Available Bytes | At least 20 MB. |
| Memory\Committed Bytes | Not more than about 75 percent of physical memory size. |
| Memory\Pool Nonpaged Bytes | Steady (slow rise may indicate a memory leak). |
| Processor\% Processor Time | Less than 75 percent. |
| Processor\Interrupts/sec | Depends on processor. Up to 1,000 for 486/66 processors; 3,500 for P90; more than 7,000 for P200. Lower is better. |
| Processor\System Processor Queue Length | 2 or less. |
| (Logical or Physical) Disk \ % Disk Time | As low as possible. |
| (Logical or Physical) Disk \ Avg. Disk Queue Length | Less than 2. |
| (Logical or Physical) Disk \ Avg Disk Bytes/Transfer | As high as possible. |
| Internet Information Services Global\File Cache Hits % | As high as possible, though the value depends on the content of the site. |
| Web Service\Bytes Total/sec | As high as possible. |
| Active Server Pages\Request Wait Time | ASP\Request Execution Time |
| Active Server Pages\Requests Queued | Zero. |
| Active Server Pages\Transactions/sec | As high as possible. |
For more detailed information about using Performance Monitor, see the Windows XP documentation. For a complete list of counters provided by IIS, see Counters Reference.
Windows XP includes an event-logging service, which records events such as errors or the successful starting of a service. These event logs are viewed by using Event Viewer. You can use Event Viewer to monitor system, security, and application event logs. With this information you can better understand the sequence and types of events that led up to a particular performance problem. For details about how to use Event Viewer, see the Windows XP documentation.
Task Manager can be used to view ongoing tasks and threads. It can also be used to change the assigned priority of processes. However, once the process has completed, the new priority setting is lost. CPU and memory usage can be seen in real time, but information is not saved over time. For more detailed information about using Task Manager, see the Windows XP documentation.
Network Monitor captures information on traffic to and from a computer, and gives detailed information about the frames being sent and received. This tool can help you analyze complex patterns of network traffic. By using it, you can view the header information included in HTTP and FTP requests to your server. Generally, you need to design a capture filter, which functions like a database query and singles out a subset of the frames being transmitted. You can also use a capture trigger that responds to events on your network by initiating an action, such as starting an executable file. A light version of Network Monitor ships with some versions of Windows XP. A complete version of Network Monitor ships with Systems Management Server. For details about Network Monitor, see the Windows XP documentation, including the Windows Resource Kits.
Hard-disk bottlenecks are most often seen on sites with very large file sets that are accessed randomly. How often IIS needs to access the hard disk is directly related to the amount of RAM and the number and size of requested files. If the amount of RAM is small and either a large number of different files are being requested, or the size of the requested files is large, IIS is unable to maintain copies of the files in RAM for faster access. In this case, IIS must access the files from the hard disk. The access speed and size of the hard disk determine how quickly IIS can locate a requested file.
To monitor your disk drives, use Performance Monitor to log the percentage of CPU utilized, network card saturation, and the % Disk Time counter of the Physical Disk object. If the % Disk Time counter is high, but the CPU and network card are not saturated, the disk drive is creating a bottleneck. For more information on Physical Disk % Disk Time, see the Windows XP documentation.
To improve disk access, use a redundant array of independent drives (RAID) and striped disk sets. If your server is used heavily for database work, you may want to consider running the most current version and appropriate version of the Windows server on a different machine because your database will compete with IIS for memory, CPU, and disk resources. If you must run Windows XP on the same machine as your database server, you may need either gigabytes of RAM, so you can minimize access delays, or a drive controller with a large RAM cache. You should also maintain redundancy, so that you are not forced to restore from backup copies when a single drive ceases to function. Many newer controllers permit "hot swapping," so that when a drive fails, it can be replaced without forcing server downtime. Even so, it's a good idea to maintain proper backups, and to keep one copy off-site.