By using the built-in performance counters in Microsoft Windows, you can monitor performance to determine device requirements. After the changes, you can use the monitoring function to determine whether the changes have achieved the expected results or whether further changes are required. 
 
 
 
 
 
 
 
 
This topic describes the counters that can be used to monitor the following hardware components, including the recommended values for each component and other adjustment policies.
 
 
 
Monitor memory (on)
Monitor processor capacity (on)
Monitor multi-processor systems (on)
Monitor network capacity and bandwidth (lower)
Monitor and optimize the hard drive (bottom)
 
 
 
 
 
 
 
 
 
 ArticleList   Monitor and adjust hardware performance (on)   Monitor and adjust hardware performance (II)  
 
 
 
 
Recommended reading:Why is it hard for technicians?
 
 
 
 
 
 
 
 
 
 
 
Monitor memory
After the problem of insufficient memory is solved, IIS will achieve the maximum performance improvement. The memory issue should be ruled out first before making any decision on changing the hardware configuration. You should first monitor the memory to verify that the server has enough memory, and then continue to handle other issues in the server environment. Problems caused by insufficient memory are often manifested in other parts of the system. For e-commerce sites, sites with a lot of content, and sites with high traffic, it is particularly beneficial to have a larger memory.
 
 
 
 
 
 
You can use the system monitor to determine whether the current memory volume on the server meets your needs. The system monitor graphically displays the changes in counter readings over time.
 
 
 
 
 
 
 
Monitor the following counters to determine whether memory-related performance bottlenecks exist:
 
 
 
  
   
   | Counter | Monitoring | 
 
   
   | Memory \Available bytes | Try to keep at least 10% of available memory for use during peak hours. | 
 
   
   | memory \  page faults/sec     memory \  pages input/sec      memory \  page reads/sec      memory \  transition faults/sec    | If the process requests a page in the memory and the system cannot find it in the requested location, a page error occurs. If this page is elsewhere in the memory, this error is called a soft page error (measured by transition faults/sec ). If this page must be retrieved from the disk, this error is called a hard page error. Most processors can handle a large number of soft errors without any consequence. However, hard errors may cause serious delays.      page faults/sec  is the overall rate at which the processor processes hard-page and soft-page errors.  pages input/sec  is the total number of pages read from the disk to solve the hard page error.  page reads/sec  is the number of times the disk is read to solve the hard page error.  pages input/sec  is greater than or equal to  page reads/sec , and provides a good understanding of the hard page error rate. If these numbers are low, the server may respond quickly. If they are high, it may be because you allocate too much memory for the cache, rather than retaining enough memory for other system operations. It may be necessary to increase the server's Ram volume, although reducing the cache size is also an effective way.   | 
 
   
   | Memory \Cache bytes | Displays the size of the file system. By default, the cache is set to use up to 50% of the available physical memory. Because IIS automatically reduces the cache when the memory is insufficient, make sure to monitor the trend of this counter. | 
 
   
   | WWW Service cache \File Cache Flushes WWW Service cache \File Cache hits WWW Service cache \File Cache% | these counters describe file caching in user mode. The File Cache is basically a file name or file content cache. If you request a file, IIS searches for the File Cache. If the file is in the cache, it returns the file. If IIS cannot find the file in the cache, it will read the file from the hard disk and return the file, leading to a hard page error.           File Cache Flushes  indicates the number of times that IIS clears entries from the WWW Service cache. If the file has been changed or you have not accessed the file within 30 seconds, the entry is cleared. If the counter value is high, IIS fills the cache with files not accessed, and then clears these files.      File Cache hits  is the number of times IIS finds files in the cache.          File Cache %  indicates the cache hit rate. This is the percentage of times that IIS finds the requested file in the cache. If the cache hit rate is low (for example, 70%), you may need to redesign the site around a small amount of "hot" information that can be easily found in the file cache to improve performance.   | 
 
   
   | Process \  page file bytes     Process \  page file bytes peak      paging file \  % usage      paging file \  % usage peak    | these counters reflect the number of page file instances in use. The larger the page file, the more memory the system submits to it. Windows Server 2003 family members create page files on the system drive. You can create page files on each Logical Disk and change the size of existing files. In fact, page files can be striped across multiple separate physical drives to Improve the Performance of page files (that is, the drive it uses does not contain site content or log files ). Remember, the page files on the system drive should be at least twice the physical memory size, the system can write all the content in Ram to the disk when the system is accidentally locked or disabled. | 
 
   
   | memory \  pool paged bytes     memory \  pool non-paged bytes      Process \  virtual bytes  (w3wp.exe)     Process \  virtual bytes  (inetinfo.exe)     Process \  working set  (w3wp.exe)     Process \  working set  (inetinfo.exe)   | Pool paged bytesAndPool non-paged bytesMonitor the pool space of all processes on the server. Virtual bytesThe counter can be monitored by either the inetinfo.exe process or the w3wp.exe process instantiated on the server. Working SetThe counter measures the number of memory pages used by each process. Be sure to monitor the counters of all w3wp.exe instances on the server; otherwise, you will not be able to get accurate readings of the virtual memory used by IIS. The system memory pool retains the applicationProgramAnd the objects created and used by the operating system. The content of the memory pool can be accessed only in privileged mode. That is, only the kernel of the operating system can directly use the memory pool, and user processes cannot directly use it. On the server running IIS 6.0, the thread providing services for connection is stored together with other objects used by the Service (such as file handles and sockets) in a non-page buffer pool. | 
 
  
 
 
 
 
 
 
