0

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?

Maestro
  • 265
  • 1
  • 3
  • 9

1 Answers1

0

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.

Maestro
  • 265
  • 1
  • 3
  • 9