High system time on Windows running in a VM
Recently I've seen an issue with CPU usage on a server running Windows 2003 Server in a VMware. This is a small Virtual Machine with just 2 cores allocated (which are possibly mapped to "threads" on a host level but I don't know the details). For some reason very high System CPU time was reported in a Statspack report. Here is how it looks like in a 1 hour Statspack report: [sourcecode gutter="false"] Host CPU (CPUs: 2 Cores: 2 Sockets: 0) ~~~~~~~~ Load Average Begin End User System Idle WIO WCPU ------- ------- ------- ------- ------- ------- -------- 3.04 8.77 88.19 [/sourcecode] Note that the System CPU time is more than twice the User CPU time on average (remember the averages could be misleading sometimes). This caught my attention as usual. Although the average CPU used is not really high, this server is somewhat sluggish even for a one hop RDP connection over the VPN. I have tried to find out some details about what is going on. Since I'm not a Windows guy, I did not know what kind of tools could be used to track places in the OS kernel that take too much time. On Linux this is relatively easy starting with strace/pstack/perf utilities and other command line tools. Windows is different. I've started to search for the options available, and the first thing to find is of course Perfmon, which allows to track and visualize different OS related metrics (counters in Perfmon terminology) on a system, CPU, or process levels. I've used it to capture a few key metrics such as User Time, System Time (which is apparently called Privileged Time on Windows), Queue length and Context Switches per second. From a graph of the CPU usage the issue is visible:

Share this
You May Also Like
These Related Stories
How to get the most out of your EBS performance

How to get the most out of your EBS performance
Sep 5, 2019
3
min read
Distinguish real SQL execution plans from fake ones!
Distinguish real SQL execution plans from fake ones!
Nov 3, 2016
7
min read
Is slave_exec_mode idempotent actually idempotent?
Is slave_exec_mode idempotent actually idempotent?
Oct 17, 2018
6
min read
No Comments Yet
Let us know what you think