In addition to adding more RAM, you can also use the following process to improve memory performance.
 
 
 
  
   
   - Improve data organization.
- Use a disk image or a zone.
- Managed ServiceCode(ASP. NET) or an Internet Server API (ISAPI) Application replaces a Common Gateway Interface (CGI) application.
- Increase the size of the page file.
- Eliminate unnecessary functions.
- Changes the balance between the file system cache and the IIS working set. 
  Monitor processor capacity  
 
Because the user requires the website to have a fast response time and these sites can provide an increasing number of dynamically generated internal capacities, fast and effective processor usage should be put at the top. A bottleneck occurs when one or more processes consume most of the processing time. This forces the prepared thread to wait for the processor time in the queue. Adding other hardware, whether it is memory, hard disk or network connection, is not an effective way to overcome the processor bottleneck and may cause greater problems.
 
 
 
 
 
 
Monitor the following counters to determine whether there are performance bottlenecks related to the processor capacity:
 
 
 
  
   
   | Counter | Monitoring | 
 
   
   | System \Processor Queue Length | Displays the number of threads in the queue that are waiting to be executed and shared by all the processors on the system. If the counter has two or more continuous threads, it indicates a bottleneck on the server. | 
 
   
   | Processor \% Processor time | The processor bottleneck is characterized by the following situations,% Processor timeThe number is high, while the network adapter and disk I/O are lower than the capacity value. On a multi-processor computer, check% Processor timeTo find any imbalance between the processor and the processing time. | 
 
   
   | thread (svchost/ host number ) \  context switches/sec     System \  context switches/sec    | if you decide to increase the size of any thread pool, you should monitor this counter. Increasing the number of threads may increase the number of context switches to a certain point, resulting in lower performance rather than higher performance. If the context switch reaches 10 thousand or more per second, the value of this counter is large. If this number is so large, reduce the thread pool size. It may be difficult to balance the overall performance of threads and measured by connections and requests. The overall performance should be monitored every time the thread is adjusted to understand whether the performance is improved or decreased.     determine whether to adjust the thread count, the number of threads and the processor time of each thread in the process should be compared with the total processor time. If the thread remains busy but does not fully use the processor time, you can improve performance by generating more threads. However, if all threads are busy and the processors are close to their maximum capacity, it is best to distribute loads among multiple servers rather than increase the number of threads.   | 
 
   
   | Processor \Interrupts/sec Processor \% DPC time | You can use these counters to determine how long the processor spends calling the interrupt and Delay Processes. These two factors may be another cause of load on the processor. Client requests may be the main reason for calling the process of interruption and delay. Some new network adapter, including interrupt mediation, will pile up the interrupt in the buffer when the interruption level is too high. | 
 
  
     Monitor multi-processor systems  
 
IIS can be scaled on a multi-processor computer, but its scalability may be compromised by poor design of websites and web applications. Web parks and process recycling can help minimize performance issues related to imperfect applications. However, you must monitor and test the scalability of websites and web applications on a multi-processor computer. All other bottlenecks of the system should be ruled out before changing the settings of the multi-processor computer.
 
 
 
 
 
 
You should also consider assigning processes (called processor relationships) to specific processors to better manage how servers process requests and applications. In addition, you should enable the quality of service feature in IIS before changing the settings of a multi-processor computer. The service quality function is used to restrict the resources used by a specific website or web application to ensure that other parts of the system have sufficient resources.
 
 
 
 
 
 
 
Monitor the following counters to determine whether there are performance bottlenecks related to a multi-processor computer:
 
 
 
  
   
   | Counter | Monitoring | 
 
   
   | Processor \% Processor time(_ Total) | The activity of all processors in a computer is measured by adding the average non-idle time of all processors in the sampling interval and dividing the sum by the number of processors. For example, if, on average, all processors are in a busy state during the half sampling interval, 50% is displayed. If half of the processors are busy during the entire interval, and Other Processors are idle, 50% is displayed. | 
 
   
   | Thread \% Processor time(_ Total/_ total) | Measure the processing time of a thread. | 
 
  
 
 
 
 
 
 
Manage processor relationships in a multi-processor system
 
 
Setting the processor relationship means assigning a specific process or application to a specific processor. Controlling the processor relationship can improve performance by reducing the number of times the processor cache refreshes when the thread moves from one processor to another. This may be a good choice for dedicated file servers. However, please note that assigning a specific processor to a program may not allow other program threads to be migrated to the least busy processor.
 
 
 
 
 
 
 
If you want to assign a specific process or program to a processor to improve its performance at the cost of other processes, change the smpprocessoraffinitymask attribute in the IIS configuration database.