measuring performance on hyper-v

7
9/15/12 Measuring Performance on Hy per-V msdn.microsoft.com/en-us/library /cc768535(d=printer,v =bts.10).aspx Measuring Disk I/O Performance Note Measuring Performance on Hyper-V While most of the principles of analyzing performance of a guest operating system installed on a Hyper-V virtual machine performance are the same as analyzing the performance of an operating system installed on a physical machine, many of the collection methods are different. The following considerations are significant when evaluating performance of your BizTalk Server solution running on a guest operating system installed on a Hyper-V virtual machine. The following considerations apply when measuring disk I/O performance on a guest operating system installed on a Hyper-V virtual machine: Measure disk latency on a Hyper-V host operating system – The best initial indicator of disk performance on a Hyper-V host operating system is obtained by using the “\Logical Disk(*)\Avg. sec/Read” and “\Logical Disk(*)\Avg. sec/Write” performance monitor counters. These performance monitor counters measure the amount of time that read and write operations take to respond to the operating system. As a general rule of thumb, average response times greater than 15ms are considered sub-optimal. This is based on the typical seek time of a single 7200 RPM disk drive without cache. The use of logical disk versus physical disk performance monitor counters is recommended because Windows applications and services utilize logical drives represented as drive letters wherein the physical disk (LUN) presented to the operating system can be comprised of multiple physical disk drives in a disk array. Use the following rule of thumb when measuring disk latency on the Hyper-V host operating system using the \Logical Disk(*)\Avg. Disk sec/Read or \Logical Disk(*)\Avg. Disk sec/Write performance monitor counters: 1ms to 15ms = Healthy 15ms to 25ms = Warning or Monitor 26ms or greater = Critical, performance will be adversely affected Physical disks installed on a non-virtualized environment offer better performance than disks accessed through a Hyper-V host operating system. If disk performance is absolutely critical to the overall performance of your application, consider hosting disks on physical hardware only. Measure disk latency on guest operating systems – Response times of the disks used by the guest operating systems can be measured using the same performance monitor counters used to measure response times of the disks used by the Hyper-V host operating system. For more information about disk performance analysis, see the following resources: Ruling Out Disk-Bound Problems at http://go.microsoft.com/fwlink/?LinkId=120947 1 . SQL Server Predeployment I/O Best Practices at http://go.microsoft.com/fwlink/? LinkId=120948 2 . How to Identify a Disk Performance Bottleneck Using the Microsoft Server Performance Advisor (SPA) Tool at http://go.microsoft.com/fwlink/?LinkID=98096 3 .

Upload: enrik-zaimaj

Post on 28-Oct-2014

18 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Measuring Performance on Hyper-V

9/15/12 Measuring Performance on Hy per-V

msdn.microsoft.com/en-us/library /cc768535(d=printer,v =bts.10).aspx

Measuring Disk I/O Performance

Note

Measuring Performance on Hyper-V

While most of the principles of analyzing performance of a guest operating system installed on aHyper-V virtual machine performance are the same as analyzing the performance of an operatingsystem installed on a physical machine, many of the collection methods are different. The followingconsiderations are significant when evaluating performance of your BizTalk Server solution running ona guest operating system installed on a Hyper-V virtual machine.

The following considerations apply when measuring disk I/O performance on a guest operatingsystem installed on a Hyper-V virtual machine:

Measure disk latency on a Hyper-V host operating system – The best initial indicator ofdisk performance on a Hyper-V host operating system is obtained by using the “\LogicalDisk(*)\Avg. sec/Read” and “\Logical Disk(*)\Avg. sec/Write” performance monitor counters.These performance monitor counters measure the amount of time that read and writeoperations take to respond to the operating system. As a general rule of thumb, averageresponse times greater than 15ms are considered sub-optimal. This is based on the typicalseek time of a single 7200 RPM disk drive without cache. The use of logical disk versusphysical disk performance monitor counters is recommended because Windows applicationsand services utilize logical drives represented as drive letters wherein the physical disk (LUN)presented to the operating system can be comprised of multiple physical disk drives in a diskarray. Use the following rule of thumb when measuring disk latency on the Hyper-V hostoperating system using the \Logical Disk(*)\Avg. Disk sec/Read or \Logical Disk(*)\Avg. Disksec/Write performance monitor counters:

1ms to 15ms = Healthy

15ms to 25ms = Warning or Monitor

26ms or greater = Critical, performance will be adversely affected

