Virtual Machine CPU Ready: Read It From SQL Server

Virtual Machine CPU Ready: Read It From SQL Server

Is the host holding your server back? That is the question to bring to this screen, where virtual machine CPU ready shows up only by its footprints. Land first on the CPU time to elapsed time value in the indicator list. Skip the largest figure you can find. A big millisecond count only says a request ran for a long while, whereas this ratio says whether it was actually getting a processor during that while.

How can I tell from inside SQL Server whether virtual machine CPU ready is slowing my queries? SQL Server cannot read virtual machine CPU ready directly, but it can show the effects. Compare CPU time with elapsed time for running, single-threaded requests; under 0.85 is a warning. Check signal waits, timer lateness and memory shortfall too. Then ask your virtualization team for CPU ready and co-stop figures.

The screen is the Hypervisor Contention Indicators report in Database Health Monitor. It works entirely from inside the guest. No vCenter connection, no Hyper-V credentials.

Hypervisor Contention Indicators is one of the reports in Database Health Monitor. It runs against your own servers, and it takes about a minute to have this same screen open on one of them.

Read the virtual machine CPU ready clues in order

A thread that is really on a CPU should collect about one millisecond of CPU time per millisecond of clock time. So the expected ratio is close to 1.00. Below 0.85, the indicator is past its warning line.

The filter behind that number is strict, and you should know it before quoting the result to anyone. A request counts only if it was running, not waiting, and on one thread at every poll across the sample. Parallel requests are excluded, since their CPU time sums every thread and would flatter the figure. Runnable requests never count either. They are queued behind a SQL Server scheduler, which is your own workload and not the host.

At least five requests have to qualify. Otherwise the page says not enough running requests, and you try again under load.

Next, read down the other three verdict inputs.

OrderIndicatorWarning whenWhat it adds
1CPU time to elapsed timeUnder 0.85Running work is being shortchanged
2Signal wait share of all waitsOver 25 percent with fewer than 2 runnable tasks per schedulerThreads are slow to resume although queues are short
3Timer excess on a 100 ms WAITFOR99th percentile over 50 msEven a sleeping thread wakes late
4Committed memory against targetUnder 90 percent while the machine is short of memoryPossible ballooning

Two more values sit beside these and cast no vote. Runnable tasks per scheduler is there to qualify the signal wait row: a high share with long queues points back at SQL Server itself. Available physical memory and the process memory low flag are context.

What a healthy sample looks like

Quiet is boring. The ratio sits near 1.00, none of the four inputs is past its threshold, and the verdict reads no sign of contention.

Don't over-read it. The default sample is 60 seconds, with 30 and 120 available on the toolbar, and a host that was generous for that one minute may be stingy twenty minutes later when the batch jobs on neighboring guests kick off. Run it while the slowness is happening. A clean result from a calm period clears nobody.

One trap deserves its own mention. Committed memory below target is perfectly normal while the buffer pool is still growing after a start, so that row only counts when the whole machine is also short of memory. If your trouble is queries lining up for workspace memory, that is a separate investigation, covered in Memory Grant Waits: Find the Queries That Queued.

When the verdict calls for action

The verdict is a simple count. One indicator past its threshold gives possible contention. Two or more gives probable CPU contention from the host.

Take a headline reporting that running requests received 71 percent of the CPU time their elapsed time implied, with signal waits at 34 percent of all waits. The first number is well under 85. The second is over 25, and counts provided the runnable queues are short. That makes two, so the page says probable and tells you to request CPU ready and co-stop for the VM.

A single flag is weaker. Sample again during the next slow spell and see whether it holds, or whether a second one joins it.

A server that SQL Server reports as physical gets not a virtual machine, with the counters still shown. On SQL Server 2008 R2 the virtual flag and committed memory figures aren't read at all, so the verdict rests on whatever the remaining indicators support.

Drill into the evidence, then make the call

Below the indicators, the evidence grid names the requests behind the ratio, lowest first. Each row gives the session, the number of polls, CPU milliseconds, elapsed milliseconds, the ratio and the start of the statement. Check whether the shortfall is spread across several sessions or rests on one odd one.

The What to ask list turns all this into a request the other team can act on:

  • VMware: CPU ready, co-stop, and ballooned and swapped memory
  • Hyper-V: virtual processor wait time and guest run time
  • Either: host CPU commitment and any vCPU limits on this guest

It also lists the thresholds those teams use. Right-click the grid to copy the findings as text, and paste them into the ticket with the time you sampled.

Be honest about what you are sending. This is inference. The hypervisor counters are definitive, and cloud steal accounting on Azure or AWS is not read. If the evidence points elsewhere, the Related Links bar goes to Host and Hardware, SQL CPU Schedulers, Memory Pressure and Storage Latency Now. Data sources and rules are listed on the Hypervisor Contention Indicators help page.

What to check on your own server

  • Confirm your monitoring login holds VIEW SERVER STATE before the next incident arrives
  • Time a 100 millisecond WAITFOR DELAY once a second for half a minute, logging each late wake-up
  • Record free physical memory and its state from sys.dm_os_sys_memory, plus the low flag in sys.dm_os_process_memory
  • Repeat both readings while users are complaining, because a calm sample cannot clear the host

Try Database Health Monitor Today

Slow queries on a virtual machine leave you arguing with the host team without any evidence from inside SQL Server to show them. Database Health Monitor shows it on every instance you connect, in the time it takes to open the report.

Download Database Health Monitor and run the Hypervisor Contention Indicators report against your own server. There is nothing to configure first, and you will know inside a few minutes whether it tells you something you did not already know.

Leave a Reply

Your email address will not be published. Required fields are marked *

*

To prove you are not a robot: *