2

We are creating virtual os threads inside guest os but the actual physical core is on the host machine. Will hyperthread = true in guest VM config make any difference?

I can visualize how hyperthreading works on the host as it has a physical core, but VM has virtualized os threads so it hard for me to visualize hyperthreading inside a VM.

Can someone please explain to me how it will be useful.

2 Answers2

0

I guess that is the setting for the KVM scheduling. Normally you'd tune by setting the CPU-topology. Since HT-"cores" are slower, you shouldn't set this setting. That is because the emulation/virtualization-threads go onto real cores then. Those are faster.

I have a heavily customized virsh XML and i cant tell you that you can expect max. 25% performance gain on a virtual thread. If you add it extra! In conclusion this would mean you lose 75%, if a thread runs on a virtual core instead of a real one. This example implies full utilization.

WGRM
  • 787
  • 3
  • 14
  • Tnx @WGRM for your response, can you please explain with an example. – Karthik Nedunchezhiyan Mar 06 '20 at 18:07
  • Lets pretend you have a SMT two core system. Furthermore we pretend you have configured two cores for your VM. If KVM is set to use SMT cores, you may endup using two threads on one core. But if it is not set, KVM will set one thread on each "physical" core. The problem is not the thread, as it is a real thread. The problem is it's performance. If you have 100% CPU utilization, one of the cores will only perform with 25% max. This would give you 125% peformance, where as two seperate cores would give you 200% performance. But if you add a third core, it will improve performance to 225%. – WGRM Mar 06 '20 at 18:29
0

the difference Hyperthreading will make will depend entirely on the application you will be running on the VMs...But one thing is for sure, hyperthreading does help with spreading the load on the many cpu cores you might happen to have...

  • You are contradicting @WGRM answer without evidence. Can you prove what you say or give a configuration?? I feel this is not a substantive answer. – number9 Apr 09 '21 at 15:34
  • @number9 I don't really see much evidence behind WGRM's answer either beyond a little anecdotal. Since this answer points out that it depends on circumstance, I don't see it as diametrically opposed. Both could be true by way of WGRM's answer being true only in specific circumstances. – Philip Couling May 16 '21 at 14:03