Physical disks installed on a non-virtualized environment offer better performance thandisks accessed through a Hyper-V host operating system. If disk performance isabsolutely critical to the overall performance of your application, consider hosting diskson physical hardware only.

Measure disk latency on guest operating systems – Response times of the disks usedby the guest operating systems can be measured using the same performance monitorcounters used to measure response times of the disks used by the Hyper-V host operatingsystem.

For more information about disk performance analysis, see the following resources:

Ruling Out Disk-Bound Problems at http://go.microsoft.com/fwlink/?LinkId=1209471.

SQL Server Predeployment I/O Best Practices at http://go.microsoft.com/fwlink/?

LinkId=1209482.

How to Identify a Disk Performance Bottleneck Using the Microsoft Server Performance

Advisor (SPA) Tool at http://go.microsoft.com/fwlink/?LinkID=980963.

Page 2: Measuring Performance on Hyper-V

9/15/12 Measuring Performance on Hy per-V

msdn.microsoft.com/en-us/library /cc768535(d=printer,v =bts.10).aspx

Measuring Memory Performance

Measuring Network Performance

Use the following performance monitor counters to measure the impact of available memory on theperformance of a guest operating system installed on a Hyper-V virtual machine:

Measure available memory on the Hyper-V host operating system – The amount ofphysical memory available to the Hyper-V host operating system can be determined bymonitoring the “\Memory\Available MBytes” performance monitor counter on the physicalcomputer. This counter reports the amount of free physical memory available to the hostoperating system. Use the following rules of thumb when evaluating available physicalmemory available to the host operating system:

\Memory\Available Mbytes – Available MBytes measures the amount of physicalmemory available to processes running on the computer, as a percentage of physicalmemory installed on the computer. The following guidelines apply when measuring thevalue of this performance monitor counter:

50% of free memory available or more = Healthy

25% of free memory available = Monitor

10% of free memory available = Warning

Less than 5% of free memory available = Critical, performance will be adverselyaffected

\Memory\Pages/sec – This performance monitor counter measures the rate atwhich pages are read from or written to disk to resolve hard page faults. To resolvehard page faults, the operating system must swap the contents of memory to disk,which negatively impacts performance. A high number of pages per second incorrelation with low available physical memory may indicate a lack of physical memory.The following guidelines apply when measuring the value of this performance monitorcounter:

Less than 500 = Healthy

500 - 1000 = Monitor or Caution

Greater than 1000 = Critical, performance will be adversely affected

For more information about the impact of available physical memory on application serverperformance, see the Exchange Server 2003 Help topic “Ruling Out Memory-Bound Problems”

at http://go.microsoft.com/fwlink/?LinkId=1210564.

Measure available memory on the guest operating system – Memory that is availableto the guest operating systems can be measured with the same performance monitorcounters used to measure memory available to the Hyper-V host operating system.

Hyper-V allows guest computers to share the same physical network adapter. While this helps toconsolidate hardware, take care not to saturate the physical adapter. Use the following methodsto ensure the health of the network used by the Hyper-V virtual machines:

Test network latency – Ping each virtual machine to ensure adequate network latency. Onlocal area networks, expect to receive less than 1ms response times.

Page 3: Measuring Performance on Hyper-V

9/15/12 Measuring Performance on Hy per-V

msdn.microsoft.com/en-us/library /cc768535(d=printer,v =bts.10).aspx

Test for packet loss – Use the pathping.exe utility to test packet loss between virtualmachines. Pathping.exe measures packet loss on the network and is available with allversions of Windows Server since Windows Server 2000. Pathping.exe sends out a burst of100 ping requests to each network node and calculates how many pings are returned. Onlocal area networks there should be no loss of ping requests from the pathping.exe utility.

Test network file transfers – Copy a 100MB file between virtual machines and measure thelength of time required to complete the copy. On a healthy 100Mbit (megabit) network, a100MB (megabyte) file should copy in 10 to 20 seconds. On a healthy 1Gbit network, a100MB file should copy in about 3 to 5 seconds. Copy times outside of these parameters areindicative of a network problem. One common cause of poor network transfers occurs whenthe network adapter has “auto detected” a 10MB half-duplex network which prevents thenetwork adapter from taking full advantage of available bandwidth.

Measure network utilization on the Hyper-V host operating system – Use the followingperformance monitor counters to measure network utilization on the Hyper-V host operatingsystem:

\Network Interface(*)\Bytes Total/sec – The percentage of network utilization iscalculated by multiplying Bytes Total/sec by 8 to convert it to bits, multiply the resultby 100, then divide by the network adapter’s current bandwidth. Use the followingthresholds to evaluate network bandwidth utilization:

Less than 40% of the interface consumed = Healthy

41%-64% of the interface consumed = Monitor or Caution

65-100% of the interface consumed = Critical, performance will be adverselyaffected

\Network Interface(*)\Output Queue Length – The output queue length measuresthe number of threads waiting on the network adapter. If there are more than 2threads waiting on the network adapter, then the network may be a bottleneck.Common causes of this are poor network latency and/or high collision rates on thenetwork. Use the following thresholds to evaluate output queue length:

0 = Healthy

1-2 = Monitor or Caution

Greater than 2 = Critical, performance will be adversely affected.

Ensure that the network adapters for all computers (physical and virtual) in thesolution are configured to use the same value for maximum transmission unit (MTU).For more information about configuring the MTU value see “Appendix A: TCP/IP

Configuration Parameters” at http://go.microsoft.com/fwlink/?LinkId=1137165.

If an output queue length of 2 or more is measured, consider adding one or morephysical network adapters to the physical computer that hosts the virtual machinesand bind the network adapters used by the guest operating systems to these physicalnetwork adapters.

Measure network utilization on the guest operating systems – If a network adapter onthe Hyper-V root partition is busy as indicated by the performance monitor countersmentioned above, then consider using the "\Hyper-V Virtual Network Adapter(*)\Bytes/sec"performance monitor counter to identify which virtual network adapters are consuming themost network utilization.

For more information about network performance analysis, see “Chapter 15 - Measuring .NET

Page 4: Measuring Performance on Hyper-V

9/15/12 Measuring Performance on Hy per-V

msdn.microsoft.com/en-us/library /cc768535(d=printer,v =bts.10).aspx

Measuring Processor Performance

Application Performance” at http://go.microsoft.com/fwlink/?LinkId=1210736.

The following considerations apply when evaluating processor performance on a guest operatingsystem installed on a Hyper-V virtual machine:

Guest operating system processors do not have a set affinity to physicalprocessors/cores – The hypervisor determines how physical resources are used. In thecase of processor utilization, the hypervisor schedules the guest processor time to physicalprocessor in the form of threads. This means the processor load of virtual machines will bespread across the processors of the physical computer. Furthermore, virtual machinescannot exceed the processor utilization of the configured number of logical processors, forexample if a single virtual machine is configured to run with 2 logical processors on aphysical computer with 8 processors/cores, then the virtual machine cannot exceed theprocessor capacity of the number of configured logical processors (in this case 2processors).

Measure guest operating system processor utilization – Traditionally, processorperformance can be measured using the “\Processor(*)\% Processor Time” performancemonitor counter. This is not an accurate counter for evaluating processor utilization of aguest operating system though because Hyper-V measures and reports this value relative tothe number of processors allocated to the virtual machine. If more processors are allocatedto running virtual machines than are actually present on the physical computer, the valuereturned by each guest operating system for the “\Processor(*)\% Processor Time”performance monitor counter will be low, even if in fact processor utilization is a bottleneck.This occurs because the virtual processors utilize the physical processors in a round-robinfashion. Each virtual processor will try and allocate itself a share of overall systemresources, so in a 4 physical processor system, each virtual processor will by default try toutilize 25% of the system resources. If 8 virtual processors are created this means thatcollectively the virtual processors will attempt to utilize 200% of the server CPU capacity. Inthis case, each virtual processor will report a low utilization as measured by the“\Processor(*)\% Processor Time” performance monitor counter (relative to the level itexpects) and the excessive context switching between the virtual processors will result inpoor performance for each virtual machine. In this scenario, consider reducing the number ofvirtual processors allocated to Hyper-V virtual machines on the host operating system.Hyper-V provides hypervisor performance objects to monitor the performance of both logicaland virtual processors. A logical processor correlates directly to the number of processors orcores that are installed on the physical computer. For example, 2 quad core processorsinstalled on the physical computer would correlate to 8 logical processors. Virtual processorsare what the virtual machines actually use, and all execution in the root and child partitionsoccurs in virtual processors.To accurately measure the processor utilization of a guest operating system, use the“\Hyper-V Hypervisor Logical Processor(_Total)\% Total Run Time” performance monitorcounter on the Hyper-V host operating system. Use the following thresholds to evaluateguest operating system processor utilization using the “\Hyper-V Hypervisor LogicalProcessor(_Total)\% Total Run Time” performance monitor counter:

