On 1 Jul 2021, at 16:55, Eric Ernst <eric.g.ernst@gmail.com> wrote:
In this example, you’ll want to clarify what the CPUs requested means. I’ll assume limits=request, and that you’re referring to a kubernetes pod.
Indeed, see the linked issues for examples. Also, ideally, we would like this to work with request but no limit.
Based on that I’d expect 12. I would not recommend four default vCPUs though.
The 3, 4 and 5 were just examples to get different numbers as an output. I chose four for the VM initial VCPUs to illustrate that we may have a possible workaround for request.vcpu=4 not doing anything.
Eric
Sent from my iPhone
On Jul 1, 2021, at 3:54 AM, Christophe de Dinechin <dinechin@redhat.com> wrote:
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-....
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?
_______________________________________________ kata-dev mailing list kata-dev@lists.katacontainers.io http://lists.katacontainers.io/cgi-bin/mailman/listinfo/kata-dev