VMs have a slow performance when using CPU intensive tasks.
- Task execution on the VM seems slower after migrating the VM from one HV to the other.
- Poor performance on the VM.
- Applications running on the VM take a long time to launch.
- Multi-user services have long transaction times or can handle less simultaneous users than expected
- Machine becomes unresponsive
Issues regarding VM performance, unless very obvious are very difficult to identify as perception plays a big role on how things should work. In order to really compare you need to gather some information and create a satisfactory base-mark/bench-mark.
Here is an example on how to gather that information :
1. Execute a CPU intensive task and use time to see how long it takes for the task to complete
until [ $COUNTER -lt 10 ]; do
echo $((333**999)) 1>/dev/null 2>&1
2. In this case I am using this little script called cpuperf, it is used along with time to "time" the execution
vmtest:~ $ time ./cpuperf
vmtest:~ $ time ./cpuperf
As you can see the same script on the same vm in each Hypervisor has a different performance, that is clearly an issue with the execution times, it takes almost double the time in HV2.
We have identified some performance issues when running Xen 3.x.x, this seems to be down to the BIOS CPU scaling configuration.
As per Xen.org wiki
NB: Many systems have features that will scale down the computing power of a CPU that is not 100% utilized. This can be in the operating system, but can also sometimes be below the operating system, in the BIOS. If you set a cap such that individual cores are running at less than 100%, this may have an impact on the performance of your workload over and above the impact of the cap. For example, if your processor runs at 2GHz, and you cap a vm at 50%, the power management system may also reduce the clock speed to 1GHz; the effect will be that your VM gets 25% of the available power (50% of 1GHz)rather than 50% (50% of 2GHz). If you are not getting the performance you expect, look at performance and cpufreq options in your operating system and your BIOS.
In order to mitigate the issue, we have a check list that seems to be solving the Issue at the hardaware level:
- Update your BIOS firmware to the latest
- Disable the feature for "automatically downscaling the cpus".
Deactivating this feature have proven to boost the performance.
Also other features identified for downscaling:
Core performance boost mode (disabled)
Processor HPC Mode (disabled).
Please talk to your manufacturer also in order to understand if you need to enable/disable any other features.