stress-ng bogo ops metric is 4x higher in the Virtual Machine compared to the Physical Machine

71 Views Asked by At

When I run (as non-root)

stress-ng --cpu 1 --timeout 30s --metrics-brief

The output I get on the Physical Machine is

stress-ng: info:  [11750] dispatching hogs: 1 cpu
stress-ng: info:  [11750] cache allocate: default cache size: 8192K
stress-ng: info:  [11750] successful run completed in 30.05s
stress-ng: info:  [11750] stressor      bogo ops real time  usr time  sys time   bogo ops/s   bogo ops/s
stress-ng: info:  [11750]                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
stress-ng: info:  [11750] cpu               6313     30.05     30.04      0.00       210.06       210.15

The output I get on the Virtual Machine running on the same Physical Machine is

stress-ng: info:  [3566780] dispatching hogs: 1 cpu
stress-ng: info:  [3566780] successful run completed in 30.01s
stress-ng: info:  [3566780] stressor       bogo ops real time  usr time  sys time   bogo ops/s     bogo ops/s
stress-ng: info:  [3566780]                           (secs)    (secs)    (secs)   (real time) (usr+sys time)
stress-ng: info:  [3566780] cpu               25927     30.00     30.00      0.00       864.11         864.23

Both Machines are idle during the run. The physical machine has 8 CPU and the virtual machine has 2.

The CPU load on the Physical Machine is the same during both tests. About 85% which is expected amount for 1/8th of a CPU. I cannot imagine the Virtual Machine is doing more work. What am I missing here? If I have to compare performance of the machines, I have to say the virtual machine is 4 times better than the physical machine!

My Virtual Machine is running on VirtualBox. The Physical Machine OS is Ubuntu. The Virtual Machine OS is Debian. Also the stress-ng versions are different on both. Physical Machine has the older version 0.05.23 and the Virtual Machine has the newer version 0.12.06. Of course that could be a problem too, but cannot imagine the metric changing. Any thoughts?

1

There are 1 best solutions below

0
Senthil On

I guess it was the version difference after all. I found another Virtual Machine with the same spec OS and stress-ng version as the Physical machine and the output is below

stress-ng: info:  [1914] dispatching hogs: 1 cpu
stress-ng: info:  [1914] cache allocate: default cache size: 8192K
stress-ng: info:  [1914] successful run completed in 30.00s
stress-ng: info:  [1914] stressor      bogo ops real time  usr time  sys time   bogo ops/s   bogo ops/s
stress-ng: info:  [1914]                          (secs)    (secs)    (secs)   (real time) (usr+sys time)
stress-ng: info:  [1914] cpu               5855     30.00     29.84      0.00       195.14       196.21

Lesson learned - to compare, make sure the version is identical!