Michael_Harvey
Contributor
Contributor

Can VMware emulateing SMP test environment in a VM

I would like to test program behaviour in an SMP environment (sequential multiprocessing) using VMWare. I tried this before with a 2 processor version 5.x VM in a dual core host Intel Pentium D CPU 2.80GHz, but the behaviour was not exactly like the physical machine. I could not get a particular bug to occur in the VM. Is it recommended to use physical machines for serious SMP testing?

0 Kudos
4 Replies
awong505
Enthusiast
Enthusiast

For serious SMP testing I would recommend ESX or a physical machine over Workstation/server as you have much more control over CPU allocation/shares/etc.

larstr
Champion
Champion

It is possible, however with a few limitations. To use vsmp you should at least have 4 cpu cores, and in order to get good performance, two of those cores (who should live on the same socket) should be dedicated for running this VM only. If you're not doing it this way you will quickly get bad performance.

Lars

0 Kudos
Michael_Harvey
Contributor
Contributor

Thanks, can you give me some examples how I can control CPU allocation/shares from a user mode .dll written in C/C++, when I do not create the process? Ideally, I would like to force the process to use only one CPU to avoid certain random sequencing differences that are undesirable and I do not yet fully understand.

0 Kudos
larstr
Champion
Champion

As awong505 said, cpu allocation/shares can only be controlled on ESX, and then you'll have to use the VMware Infrastructure SDK[/url], or you do it manually using the VIC[/url].

Also, when you run a guest VM you don't really know from the VM which cpu(s) that this VM is using as the vcpus are being load balanced on the pcpus depending on the load.

It is however possible to specify that a single VM should only use specified pcpu(s), but this is not normally recommended as the general performance of the system will be worse, but if you're using vsmp, your vsmp enabled VM(s) will benefit from having exclusive affinity to pcpus.

Lars