Hyper-V MPE 2016 Context Switches/Sec

HyperV.MPE.2016.LogicalProcessor.ContextSwitches.Monitor (UnitMonitor)

Knowledge Base article:

Summary

This measures the rate (number of times per second) each logical CPU changes what virtual processor it is running.

This counter must be used in context with all other activity based counters (CPU, Disk and Network, latency and throughput).

Resolutions

- Check Virtual Machine configuration (particularly remove / disable any active and busy emulated devices)

- Check if the Virtual Machine Configuration Version is Up to Date.

- Check host operating system utilization Root VP CPU usage (host OS utilization) - see the "Hyper-V Hypervisor Root Virtual Processor" counter section for the specifics.

- Check drivers - particularly network and storage drivers, but other too.

- Check for significant inconsistency across your hosts - it can indicate significant configuration or load differences.

Element properties:

TargetHyperV.MPE.2016.LogicalProcessor
Parent MonitorSystem.Health.PerformanceState
CategoryPerformanceHealth
EnabledTrue
Instance NameHyper-V Hypervisor Logical Processor
Counter NameContext Switches/sec
Frequency60
Alert GenerateTrue
Alert SeverityMatchMonitorHealth
Alert PriorityNormal
Alert Auto ResolveTrue
Monitor TypeSystem.Performance.ConsecutiveSamplesThreshold
RemotableTrue
AccessibilityPublic
Alert Message
Hyper-V MPE 2016 Alert: Context Switches/Sec

Instance {0}
Object {1}
Counter {2}
Has a value {3}
RunAsDefault

Source Code:

<UnitMonitor ID="HyperV.MPE.2016.LogicalProcessor.ContextSwitches.Monitor" Accessibility="Public" Enabled="true" Target="HVMPE2016Dis!HyperV.MPE.2016.LogicalProcessor" ParentMonitorID="SHLib!System.Health.PerformanceState" Remotable="true" Priority="Normal" TypeID="SPerf!System.Performance.ConsecutiveSamplesThreshold" ConfirmDelivery="false">
<Category>PerformanceHealth</Category>
<AlertSettings AlertMessage="HyperV.MPE.2016.LogicalProcessor.ContextSwitches.Monitor_AlertMessageResourceID">
<AlertOnState>Warning</AlertOnState>
<AutoResolve>true</AutoResolve>
<AlertPriority>Normal</AlertPriority>
<AlertSeverity>MatchMonitorHealth</AlertSeverity>
<AlertParameters>
<AlertParameter1>$Data/Context/InstanceName$</AlertParameter1>
<AlertParameter2>$Data/Context/ObjectName$</AlertParameter2>
<AlertParameter3>$Data/Context/CounterName$</AlertParameter3>
<AlertParameter4>$Data/Context/SampleValue$</AlertParameter4>
</AlertParameters>
</AlertSettings>
<OperationalStates>
<OperationalState ID="ConditionFalse" MonitorTypeStateID="ConditionFalse" HealthState="Success"/>
<OperationalState ID="ConditionTrue" MonitorTypeStateID="ConditionTrue" HealthState="Warning"/>
</OperationalStates>
<Configuration>
<ComputerName>$Target/Host/Property[Type="MSWinLib!Microsoft.Windows.Computer"]/NetworkName$</ComputerName>
<CounterName>Context Switches/sec</CounterName>
<ObjectName>Hyper-V Hypervisor Logical Processor</ObjectName>
<InstanceName>$Target/Property[Type="MSWinLib!Microsoft.Windows.LogicalDevice"]/DeviceID$</InstanceName>
<AllInstances>false</AllInstances>
<Frequency>60</Frequency>
<Threshold>20000</Threshold>
<Direction>greater</Direction>
<NumSamples>5</NumSamples>
</Configuration>
</UnitMonitor>