Use Windows performance counters to analyze performance bottlenecks of software products

Source: Internet
Author: User
1 OverviewSoftware products often encounter such a situation: product performance is affected by unexpected bottlenecks, resulting in reduced processing efficiency and insufficient performance. How to quickly and effectively find the performance bottleneck of software products is one of the content we are interested in. The performance counters provided by the Windows performance monitor that comes with Windows 2000 have powerful functions that allow us to obtain detailed information about the system or process, such as system processes, CPU utilization, disk activity, memory usage, etc. Using this tool skillfully and flexibly can effectively help us determine the performance bottleneck of software products. 2 instructionsWindows Performance Monitor is placed in a Windows operating system, which allows users to access system performance data. To access the Performance Monitor, select start from the Start Menu" =>"Program" =>"Management Tools" =>"Performance" can be started. If no management tools Program Group exists in the programs menu, select from control panel. Figure (1) shows the initial performance monitor window.

Figure (1) Performance Monitor window

 

 

2.1 performance monitoring dynamic display modeFigure (1) shows the real-time CPU usage distribution of winword processes. In the view area, right-click and select "add counter". The window shown in appears.

Figure (2) Add a counter

 

 

To monitor the CPU usage time and number of handles of the winword process, perform the following operations: (1) in the "add counter" window, select "process" as the performance object. (2) Select "select instance from List". (3) Select the process to be monitored, such as winword. (4) select "select counter from list" and select the features to be monitored from the list box, such as CPU usage time and handle count. (5) After setting, click "add, close the window to monitor the selected parameters in real time. The disadvantage of dynamic monitoring is that the monitoring cycle is only 1 minute 40 seconds, and data cannot be continuously output to files. You cannot perform subsequent analysis. 2.2 continuous performance data tracking statistics When you need to perform continuous statistics on performance data and perform subsequent analysis, you can use another method: Enable the counter. Logs. Figure (3) shows the performance monitor window for enabling counter logs.

Figure (3) Add a counter

 

 

 

The following describes how to monitor the CPU usage, physical memory, and virtual memory of a winword process. (1) As shown in, in the left-side tree chart area, expand the "Performance Logs and alarms" item, and select "counter logs" under the Branch. (2) In the right-side view area, right-click and select "New Log Settings". In the displayed dialog box, enter a name, for example, "mycount". The attribute Settings dialog box (4) appears;

Figure (4) counter property settings

 

 

(3) Click "add". The "add counter" dialog box shown in (2) is displayed. (4) from the "add counter" window, select "process" as the performance object; (5) Select "select instance from List"; (6) Select the process to be monitored, such as winword; (7) select "select counter from list" and select the features to be monitored from the list box, such as CPU usage time, physical memory, and virtual memory. (8) the settings are complete, click "add" to close the window and return to the figure (4) display window. (9) in the figure (4) dialog box, switch to the "Log File" attribute page. (5) as shown in;

Figure (5) log file attribute settings

 

 

 

(10) In Figure (5), set the log type to CSV format for easy import in Excel; (11) set the log size to the maximum value, you can also pre-set the file record size as needed. (12) in the figure (4) dialog box, switch to the "Plan" attribute page, as shown in (6;

Figure (6) custom collection plan

 

 

(13) use the default plan to close the Settings dialog box. (14) start collecting performance data of the Monitored object. If you need to stop collection, manually terminate the collection. Advantage: the sampling frequency can be set, which refers to the time duration or manual control of the sampling duration to continuously collect performance data. In addition, data can be stored in multiple formats to meet different needs and facilitate post-event analysis. 2.2.2 performance collection Data AnalysisThe collected data is recorded in the execl file. The data record is as follows:

Figure (7) Collect data records

 

 

 

(1) Open the log file; (2) Select the data to be analyzed (columns); (3) Click "chart wizard" in the toolbar. the dialog box shown in (8) appears;

Figure (8) chart type settings

 

 

(4) Select the first graph in the line chart to go to the next step;

Figure (9) chart type settings

 

 

(5) In Figure (9), set the data area to start from the second row;

Figure (10) Chart series settings

 

 

(6) After completing the settings, insert the distribution chart as a new table. (7) You can plot the distribution of physical memory and virtual memory in the same way. 2.3 collection object and collection ParametersThe performance counter can monitor up to 20 types of objects, and each type of performance object includes several available performance parameters. Take the process, the most common Monitored object, as an example. There are up to 27 performance parameters available for counting, such as the CPU usage time, number of handles, number of Io bytes per second, number of Io read bytes per second, number of I/O write nodes per second, virtual memory, virtual memory peak, number of threads, physical memory, physical memory peak, etc, can meet most of the needs. 3. Performance EvaluationSampling the Windows performance counter to perform statistical tracking on some characteristic parameters of the process, which can well detect software bottlenecks and running statuses, especially the CPU usage and memory usage that we are concerned about, it has great reference value.

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.