More is not always better – CPU ready in VMware vSphere

You might have a situation, when your 2 vCPU webserver is having a high load (although CPU usage in MHz is normal).

In this situation most administrators would add extra vCPUs to the server, and expect to have an enhanced performance.

Unfortunately the additional vCPU can actually degrade performance. Let me explain why.

Let’s assume a single socket quad core physical server with multiple VMs running on it. A 4 vCPU machine can utilize all 4 cores, but has to wait much more to get all 4 cores compared to the time a 1 vCPU machine has to wait for 1 of the cores.

For some kind of proof let’s take a look at a screenshot of a webserver’s CPU ready statistics from the past day. CPU ready is the time a VM has spent waiting to get the physical CPU.

cpu_ready_from1_to3_vCPU

The default update interval is 5 minutes (300.000 ms).

The server had serious performance problems shortly after 2pm. No wonder, the VM was waiting for CPU half time of the 5m interval. For shorter intervals it must have been even worse.

After reducing the number of vCPUs from 3 to 1, the webserver is operating flawlessly. The CPU usage hasn’t changed significantly, but the CPU ready (waiting time for pCPU) dropped drastically. CPU ready doesn’t exceed 3000 ms, and that’s only 1% wait time compared to the previous 50%

The conversion between CPU summation and CPU % ready values are explained in the following Knowledge Base article: http://kb.vmware.com/kb/2002181

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s