I plan to build a workstation mainly for running virtual machines. There will be dozens of virtual machines and they do not execute computationally expensive tasks. I will use mainly Qemu(with KVM support) as an hypervisor. I am aware that I need to pick a CPU with VT-x/AMD-v support and I would benefit from Hyper-threading, but how do less high-frequency cores compare to more lower-frequency cores in hypervisor environment? Let's say for example quad-core Core i7-4790K overclocked to 5GHz versus octa-core Xeon E5-1428L v3 where all eight cores run at 2GHz. If any additional information is required then please ask.
You can look to benchmark comparison http://www.cpubenchmark.net/compare.php?cmp=2116&cmp=2275
If your VMs are computationally expensive, then faster / higher frequency cores are better, especially if the software you are running is not written to take advantage of multiple cores to perform calculations in parallel - multi-core or multi-processor is of no benefit if the software can not make use of them.
If your computationally-heavy software is written for parallel computation, then obviously the more cores AND the faster each core, the better.
If your VMs are computationally "light", then the more cores you have, the better even if each individual core is slower. Higher core frequencies will be of little or no benefit if the software you are running doesn't actually need it, if it spends most of its time idling. More cores, however, will be of benefit in this case because each core won't have to switch context as often to switch between VMs - the ideal situation would be around one core per VM...or, at least, as close to 1:1 as possible.
If most of the VMs are mostly idle most of the time, then higher ratios of 2 or 3 or more VMs per core would be perfectly viable. Economising like that is part of the point of virtualisation of machines after all - less rack space, less electricity consumed, lower hardware costs, etc.
Confronted with the same questions as you, here is what I found:
- Running CPU intensive tasks in VM makes no sense at all and quickly becomes management nightmare ( it will influence all VMs one way or another - no matter what your vendor marketing tells you)
- For low CPU usage more cores outperform high frequency because of context switches and cache management.
- Pretty much all of "professional" virtualization platforms use multi CPU setups with low-freq Xeons.
Considering all this, I am going with a second-hand 2*Xeon setup with 8 cores or more. It is even cheaper than some high-end i7
The answer to your question is that generally more frequency means higher processing speed and more cores/threads means better parallelism(more tasks are processed at the same time) and it should be a simple math problem but in the real world it depends on lots and lots of variables
1. Allocating Virtual cpu per core or per thread which can be detrimental to your VM's performance beside the not so obvious fact that overallocating to a VM could decrease its performance drastically.
for instance, your cpu has 8 cores but with hyperthreading they become 16 so you have 16 VCPUs ; if you allocate 1 VCPU to each VM which means 1 thread or half a core for each VM and you think thats enough for your VM then your VM could be faster than when it has got two threads(1 core) assigned
generally allocating on per core basis is less troublesome which means that xenon(with more cores) will probably outperform i7.
2. Overclocking = more speed ====> higher power-bill
Overclocking plus heat generated could render your system quite unstable and you will have to be very careful when choosing your power supply and your cooling system beside the fact that it depends on your country's atmosphere
- people who report i7 is stable while overclocking live in a cold country and i used to see people asking if their cpu's temp. being 50c is very high and if it could lead to damage ,and that totally bedazzled me as my cpu's temp. while idle is 40 something(my country's weather temp. could easily get to 55c)which means xenon is better for me because it will be more stable and cooling will cost less even if it is slower than the i7.
3. Natural Limitations
programming languages and most programs are not yet optimized to take full advantage of all cores but can go better with threads and thats why you will see that i7 generally outperforms the xeon which is supposed to be a timetraveler.
even GPUs can be much better than both if you require pure parallelism.
4. More RAM is as much important as cpu performance if not more
upgrading my p.c. from 2GB RAM to 6GB made starting programs take less than half the time taken before , increased speed a lot and my processor doesn't undergo as much stress as before
more processor cache is better too.
- i think you will need more than 16 GBs of Ram if you say "dozen" VMs which means that xeon is better .
5. Error correction, architecture and the way programs/scripts were written and compiled could make a processor slower than its less powerful counterpart.
6. Marketing people talking about and controlling what they can't understand thinking they "are" better than everyone which messes up everything.
7. Money Money Money Money Money Money (budget)
I think xeon e5-2687w v3 is the best in terms of computing power and life expectancy (vs. more powerful CPUs with more cores) as its all cores can be totally exploited , its cache is quite decent and at the same time it has a 3.1ghz freq which is very good but its very expensive in comparison to the i7 .