Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Software optimization for virtual machines

When you know that your software (not a driver, not part of the os, just an application) will run mostly in a virtualized environment are there strategies to optimize your code and/or compiler settings? Or any guides for what you should and shouldn't do?

This is not about a 0.0x% performance gain but maybe, just maybe there are simple things that will improve performance drastically or things that seem simple but are known to be disastrous in virtualized environments. For example enabling CONFIG_PARAVIRT in a kernel build is easily done and can boost performance a lot. Now I'm looking for similar things for applications, if there are any.

In my case it will be C++ Code and probably VMWare but I want to keep the question as language/product-agnostic as possible. I wonder if there even are such strategies or if this would be a complete waste of time - after all the concept of virtualization is that you don't have to care too much about it.

like image 360
VolkerK Avatar asked Mar 05 '09 08:03

VolkerK


People also ask

What is virtual machine optimization?

Optimizing the virtual machine (VM) migration is an important issue of server consolidation in the cloud data center. By leveraging the content similarity among the memory of VMs, the time and the amount of transferred data in VM migration, as well as the pressure of network traffic, can be reduced.

What software is used to create virtual machines?

There are many different virtual machine programs you can use. Some options are VirtualBox (Windows, Linux, Mac OS X), VMware Player (Windows, Linux), VMware Fusion (Mac OS X) and Parallels Desktop (Mac OS X).


1 Answers

I've found it to be all about I/O.

VMs typically suck incredibly badly at IO. This makes various things much worse than they would be on real tin.

Swapping is especially a bad killer - it completely wrecks VM performance, even a little, as IO is so slow.

Most implementations have a large amount of IO contention between VMs, I've not seen one which avoids this or handles it sensibly.

So use a ramdisc for temporary files if you can, but don't cause it to swap, because that would be even worse.

like image 83
MarkR Avatar answered Oct 20 '22 10:10

MarkR