Score:0

QEMU SMP options

gs flag

I'm trying to understand the QEMU smp option.

Currently I have set it to:

smp 4

As far as I understand that should create 4 vCPU (with 1 core and 1 thread I suppose).

Would it be better for performance if I set it to:

smp 1,sockets=1,cores=4,threads=1

or

smp 1,sockets=1,cores=1,threads=4

Because applications can spread the workload more efficiently over cores/threads than over different cpu's?

Or do all the options above result in exactly the same effect?

Score:0
gs flag

Okay, I figured it out myself. The difference between sockets and cores is mainly implemented so you can circumvent licensing requirements. Some operating systems and software have a limits on the CPU count and then you can increase the cores count instead of sockets.

But in the background they are handled exactly the same by QEMU, they both spawn a single QEMU thread. So there should be no performance difference at all between them.

As for the threads option, it's mainly so that you can simulate that your guest CPU has hyper-threading for example, then you can set it to 2, but under normal circumstances you don't really need this option.

So all the options above have exactly the same effect, it only changes the way the QEMU threads are exposed to the guest OS.

I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.