Windows Common performance counters

Source: Internet
Author: User

Counter is a data indicator that describes the performance of servers or operating systems. Counters play a key role in performance testing, especially when analyzing the scalability of the system and locating performance bottlenecks, the Analysis of counter values is critical. However, it must be noted that a single performance counter can only reflect one aspect of the system performance, and the analysis of the performance test results must be based on multiple different counters.

Another term related to performance counters is "Resource Utilization ". This term refers to the usage of various system resources. In order to facilitate the comparison, "actual use of resources/total available resource usage" is generally used to form resource utilization data for comparison of various resource usage.

Memory for performance testing (Windows)

To monitor the status of insufficient memory, start with the following object counters:

·   Memory \ available bytes

·   Memory \ pages/sec

Available bytes remaining available physical memory, in MB (reference value:> = 10% ). Indicates the number of memory bytes currently available for the process. Pages/sec indicates the number of pages retrieved from the disk due to hardware page errors, or written to the disk for release due to page errorsWorkPage number of the set space.

If the available bytes value is small (4 MB or smaller), the total memory on the computer may be insufficient, or a program does not release the memory. If the value of pages/sec is 20 or greater, you should study the page exchange activity further. A large value of pages/sec does not necessarily indicate memory problems, but may be caused by running programs that use memory ing files.

The operating system often uses disk swap to increase the amount of memory available to the system or the memory usage efficiency. The following four

The index directly reflects the disk swap frequency of the operating system.
Page faults/sec

When an error occurs when the processor reads a page in the memory, page failure occurs. If this page

Other locations in the memory. This error is called a soft error. It is measured by transition fault/sec. If the page is located on the hard disk, it must be read from the hard disk again. This error becomes a hard error. Hard errors will make the system run more efficiently soon. Page faults/sec: This counter indicates the number of error pages processed per second, including hard errors and soft errors.
  Page input/sec
  Number of pages written to the hard disk to solve the hard drive error (reference value:> = page reads/sec)
  Page reads/sec
  The number of pages read from the hard disk to solve the problem. (Reference Value: <= 5)
  Pages/sec
  The number of pages read from or written to the hard disk to solve the hard drive error (reference value: 00 ~ 20)

 

You must monitor both available bytes, pages/sec, and paging file % usage to determine whether this happens. If you are reading a non-cache memory ing file, check whether the cache activity is normal.

Cathe bytes
File System cache (50% of available physical memory by default)

Memory leakage

·                       Memory \ available bytes

·                       Memory \ committed bytes

If you suspect Memory leakage, Please monitor memory \ available bytes and memory \ committed bytes to observe memory behavior, monitor the Process \ private bytes, Process \ working set, and process \ handle count that may leak the memory. If you suspect that a kernel-mode process causes leakage, you should also monitor memory \ pool nonpaged bytes, memory \ pool nonpaged allocs and process (Process_name) \ Pool nonpaged bytes.

Private bytes
The number of bytes that a process cannot share with other processes. When the counter value is large, it may be a memory leak signal.

Check for too frequent page exchanges

Because too many page swapping requires a lot of hard disk space, it may lead to insufficient Page Swap memory, which is easy to confuse with the disk bottleneck that leads to page switching. Therefore, you must track the following disk usage counters and memory counters when studying the causes of page exchanges with less memory:

·                       Physical disk \ % disk Time

·                       Physical disk \ avg. Disk Queue Length

For example, page reads/sec, % disk Time, And avg. Disk queue length. If the page reading speed is very low and the value of % disk Time and AVG. Disk queue length is very high, there may be disk bottle diameter. However, if the length of the queue increases while the page read rate does not decrease, the memory is insufficient.

To determine the impact of excessive page swapping on disk activity, increase the values of physical disk \ avg. Disk SEC/transfer and memory \ pages/sec counters several times. If the count of these counters exceeds 0.1, page switching will take more than 10 percent of disk access time. If this happens for a long time, you may need more memory.

