The more cores the merrier?

411 views
Skip to first unread message

mojosam

unread,
Jun 8, 2017, 12:48:57 AM6/8/17
to qubes-users
I'm thinking about replacing one of my computers. I don't know if that will be my Qubes machine or one of the others. I talked to the owner of the local mom & pop computer shop. I said that I was considering getting an AMD processor, because they have a lot of cores. He said that most applications don't take advantage of more than four cores. I said that I want to run a lot of VMs. He said even there it didn't matter much.

I'm guessing that he might be thinking of type 2 hypervisors, which are basically just another application running on Windows. I had assumed that a type 1 hypervisor such as Xen with Qubes would be different.

Does anybody know if that is true? If I buy a computer with 8 cores and set up a VM to use 2 virtual CPUs, does Qubes assign 2 cores to it?

If I have 3 VMs, each crunching intense numbers, does Qubes give them two cores each? (That leaves the other 2 cores for running the OS.)

Or is this naive, because CPUs and OSes are complex things and don't work that simplistically?

Or to simplify, assuming that an Intel CPU with 4 cores is roughly equivalent to an AMD CPU with 8 cores, would Qubes with a lot of open & busy VMs run a lot faster on the AMD machine?

Foppe de Haan

unread,
Jun 8, 2017, 1:43:47 AM6/8/17
to qubes-users

The number of cores allocated in Qubes is the maximum that single VM will use, if it has less to do, it'll just use fewer; so it's perfectly fine to allocate cores to more than one VM. I have a Ryzen 1600, with 4 threads assigned to most VMs, 8 to some, and 10 to my dev VM for compilation. Works fine that way. But if you intend to constantly run 3 concurrent CPU intensive tasks/VMs, it may make sense to assign them slightly more conservatively.

Leaving aside overclocking, in terms of total compute performance the 1600x (6c/12t) is the equal of the i7-7700k (4c/8t, higher IPC + clock speed) -> http://techreport.com/review/31979/amd-ryzen-5-cpus-reviewed-part-two/3 the 1500x (4c/8t) is superior to the i5-7500 (4c/4t), and the 1600 far superior to the i5-7600k (4c/4t) (https://www.youtube.com/watch?v=MgHnLu6k0D4 ). And due to the availability of the extra cores & threads, everything runs a lot smoother. But yeah, it'll definitely also be faster at the same price point.

Only issues atm are iommu support (which is there, but unpolished and still being worked on -- related to grouping/isolation), and doesn't fully work in Qubes 3.2), plus some other usual teething issues associated with the launch of a new platform (support for high speed memory, for instance).

mojosam

unread,
Jun 8, 2017, 3:49:05 AM6/8/17
to qubes-users
My question isn't about how many virtual CPUs to assign but whether a Qubes system with many cores is really faster than one with fewer cores. Does the OS know how to use many cores and do a good job of exploiting them?

Foppe de Haan

unread,
Jun 8, 2017, 4:14:00 AM6/8/17
to qubes-users
On Thursday, June 8, 2017 at 9:49:05 AM UTC+2, mojosam wrote:
> My question isn't about how many virtual CPUs to assign but whether a Qubes system with many cores is really faster than one with fewer cores. Does the OS know how to use many cores and do a good job of exploiting them?

Yes, so long as you use kernel 4.9.13 or newer (iirc that's the first iteration with Ryzen SMT support).

Vít Šesták

unread,
Jun 8, 2017, 4:53:24 AM6/8/17
to qubes-users
The only right question is: it depends.

Running many VMs does not imply you can utilize many cores. Scenarios like running sys-net, sys-firewall, sys-usb, a MusicVM, a WiresharkVM, an EmailVM and a WebBrowserVM is running many VMs at once, but maybe none of them will consume significant amount of CPU. Such situations are OK on my dualcore i7-7500U. Some VMs will be rather idle most of the time, some may consume rather I/O than CPU etc.

When considering many busy VMs running at once, it sounds rather like some server deployment than personal computer. But I admit there might be some such cases. Maybe you need to run multiple compilation/rendering/computation/whatever tasks simultaneously or you have some tasks that can utilize multiple cores at once. If that's your case, then many cores is probably a good choice.

Anyway, Qubes does not differ a much from other OSes in terms of CPU utilization. You are likely to have more VMs, but each of the VMs will likely use fewer resources. I see two differences in CPU utilization between QubesOS and traditional OSes like Ubuntu:

* Some virtualization-related overhead and some (usually not much CPU-intensive) processes run in multiple instances. I see this as rather minor overhead. And if this is your concern, you might be still more concerned about per-core performance than number of cores.
* GPU emulation overhead. In Qubes, no VM except dom0 has access to the GPU, so some tasks are done on the CPU instead of GPU. In 3D games, this can cause high CPU load. Moreover, such load can utilize multiple CPU cores (up to 8).[1] OpenSWR can utilize even more cores, but my experiments with OpenSWR[2] weren't encouraging as a general-purpose replacement of LLVMpipe. I haven't tested how well llvmpipe scales over CPU cores, but in theory, it should be able to scale rather well, as it replaces GPU, which is essentially a CPU with massive (SMT) parallelization.

Regards,
Vít Šesták

[1] https://www.mesa3d.org/llvmpipe.html
[2] https://groups.google.com/forum/#!searchin/qubes-users/openswr|sort:relevance/qubes-users/xtovhQq5pSI/YS14xlgkAAAJ

cooloutac

unread,
Jun 8, 2017, 10:22:02 AM6/8/17
to qubes-users
I still think clock speed matters more. If trying to budget I would focus on ram and i/o speed which would make a bigger difference in Qubes then how many cores. faster ram and lots of it and a big ssd should be more a priority.

Also you want to make sure that the board supports iommu/vt-d in the bios.

As far as if the linux kernel utilizing more cores more efficiently in general for the os, I really don't know if you would notice a difference. I don't when going from my dual core to quad core.

But I do notice a huge diff when using 2 cores vs 4 cores on my system assigned to a vm, but thats with 2.8ghz clock speed. On the 3.7ghz quadcore system. 2 cores assigned to a vm is perfectly fine and runs way faster.

If you plan on maxing out your cpu all the time, that probably still only means two vms running simultaneously maxing out 4 cores. Because as the guy at the store said, assigning 8 cores to a vm you prolly won't notice any diff.

mojosam

unread,
Jun 8, 2017, 4:13:26 PM6/8/17
to qubes-users
All of this more or less answers my question. I'm not planning on having a lot of VMs busy simultaneously. I do expect to have a lot of VMs open for various purposes. Most will be idle much of the time. Some might be doing a thing or two. It sounds like a fast quad-core processor with gobs of RAM is the best approach for that situation.

Vít Šesták

unread,
Jun 10, 2017, 2:15:55 AM6/10/17
to qubes-users
I have to agree with cooloutac.

Btw, with new laptop, I've switched from quad-core to dual-core (with higher per-core performance) and I don't regret. This is not to discourage you from quad-core, I'd probably also go for quad-core if I could: However, with laptops, I was much constrainted when looking for high-end laptop without dedicated GPU. If it is a desktop computer, you're in a bit easier position with QubesOS and high-end hardware.

Regards,
Vít Šesták 'v6ak'
Reply all
Reply to author
Forward
0 new messages