You are here

HyperV performance monitoring.


HyperV performance monitoring.

If we are talking about monitoring the performance of the OS on a hardware ("iron") platform, then very few people have a question how to do this.

There are already known tools and methods for monitoring such systems.

But when it comes to monitoring the performance of a hypervisor with virtual machines running on it, it's not all so unique, especially with the hypervisor Hyper-V from Microsoft. A clear picture of performance can be provided by products such as System Center Operations Manager (SCOM), but not always there is an opportunity to use such a cumbersome software.

Therefore, this article will discuss: a way to monitor performance of Hyper-V with performance counters. Monitoring performance in real time, monitoring performance over a period of time. Automation of the performance monitoring process.

Monitoring of Hyper-V performance with the help of counters.

First of all, it must be said that to monitor the hypervisor it is necessary to use special counters, not such as for monitoring the traditional server. The most important are the following four types of resources: Processor, Disk, Memory and Network.

Let’s consider and describe the counters for each resource type:

Prcessor:

In order to see the total load on the physical processor that all virtual machines create and the hypervisor itself, you need to use the following counter: \ Hyper-V Hypervisor Logical Processor (_Total) \% Total Run Theme. If it is necessary to determine which processor of the virtual machine creates the greatest load, then this counter should be used: \ Hyper-V Hypervisor Virtual Processor \% Total Run Time.

Disk.

Information on the time spent by the system (hypervisor in general and virtual machines) on reading / writing information from the disk is shown next. Counters: \ Logical Disk (*) \ Avg. Disk sec / Read \, Logical Disk (*) \ Avg. Disk sec / Write /. The value of the counters data should not exceed 25ms, otherwise there will be performance problems that need to be addressed.

Memory.

In order to see the number of pages of memory written / read from the hard disk, for the host and guest systems, the following counter is used: \ Memory \ Pages / sec. If the value is greater than 500, then either there is not enough physical memory or a "broken" memory bar is used. If you use Dynamic Memory, you need to use counters for Hyper-V Dynamic Memory Balancer and Hyper-V Dynamic Memory VM objects.

Network.

To determine the number of threads waiting for the network adapter, use the following counter: \ Network Interface (*) \ Output Queue Length.

The indication of this counter should always be 0, if it is equal to 1 or 2, then the network is the bottleneck in your system. The total load in Byte / sec for the interface can be found with the help of the counter: \ Network Interface (*) \ Bytes Total / sec. To determine which virtual network adapter (which virtual machine) creates the load, use the following counter: \ Hyper -V Virtual Network Adapter (*) \ Bytes / sec (for each virtual machine).

Realtime performance monitoring.

Actually, to monitor performance in real time, the same Performance Monitor (System Monitor) is used, which has long been known. You can access it either through the server manager or by running the perfmon command. After running the snap-in, you must add the counters described above and get visual information about the performance of the hypervisor.

After all the required counters are added and configured, you would very much like to keep all Performance Monitor parameters and use them in the future. To do this, right-click on the chart window and select "Save Settings As ...". All parameters will be saved to an .htm file, which can be opened at any time using Internet Explorer and retrieve system performance data.

I would like to pay attention to such a counter parameter as Scale, usually the counters are already given the right scale, but there may be a situation when it needs to be changed for more convenient graph display. For example, for the counter \ Hyper-V Virtual Network Adapter (*) \ Bytes / sec, at a scale of 0.00001 you will get a graph in Mbit / s. Tracking performance over a period of time.

Performance Monitor includes a handy Data Collector Sets tool that allows you to set up the necessary counters and collect workload data for a certain period of time, for example, over a week. Data collectors have many parameters, such as the schedule, the parameters for restarting and controlling the size of the report file, and security settings. All this allows you to automate the process of collecting performance data.

Automating the performance monitoring process.

The creation of Data Collectors can take a long time, especially when there are several Hyper-V servers, so it would be good idea to automate this process.

You can do this using the utility logman.exe. Type the command logman /? That would get a list of used parameters.

So, let's create two files that will automate the process of creating and launching the Data Collector Group.

First, it will be a bat file with the following content:

Line 1:

logman create counter HyperV_BASELINE -f bincirc -max 300 -si 2 -v -o "c: \ perflogs \ SERVERBASELINE" -cf "perfcounters.config"

Line 2:

Logman start HyperV_BASELINE

And the second, perfcounters.config, actually contains a list of counters, for example:

"\ Hyper-V Hypervisor Logical Processor (_Total) \% Total Run Time" "\ Logical Disk (*) \ Avg. Disk sec / Read" "\ Logical Disk (*) \ Avg. Disk sec / Write" "\ PhysicalDisk \ Average Disk Queue Length" "\ Memory \ Pages / sec" "\ Network Interface (*) \ Output Queue Length" ) \ Bytes Total / sec "" \ Hyper-V Virtual Network Adapter (*) \ Bytes / sec "

When you run the bat file, the Data Collector named HyperV_BASELINE with a maximum log file size of 300MB and a data collection interval of 2 hours will be created and started. A set of counters will be read from the file perfcounters.config. Now you can run files on each hypervisor. Or, it's much more convenient to change the bat-file of creating the Data Collector by adding parameters to it: -s

In this way, you can create and run Data Collectors over the network. The files should be located in a network folder accessible to each hypervisor for reading. It's worth noting that after the server is rebooted, the Data Collector does not start automatically. This can be solved by adding a bat-file with the following contents to startup: logman -s start HyperV_BASELINE

Conclusion.

We looked at how you can get visual information about the performance of Hyper-V hypervisor. This information will help you identify and eliminate bottlenecks in the system.

Original article - ]]>http://www.vmgu.ru/articles/microsoft-hyper-v-monitoring-without-scom]]>

0 0

Share the article with your friends in social networks, maybe it will be useful to them.


If the article helped you, you can >>thank the author<<


Comments