Study procedure activities

Next, check for excessive page exchanges caused by running programs. If possible, stop the program with the highest working set value and check whether the page switching rate has changed significantly. If you suspect that too many page exchanges exist, check the memory \ pages/sec counter. This counter displays the number of pages to be read from the disk because the page is not in the physical memory. (Note the difference between this counter and page faults/sec. The latter only indicates that the data cannot be used immediately in the specified work set of the memory .)

Performance testing processor (Windows)

Monitoring "processor" and "system" Object counters can provide valuable information about the use of the processor to help you determine whether a bottleneck exists. The following content must be included:

  • Processor \ % Total processor time obtains the overall CPU usage.

This Count value is used to reflect the overall processor utilization of the server. For a multi-processor system, this Count value reflects the average utilization of all CPUs. If the value continues to exceed 90%, it indicates that the entire system is facing a bottleneck in terms of the processor, and the performance needs to be improved by adding a processor.

Note that, due to the characteristics of the operating system itself, in some multi-CPU Systems, the data itself is not large, but the load between CPUs is extremely unbalanced at this time, at this time, it should also be considered as a bottleneck in the system for processing.

  • Monitor processor \ % processor time, processor \ % USER time, and % privileged time for detailed information.

Processor \ % USER time refers to the CPU time consumed by the system's non-core operations. If this value is large, you can consider whether to reduce this value through optimization algorithms or other methods. If the server is a database server, processor \ % USER time is large because database sorting or function operations consume too much CPU time. In this case, you can consider optimizing the database system.

  • System \ processor queue length is used for Bottleneck detection.

% Total processor time
Percentage of time when all processors in the system are busy. For a multi-processor system, this value can reflect the average busy status of all processors. The value is 100%, if half of the processors are busy, the value is 50%

File data operations/sec
The frequency at which the computer reads and writes the file system, but does not include file control operations.

Process Queue Length
The length of the queue to which the thread is waiting to allocate CPU resources. This length does not include threads that are occupying CPU resources. If the queue length is greater than the number of processors + 1, it indicates that the processor may be in a blocking state (reference value: <= number of processors + 1)

% Processor time
CPU utilization. This counter is most commonly used. You can check whether the processor is saturated. If the value exceeds 95%, it indicates that the bottleneck of the current system is CPU, you can consider adding a processor or replacing a processor with better performance. (Reference Value: <80%)

% Priviliaged time
Percentage of time the CPU spends processing threads in privileged mode. General system services, city management, memory management, and other processes started by the operating system.

