NUMA awareness architecture for VM-based container in Kubernetes environment
Disclosed herein is a method for resource management in a web-based container orchestrating environment. A disclosed method includes initializing a set of micro-virtual machines (VMs) within a macro-VM environment. The method each container within a micro-VM based sandbox. The method assigns a virtual central processing unit (vCPU) to a micro-VM based on an estimated memory required by the micro-VM and the estimated available memory associated with the vCPU. The method pins the vCPU with a physical CPU based on the pod location of the physical CPU and an estimated available memory associated with the vCPU and an available local memory of the physical CPU. The method maintains a state of the vCPU and the physical CPU in a resource manager.
1 . A method comprising:
initializing a set of micro-virtual machines (VMs) within a macro-VM environment;
generating a sandbox and a container for each micro-VM of the set of micro-VMs;
assigning a virtual central processing unit (vCPU) to a container of a respective micro-VM in the set of micro-VMs, the respective micro-VM is within a tenant specific pod in the macro-VM environment, the vCPU assigned is determined based on (i) an estimated memory required by the respective micro-VM and (ii) an estimated available memory associated with the vCPU;
selecting a physical CPU from a plurality of physical CPUs wherein the plurality of physical CPUs are within the tenant specific pod and comprised pinned vCPUs assigned to containers of micro-VMs of the tenant specific pod, and an available local memory of the selected physical CPU being equal to or greater than the estimated available memory associated with the vCPU;
pinning the vCPU with the selected physical CPU of the plurality of physical CPUs, wherein pinning includes executing workloads associated with the vCPU on the selected physical CPU within the tenant specific pod; and
maintaining a state of the vCPU and the physical CPU in a resource manager.
2 . The method of claim 1 , wherein pinning the vCPUs vCPU with the physical CPU within the tenant specific pod based on a pod location of the physical CPU further comprises:
determining that a physical CPU is located in a cluster of physical CPUs assigned to a plurality of vCPUs for a same tenant;
pinning the vCPU to the physical CPU located in the cluster of physical CPUs assigned to the plurality vCPUs for the same tenant.
3 . The method of claim 2 , further comprising:
displaying a mapping of micro-VMs to nodes in the vCPU on a user interface;
receiving instructions to shift the micro-VM mappings;
shifting the assigned micro-VMs based on the instructions.
4 . The method of claim 2 , further comprising:
mapping tenant CPU clusters using a hypervisor shim.
5 . The method of claim 1 , further comprising:
maintaining states of a plurality of vCPUs pinned to a plurality of physical CPUs in the resource manager.
6 . The method of claim 1 , further comprising:
assigning a second vCPU to a second micro-VM in the set of micro-VMs, the vCPU assigned based on an estimated memory required by the second micro-VM and the estimated available memory of the second vCPU;
pinning the second vCPU with a second physical CPU of a plurality of physical CPUs, the second vCPU paired with a second physical CPU based on a pod location of the second physical CPU and an estimated available memory of the second vCPU and an available local memory of the second physical CPU; and
maintaining a state of the second vCPU and the second physical CPU in the resource manager.
7 . The method of claim 1 , further comprising:
shifting the vCPU and physical CPU pairings based on a request to change an amount of available memory for the micro-VM.
8 . The method of claim 1 , further comprising:
monitoring a workload for a physical CPU in a plurality of physical CPUs with the resource manager; and
adjusting pairs of vCPUs and physical CPUs based on the physical CPU having a workload higher than other physical CPUs for a set period of time.
9 . A system comprising:
at least one processor configured to execute instructions;
at least one memory comprising stored instructions, the instructions when executed cause the at least one processor to:
initialize a set of micro-virtual machines (VMs) within a macro-VM environment;
generate a sandbox and a container for each micro-VM of the set of micro-VMs;
assign a virtual central processing unit (vCPU) to a container of a respective micro-VM in the set of micro-VMs, the respective micro-VM is within a tenant specific pod in the macro-VM environment, the vCPU assigned is determined based on (i) an estimated memory required by the respective micro-VM and (ii) an estimated available memory associated with the vCPU;
select a physical CPU from a plurality of physical CPUs wherein the plurality of physical CPUs are within the tenant specific pod and comprised pinned vCPUs assigned to containers of micro-VMs of the tenant specific pod, and an available local memory of the selected physical CPU being equal to or greater than the estimated available memory associated with the vCPU;
pin the vCPU with the selected physical CPU of the plurality of physical CPUs, wherein the instructions to pin includes instructions to execute workloads associated with the vCPU on the selected physical CPU within the tenant specific pod; and
maintain a state of the vCPU and the physical CPU in a resource manager.
10 . The system of claim 9 , wherein the instructions to pin the vCPUs with the physical CPU within the tenant specific pod based on a pod location of the physical CPU further comprises instructions that cause the at least one processor to:
determine that a physical CPU is located in a cluster of physical CPUs assigned to a plurality of vCPUs for a same tenant;
pin the vCPU to the physical CPU located in the cluster of physical CPUs assigned to the plurality vCPUs for the same tenant.
11 . The system of claim 9 , further comprising instructions that cause the at least one processor to:
display a mapping of micro-VMs to nodes in the vCPU on a user interface;
receive instructions to shift the micro-VM mappings;
shift the assigned micro-VMs based on the instructions.
12 . The system of claim 9 , further comprising instructions that cause the at least one processor to:
maintain states of a plurality of vCPUs pinned to a plurality of physical CPUs in the resource manager.
13 . The system of claim 9 , further comprising instructions that cause the at least one processor to:
assign a second vCPU to a second micro-VM in the set of micro-VMs, the vCPU assigned based on an estimated memory required by the second micro-VM and the estimated available memory of the second vCPU;
pin the second vCPU with a second physical CPU of a plurality of physical CPUs, the second vCPU paired with a second physical CPU based on a pod location of the second physical CPU and an estimated available memory of the second vCPU and an available local memory of the second physical CPU; and
maintain a state of the second vCPU and the second physical CPU in the resource manager.
14 . The system of claim 9 , further comprising instructions that cause the at least one processor to:
shift the vCPU and physical CPU pairings based on a request to change an amount of available memory for the micro-VM.
15 . The system of claim 9 , further comprising instructions that cause the at least one processor to:
monitor a workload for a physical CPU in a plurality of physical CPUs with the resource manager; and
adjust pairs of vCPUs and physical CPUs based on the physical CPU having a workload higher than other physical CPUs for a set period of time.
16 . A non-transitory computer readable medium having instructions encoded thereon that, when executed by a processor, cause the processor to:
initialize a set of micro-virtual machines (VMs) within a macro-VM environment;
generate a sandbox and a container for each micro-VM of the set of micro-VMs;
assign a virtual central processing unit (vCPU) to a container of a respective micro-VM in the set of micro-VMs, the respective micro-VM is within a tenant specific pod in the macro-VM environment, the vCPU assigned is determined based on (i) an estimated memory required by the respective micro-VM and (ii) an estimated available memory associated with the vCPU;
select a physical CPU from a plurality of physical CPUs wherein the plurality of physical CPUs are within the tenant specific pod and comprised pinned vCPUs assigned to containers of micro-VMs of the tenant specific pod, and an available local memory of the selected physical CPU being equal to or greater than the estimated available memory associated with the vCPU;
pin the vCPU with the selected physical CPU of the plurality of physical CPUs, wherein the instruction to pin includes instructions to execute workloads associated with the vCPU on the selected physical CPU within the tenant specific pod; and
maintain a state of the vCPU and the physical CPU in a resource manager.
17 . The non-transitory computer readable medium of claim 16 , wherein the instructions that when executed cause the processor to pin the vCPUs with a physical CPU within the tenant specific pod based on a pod location of the physical CPU further comprises instructions that when executed cause the processor to:
determine that a physical CPU is located in a cluster of physical CPUs assigned to a plurality of vCPUs for a same tenant;
pin the vCPU to the physical CPU located in the cluster of physical CPUs assigned to the plurality vCPUs for the same tenant.
18 . The non-transitory computer readable medium of claim 17 , further comprising instructions that when executed cause the processor to:
map tenant CPU clusters using a hypervisor shim.
19 . The non-transitory computer readable medium of claim 16 , further comprising instructions that when executed cause the processor to:
maintain states of a plurality of vCPUs pinned to a plurality of physical CPUs in the resource manager.
20 . The non-transitory computer readable medium of claim 16 , further comprising instructions that when executed cause the processor to:
assign a second vCPU to a second micro-VM in the set of micro-VMs, the vCPU assigned based on an estimated memory required by the second micro-VM and the estimated available memory of the second vCPU;
pin the second vCPU with a second physical CPU of a plurality of physical CPUs, the second vCPU paired with a second physical CPU based on a pod location of the second physical CPU and an estimated available memory of the second vCPU and an available local memory of the second physical CPU; and
maintain a state of the second vCPU and the second physical CPU in the resource manager.