Less than 60% consumed = Healthy

60% - 89% consumed = Monitor or Caution

90% - 100% consumed = Critical, performance will be adversely affected

To troubleshoot processor performance of guest operating systems on a Hyper-Venvironment, it is best to strive for a balance between the values reported by the hostoperating system for “\Hyper-V Hypervisor Logical Processor(_Total)\% Total Run Time”(LPTR) and “\Hyper-V Hypervisor Virtual Processor(_Total)\% Total Run Time” (VPTR). IfLPTR is high and VPTR is low then verify that there are not more processors allocated tovirtual machines than are physically available on the physical computer. Use the “\Hyper-V

Page 5: Measuring Performance on Hyper-V

9/15/12 Measuring Performance on Hy per-V

msdn.microsoft.com/en-us/library /cc768535(d=printer,v =bts.10).aspx

Hypervisor Virtual Processor(*)\%Guest Run Time” counters to determine which virtualProcessors are consuming CPU and de-allocate virtual processors from virtual machines asappropriate to configure a one to one mapping of virtual processors to logical processors.For more information about configuring a one to one mapping of virtual processors to logicalprocessors see the “Optmizing Processor Performance” section in Optimizing Performance on

Hyper-V7. If VPTR is high and LPTR is low then consider allocating additional processors tovirtual machines if there are available logical processors and if additional processors aresupported by the guest operating system. In the case where VPTR is high, LPTR is low,there are available logical processors to allocate, but additional processors are notsupported by the guest operating system, consider scaling out by adding additional virtualmachines to the physical computer and allocating available processors to these virtualmachines. In the case where both VPTR and LPTR are high, the configuration is pushing thelimits of the physical computer and should consider scaling out by adding another physicalcomputer and additional Hyper-V virtual machines to the environment. The flowchart belowdescribes the process that should be used when troubleshooting processor performance in aHyper-V environment.

Page 6: Measuring Performance on Hyper-V

9/15/12 Measuring Performance on Hy per-V

msdn.microsoft.com/en-us/library /cc768535(d=printer,v =bts.10).aspx

Measure overall processor utilization of the Hyper-V environment using Hyper-Vperformance monitor counters – For purposes of measuring processor utilization, the hostoperating system is logically viewed as just another guest operating system. Therefore, the

Page 7: Measuring Performance on Hyper-V

9/15/12 Measuring Performance on Hy per-V

msdn.microsoft.com/en-us/library /cc768535(d=printer,v =bts.10).aspx

© 2012 Microsoft. All rights reserved.

“\Processor(*)\% Processor Time” monitor counter measures the processor utilization of thehost operating system only. To measure total physical processor utilization of the hostoperating system and all guest operating systems, use the “\Hyper-V Hypervisor LogicalProcessor(_Total)\% Total Run Time” performance monitor counter. This counter measuresthe total percentage of time spent by the processor running the both the host operatingsystem and all guest operating systems. Use the following thresholds to evaluate overallprocessor utilization of the Hyper-V environment using the “\Hyper-V Hypervisor LogicalProcessor(_Total)\% Total Run Time” performance monitor counter:

Less than 60% consumed = Healthy

60% - 89% consumed = Monitor or Caution

90% - 100% consumed = Critical, performance will be adversely affected

For more information about processor utilization review the following resources:

“How To: Identify Functions causing a High User-mode CPU Bottleneck for ServerApplications in a Production Environment” at http://go.microsoft.com/fwlink/?

LinkID=1070478.

“Chapter 15 - Measuring .NET Application Performance” at http://go.microsoft.com/fwlink/?

LinkId=1210736.

Links Table

1http://go.microsoft.com/fwlink/?LinkId=120947

2http://go.microsoft.com/fwlink/?LinkId=120948

3http://go.microsoft.com/fwlink/?LinkID=98096

4http://go.microsoft.com/fwlink/?LinkId=121056

5http://go.microsoft.com/fwlink/?LinkId=113716

6http://go.microsoft.com/fwlink/?LinkId=121073

7http://msdn.microsoft.com/en-us/library/cc768529(v=bts.10).aspx

8http://go.microsoft.com/fwlink/?LinkID=107047

Community Content