0

I have an executable that supports multithreading and I'm trying to execute it on Google Cloud. I've reserved 8 VCPUs and I'm executing the job using 8 threads. Let's say that I get an execution time of y. Now I've reserved 16 VCPUs, but am only executing the job using 8 threads, and I get an execution time of x. What I'm noticing is that x is almost 15-20% less than y. Why do I get this performance benefit when I reserve more VCPUs, but use less threads?

Any help will be appreciated. Thanks.

uray
  • 11
  • 3

1 Answers1

0

At Google Cloud Platform, The performance of one virtual CPU is not equal to the one physical core. More preciously, One virtual CPU == 1 hyper-thread == 1/2 physical core.

With hyper-threading, one physical core appears as two processors to the operating system, allowing concurrent scheduling of two processes per core.

So when you used 16 vCPUs meaning you have 16 hyper-thread and 8 physical core whereas 8 vCPUs supported by 4 physical core and have 8 hyper-thread. So it means you have more processing capacity when using 16 vCPUs in regards to 8 vCPU which also reflects the performance benefit you are getting.

This documentation in StackOverflow, Blog and Google Group discussions are a good read on similar topic.

Rahi
  • 715
  • 4
  • 14