11

Where I work we are running relatively powerful PCs using the Debian Linux Distribution. However for certain programs which we need to install it would be better to have CentOS and these would be our main work tools. Changing the OS for all of the computers in our workplace is a possibility, but we are trying to decide if using VirtualBox is a better choice for simplicity.

This all hinges on the following point. The programs we need to run are simulators which are very processor intensive tasks that can easily run up to an hour or more each time a simulation is launched. We need to decide if the performance degradation when using Virtual Box is large enough to merit our change of OS.

So my question is if anyone can verifiably tell me what is the performance hit from running a processor intensive task in virtual box versus running it on the native PC?

Thanks.

12

For number-crunching programs (very CPU-bound), there should be almost zero performance hit for the VM. The instructions run directly on the CPU, which is the same for host and VM.

Even for serious compilation tasks, the performance difference is hardly noticeable. We run CentOS VMs in VMware on Windows.

Since you're running Linux on the host, you might also consider KVM (Kernel Virtual Machine) instead of VirtualBox. It is a series of kernel modules that provides virtualization services in Linux, using the Intel VT-x virtualization extensions available on most all modern CPUs. QEMU uses KVM as an accellerator to run x86 code directly on the host CPU.

Just install the virt-manager to try it out.

  • Ok. I'll give that a shot. Thanks for the reply. – aarelovich Feb 3 '16 at 11:10
  • How does, performance wise, KVM compare to VirtualBox (Let's say running Windows 10 on Linux System)? – Royi May 8 '18 at 20:46
  • They should be nearly identical if VirtualBox is leveraging the CPU virtualization extensions (like KVM does), and the workload is mostly CPU bound. If the tasks are I/O heavy, the performance will vary depending on the selected hardware. KVM has paravirtualized drivers (virtio) that can greatly surpass that of emulated devices (e.g. E1000 NIC and LSI SCSI disk controller). Generally though they should be reasonably close. – Jonathon Reinhart May 9 '18 at 0:40
5

There is no one single good answer to this. It depends a lot on how you use a VM and on which programs.

E.g. using VMWare (a type 2 hypervisor) and a purely CPU bound program yielded almost full CPU speed. If I used the same hypervisor an a program with a lot of system calls I would get a serious slowdown.

And things also change when you use a type 1 hypervisor (no guest) OS. And even between those you have lots of variations. E.g. Xen with 5 (IIRC from last weekends FOSDEM talk on Xen) modes which it supports. From HW using to para virtualised.

To recap: As asked it can vary from almost no slowdown to seriously slower.


Now if I focus on VirtualBox, that is a type 2 hypervisor. Purely CPU bound programs should be fine.

  • Most of these programs essentialy trasnform a language into C Code and compile it. When we run a simulation this compilation is what is run. Accoridng to you, then it should be fine? – aarelovich Feb 3 '16 at 8:55
  • I suspect performance will be fine. My virtual box experience is limited (I mostly used VMware workstation), but I see no technical reasons why it should be slow. – Hennes Feb 3 '16 at 8:57
  • How does, performance wise, KVM compare to VirtualBox (Let's say running Windows 10 on Linux System)? – Royi May 8 '18 at 20:46
4

Actually, it sounds like Docker might be an even better option for what you're doing. Docker provides containers, which are isolated sandbox that run atop the same kernel. The system call / IO overhead is zero, since your in-container processes are no different than those on the host.

Since you're already running Linux, Docker would be a great way to provide a CentOS environment without having to reinstall all your machines.

Also, check out my utility, Scuba which makes it easy to run things like builds inside a Docker container. Instead of running make you would run scuba make. That's all!

  • Let me know if you'd like to try this out and need any help getting started. – Jonathon Reinhart Oct 24 '16 at 13:03
  • Thanks but this was a long time ago and the decision was made to do the move. But I will take this into account when having to run a program that has problems running con CentOS. – aarelovich Oct 24 '16 at 14:57

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.