[kata-dev] Performance isolation: expectations for number of CPUs

Christophe de Dinechin dinechin at redhat.com
Thu Jul 1 10:53:33 UTC 2021


An interesting question arose about the number of CPUs we want to get in the VM, notably in the context of https://github.com/kata-containers/kata-containers/issues/2071 as well as regarding https://github.com/kata-containers/kata-containers/pull/2131, a fix for https://github.com/kata-containers/kata-containers/issues/2130.

Let's say that we have two containers A and B requesting 5 and 3 CPUs respectively. How many CPUs should we get in the VM? Let us assume that the default number of VCPUs is 4.

Possible answers:

A) 4 (default number of VCPUs), because the current OCI spec does not give us information about the number of CPUs. That's how I interpret Julio's answer, https://github.com/kata-containers/kata-containers/issues/2071#issuecomment-865034753.

B) 5 (maximum request). This seems to be more or less how the Rust agent behaves today, making sure that each time there is a request, we online at least that many CPUs.

C) 8 (sum of requests for all containers). If the two containers request CPUs, they have good reasons to, so we should honor both requests independently. This seems to be what the runtime has in mind, since it hotplugs the new CPUs and the struct VM field is called "cpusDelta"

D) 6 (maximum request, plus one for the agent). During the performance isolation meetings, we seem to have shifted towards the idea that the agent should get a dedicated CPU.

E) 9 (maximum request, plus one for the agent)

F) 9 (maximum request plus the four original)

G) 12 (sum of requests plus the four original)

H) 42 (the correct answer in most cases)

What do you think? 




More information about the kata-dev mailing list