% USER time
The opposite of the % privileged time counter refers to the percentage of time spent on operations in user State mode (that is, in non-privileged mode. If the value is large, you can consider whether to reduce the value through algorithm optimization or other methods. If the server is a database server, the reason for this value is that database sorting or function operations consume too much CPU time. You can optimize the database system.

% DPC time
The time consumed by the processor in network processing. The lower the value, the better. In a multi-processor system, if the value is greater than 50% and the % processor time is very high, adding a NIC may improve performance.

Value of the processor usage

To measure the activity of the processor, view the processor \ % processor time counter. This counter shows the percentage of time consumed by the processor busy executing non-Idle threads.

When checking the processor usage, consider the role of the computer and the completedWork. Depending on the computer's work, a higher processor value means that the system is effectively processing heavy workloads or is trying to maintain them. For example, if you are monitoring your computer and the computer is used for computing, the computing program may easily use 100% processor time. Even if this causesOthersThe performance of the application is affected, but it can be solved by changing the load.

On the other hand, about 100% of the server computers that process many customer requests indicate that these processes are waiting for processing time in the queue and cause bottlenecks. Such continuous use of high-level processors is unacceptable for servers.

Test the processor bottleneck

When the processor cycle required by the thread of the process exceeds the available cycle, the bottleneck of the processor is gradually displayed. A long processor queue can be created and the system response will be affected. Two common causes of Processor Bottlenecks are CPU restrictions and drivers or subsystem components that cause too many interruptions.

To determine whether a processor bottleneck exists due to high processor time requirements, check the system \ processor queue length counter. Two or more projects in the queue indicate a bottleneck. If multiple program processes compete for most processor time, installing a faster processor will increase the throughput. If you are running a multi-threaded process, the additional processor will be helpful, but note that the additional processor may only have limited benefits.

In addition, the server work queues \ queue length counter that tracks the current length of the server work queue of the computer will display a processor bottleneck. If the queue length is greater than 4, processor congestion may occur. This counter is the value of a specific time, not the average value of a period of time.

To determine whether the Interrupted Activity causes a bottleneck, observe the value of the processor \ interrupts/sec counter, which measures the speed of service requests from the input/output (I/O) device. If the value of this counter increases significantly, but the system activity does not increase accordingly, it indicates that there is a hardware problem.

You can also monitor processor \ % interrupt time on indirect indicators that generate interrupted disk drives, NICS, and other device activity.

Note:

To detect hardware problems that may affect processor performance, such as IRQ conflicts, observe the value of System \ file control bytes/second.

Monitor multi-processor systems

To observe the efficiency of a multi-processor computer, use the following additional counters.

Counter

Description

Process \ % processor time

Total processor time of all threads in a process on each processor.

Processor (_ total) \ % processor time

The measurement of the processor activity of all processors in the computer.
"N [{y8_0 sum of average non-idle time of all processors during the sampling interval of this counter, and divide the sum by the number of processors. 51testing Software Testing Network

T # e_5i: n2y8 @ "A: X: Y
For example, if the average sampling interval is half busy for all processors, 50% is displayed. If half of the processors are busy throughout the entire interval, and Other Processors are idle, 50% is displayed.

Thread \ % processor time

Number of CPU times of a thread

 

Disk for performance testing (Windows)

Monitored object:Physicaldisk
If the analyzed counter indicators come from database servers, file servers, or streaming media servers, disk I/O becomes a bottleneck for these systems.

The I/O quantity of each disk can be compared with the I/O Capacity of the disk. If the calculated I/O quantity of each disk exceeds the nominal I/O Capacity of the disk, it indicates that the disk performance bottleneck exists.

The following table shows the calculation formula for each disk I/O:

RaidType

Calculation Method

Raid0

(READS + writes)/number of disks

Raid1

(READS + 2 * writes)/2

RAID5

[Reads + (4 * writes)]/number of disks

Raid10

[Reads + (2 * writes)]/number of disks

% Disk Time
Indicates the percentage of time the disk drive uses to provide services for read or write requests. If only % disk Time is large, the hard disk may be a bottleneck.

Average disk Queue Length
Percentage of time used to provide services for Disk Read and Write requests. You can increase the disk array by adding a disk (<= twice the number of disks)

Average disk read Queue Length
Average number of disk read requests

Average disk write Queue Length
Average number of disk write requests

Average disk SEC/read
Average time of Data Reading on the disk, in seconds

Disk Bytes/sec provides the throughput of the disk system.
Determine workload balancing
To balance the load on the network server, you need to know how busy the server disk drive is. Use the physical disk \ % disk Time counter to display the percentage of drive activity time. If % disk Time is high (more than 90%), check the physical disk \ current disk queue length counter to check the number of system requests waiting for disk access. The number of waiting for I/O requests should be no greater than 1.5 to 2 times the number of main axes that constitute the physical disk.

Average disk SEC/Transfer
Average time of Data writing to the disk, in seconds

The counter indicates the time used by the disk to complete the request. A high value indicates that the disk controller keeps retrying the disk because of the failure. These faults increase the average disk transfer time. Generally, it is best to define a value less than 15 ms, which is good between 15-30 ms and acceptable between 30-60 ms. If the value exceeds 60 ms, you need to consider replacing the hard disk or hard disk raid mode.

 

Average disk Bytes/Transfer

A value greater than 20 KB indicates that the disk drive is normally running well. If the application is accessing the disk, a low value is generated. For example, applications that randomly access a disk increase the average disk SEC/transfer time, because random transfer requires an increase in the search time.

Performance Testing Network (Windows)

Monitored object:Network Interface
Network Analysis is a highly technical task. In general organizations, there are dedicated network administrators for network analysis. For testing engineers, if they suspect that the network is a bottleneck of the system, you can require that the network still have photos for network detection.

Network Interface \ bytes total/sec is the speed at which bytes are sent and received (including frame characters ). You can use the counter value to determine whether the network connection speed is a bottleneck. The specific operation is to use the counter value to compare with the current network bandwidth.

 

Byte total/sec
Indicates the speed at which bytes are received and sent in the network. You can use this counter to determine whether the network has a bottleneck (reference value: This counter is different from the network bandwidth, <50%)

 

Performance testing process (Windows)

View the % processor time value of the process

The % processor time of each process indicates the processor time consumed by the process. Compare the processor time consumed by different processes, you can easily see which processPerformance TestingThe process consumes the most processing time, so that the application can be optimized accordingly.

Check that the page generated by each process is invalid.

The ratio of page invalidation generated by each process (obtained through the process \ page failures/sec counter) to page invalidation of the system (obtained through the memory \ page failures/sec counter, to determine which process generates the most invalid pages. This process either requires a large amount of memory or is very active and can be analyzed in progress.

Process \ private bytes

Process \ private bytes refers to the number of bytes allocated by the process that cannot be shared with other processes. This counter mainly uses pulling to determine whether the process has memory leakage during the performance test.

 For example, for a Web application on IIS, we can focus on monitoring the private bytes of the Inetinfo process. If the private bytes counter value of the process increases during the performance test, or after the performance test is stopped for a period of time, the private bytes of the process continues at a high level, which indicates that the application has memory leakage.

(Note: The counters used in process analysis methods include process \ % processor time, page failures/sec, page failures/sec, and private bytes)

 

Related links:

① Memory ing file Mechanism

The memory ing file uses the virtual memory to map the file to the address space of the process. After that, the process operates on the file, just like the address in the process space, saves time for reading and writing I/O.

For example, a function that uses memory operations such as memcpy. This method can be well applied when a file or a large file needs to be processed frequently. This method is more efficient than ordinary Io.

With the memory ing file, you can think that the operating system has loaded all the files into the memory for you, and then you only need to move the file pointer to read and write. In this way, you do not even need to call the API functions for allocating and releasing memory blocks and file input/output. In addition, you can use this function as a way to share data between different processes. The use of memory ing files does not actually involve actual file operations. It is more like retaining a visible memory space for each process. As for using the memory ing file as a way to share data between processes, be careful because you have to handle data synchronization issues, otherwise, your application may probably get outdated or wrong data or even crash.

The memory ing file itself has some limitations. For example, once you generate a memory ing file, you cannot change the size of the file during that session. Therefore, memory ing files are very useful for read-only files and file operations that do not affect their size. Of course, this does not mean that the memory method cannot be used for file operations that may cause file size changes. You can estimate the possible size of the operated file in advance, then, a memory ing file of this size is generated, and the file length can be increased to this size. We have explained enough. Next we will look at the Implementation Details:

  1. Call createfile to open the file you want to map.
  2. Call createfilemapping, which requires passing in the handle returned by the previous createfile. This function generates a memory ing object based on the file object created by the createfile function.
  3. Call the mapviewoffile function to map a region of the entire file or the entire file to the memory. This function returns a pointer to the first byte mapped to the memory.
  4. Use this pointer to read and write files.
  5. Call unmapviewoffile to remove the file ing.
  6. Call closehandle to close the memory ing file. Note that the handle of the memory ing file must be passed in.
  7. Call closehandle to close the file. Note that the handle of the file created by createfile must be passed in.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.