I am trying to determine if giving as much cores as there are physical
ones, to several --- possibly a lot of --- guests, is a bad or an
acceptable practice. For that purpose, I started some tests. On a 16
Xeon server, a guest alone is able to perform about 2984,68 events per
second (sysbench cpu test).
When sharing the same test across three guests, the load is fairly
shared as load1 load2 load3 resp. make it up to 1312,21 1316,21 1335,48
events. Same goes when doing sysbench on only load1 while load2 and
load3 have being stressed by `stress` instead. Load1 then makes it up
to 1233,43 events/second. Those results are averaged over three
iterations, although the variations are negligible.
Now when performing 11 guests, 10 of them doing `stress` and `load1`
doing `sysbench`. Load1 reports,
events per second: 340.69
events per second: 341.35
events per second: 339.18
This looks pretty good. It is actually more than expected, as we get
more events than the reference 2984,68 result divided by 16 (186,54).
Similarly, we already obtained a larger amount of events when stressing
three guests at a time. How come?
Is there a theoretical limit where the number of guests that are using
all the cores would start showing up an overall degradation? Or can I
just give full cpu power to all the guests? (I am assuming I still
somehow have control over those, otherwise it gets hard to prevent abuse
of that power or fix failures)
I also did some test on another host that has 12 cores instead of 16,
and there was no difference in performance when bench-marking the same
guest on 16 vs 12 VCPUs. With 16 VCPUs we got 2485,01 events/sec. With
12 VCPUs we got 2479,26 events/sec.
It feels like over-commiting the number of VCPUs is actually increasing
the overall performance.
This is Xen 4.11 with the default Credit CPU scheduler and dom0/domU
4.18.16. The host has 16 Xeon cores and stressing the guests went as
sysbench --threads=16 --test=cpu --cpu-max-prime=20000 run
stress --cpu 16
As a side note, I would remind those who want to play with this at home,
to NOT FORGET to kill those processes after testing.