Patent ID: 12204999

DETAILED DESCRIPTION

In software-defined systems, containers can select which memory, compute, storage, and network resources to use. But containers selecting their own resources often leads to containers consuming more resources than needed for execution. Additionally, resources of a lower value may be consumed more than resources of a higher value. This may lead to resources of middle and higher values being underutilized. As a result, the software-defined system may be slower and have suboptimal resource usage.

Some examples of the present disclosure can overcome one or more of the abovementioned problems by providing a system that can allocate resources to containers based on characteristics of the containers and of the system. The system can receive a container limit specifying a maximum value for a resource. The system can determine that a value for a resource is below the container limit. Additionally, the system can receive, for the container, one or more benefit functions that assign a weight for the resource in the software-defined system. The weight can correspond to an expected benefit from the container using the resource. In response to determining the value for the resource is less than the container limit, the system can allocate the resource to the container based on the weight from the one or more benefit functions. If the system determines the value for the resource exceeds the container limit, the system may deactivate the container and reactivate the container at a subsequent time when the value is less than the container limit. This resource allocation can allow the system to balance resource usage among containers and increase speed of the system.

A benefit function can be a function that determines an expected performance enhancement provided by a resource to a container. The expected performance enhancement can be reflected as a weight, with higher weights corresponding to greater expected performance enhancement. For example, a benefit function may be a static function that assigns a fixed weight to each resource of a particular resource type. In other examples, the benefit function can be a dynamic function that assigns a weight for a resource based on other resources that are associated with the container. Alternatively, the benefit function may be a machine-learning function that assigns a weight for a resource based on learned knowledge of the container. In some examples, a combination of more than one of these benefit functions may be used to determine the weight for a resource. The weights may then be used by the system to determine which resource to allocate to the container. For example, the system may allocate a resource with a higher weight to the container instead of a resource with a lower weight.

One particular example can involve a container in a software-defined system. An allocation manager of the software-defined system can receive a container limit of ten for the container. The allocation manager can determine a value for a solid-state drive (SSD) for the container is seven. The allocation manager can also receive a static benefit function that assigns a weight of eight for an SSD for the container. The threshold for the weight can be five. The allocation manager can determine the value is less than the container limit and the weight is above the threshold. In response, the allocation manager can allocate the SSD to the container. As a result, resources that will benefit the container the most, in both value and performance, can be allocated to the container.

These illustrative examples are given to introduce the reader to the general subject matter discussed here and are not intended to limit the scope of the disclosed concepts. The following sections describe various additional features and examples with reference to the drawings in which like numerals indicate like elements but, like the illustrative examples, should not be used to limit the present disclosure.

FIG.1is a block diagram of an example of a software-defined system100for implementing resource-allocation management according to some aspects of the present disclosure. The software-defined system100can include a client device120, a management node110, and a pool of resources140. Examples of the client device120can include a desktop computer, a laptop, a mobile phone, a smart network interface card (NIC) etc. The pool of resources140can include resources142a-bthat are available in the software-defined system100. Examples of the resources142a-bcan include hard disk drives (HDDs), solid-state drives (SDDs), central processing units (CPUs), graphics processing units (GPUs), random-access memory (RAM), persistent memory (PMEM), network, etc. The client device120, the management node110, and the pool of resources140can communicate over a network150, such as a local area network (LAN) or the Internet.

In some examples, the client device120can execute containers130a-b. An allocation manager112executing on the management node110can determine values for the resources142a-b. The values can correspond to costs for the resources142a-b. The allocation manager112may adjust the costs of the resources142a-bbased on the availability of the resources142a-bin the software-defined system100. For example, the allocation manager112can determine the resource142ais scarce in the software-defined system100and the resource142bis more available. As a result, the allocation manager112may determine a cost for the resource142ato be greater than a cost for the resource142b. As one particular example, the allocation manager112can determine a cost144afor the resource142afor the container130ais $0.50.

In some examples, the allocation manager112can additionally determine which resources of the pool of resources140to allocate to the container130abased on properties of the container130aand the costs. For example, the allocation manager112can receive a container limit132for the container130a. The container limit132can specify a maximum value, such as a budget, for the container130a. A user of the container130amay provide the container limit132. For example, the container limit132can specify the maximum cost of $5 for the container130a.

In some examples, the allocation manager112can determine whether the cost144ais less than the container limit132. In other words, the allocation manager112can determine whether the cost of the resource142ais within the budget for the container130a. The allocation manager112can compare the cost144ato the container limit132to determine whether the cost144ais less than the container limit132. For example, the container limit132can be $5 and the cost144afor the resource142afor the container130acan be $0.50. As a result, the allocation manager112can determine the cost144ais less than the container limit132.

In some examples, the allocation manager112can also receive benefit functions136for the container130athat can be used in determining which of the resources142a-bto allocate to the container130a. The benefit functions136can assign a weight for each of the resources142a-bin the pool of resources140. A weight can correspond to a value of an expected benefit from the container130ausing a particular resource. A higher value can indicate the container130awill have increased performance using the corresponding resource.

In some examples, the benefit functions136can include one or more of a static function, a dynamic function, and a machine-learning function. For the static function, values138can be fixed for each resource. For example, the type of resource of the resource142acan have a fixed value and the type of resource of the resource142bcan have a fixed value that may be the same or different than the value for the resource142a. As one particular example, the resource142acan be a HDD and the values138can include a value of “2” for HDDs. Additionally, the resource142bcan be an SSD and the values138can include a value of “5” for SSDs.

The dynamic function of the benefit functions136can assign the values138based on additional resources associated with the container130a. For example, if the container130aswitches from using a SSD to using a HDD, the dynamic function can increase the values for resources with read-cache, such as RAM and PMEM, because HDDs benefit more from read-cache than SSDs. The dynamic function can continually adjust the values138for the resources142a-bin the pool of resources140based on which resources are associated with the container130a.

The machine-learning function of the benefit functions136can assign the values138based on online calculations. For example, the machine-learning function can determine whether the container130aexperiences expected performance with its resources, or whether additional or alternative resources can provide performance enhancement. The values138can be adjusted based on expected performance enhancement. As one particular example, the machine-learning function can determine the container130aexperiences a lower benefit from PMEM caching for HDD than expected because the container130ais CPU bound. As a result, the machine-learning function can decrease the value of PMEM and increase the value of CPU. This can indicate that the container130ashould reduce usage of PMEM and increase usage of CPU.

In some examples, the benefit functions136include more than one of the static function, dynamic function, and machine-learning function. In such cases, the values138can be determined by averaging the values determined by each benefit function. For example, if the benefit functions136include the static function, which assigns a value of “5” for SSD for the container130a, and the dynamic function, which assigns a value of “3” for SSD for the container130a, the values138can include a value of “4” for SSD. Additionally, the values138may be determined based on a weighted average of the values from the benefit functions. For example, the benefit functions136can include the dynamic function and the machine-learning function. At a start of an execution of the container130a, the values138can be determined by a weighted average that considers values from the dynamic function and the machine-learning function equally (e.g., weight of 0.5). Over time, the weighted average can consider the machine-learning function at a higher weight as the machine-learning function gains knowledge of the container130a. For example, after the container130ahas been executing for some time, the values138can be determined by a weighted average of 0.2 of the values determined from the dynamic function and 0.8 of the values determined by the machine-learning function.

In some examples, the allocation manager112can store learned knowledge about the container130a. The knowledge may be used to determine values for resources of similar containers executing in the software-defined system100. For example, if container130bis similar to container130a, the allocation manager112can use the learned knowledge to determine values for container130b.

In some examples, the allocation manager112can use the container limit132and the values138to determine which resources of the pool of resources140to allocate to the container130a. The allocation manager112can determine to allocate a resource to the container130aif the container limit132is above the cost144afor the resource and the values138indicate the value for the resource is at or above a threshold. For example, the threshold can be a value of “5”. As one particular example, the resource142acan be a SSD. The allocation manager112can determine the cost144afor SSD for the container130ais $1.00 and the container limit132is $2.00. Additionally, the allocation manager112can determine the values138include a value of “6” for SSD for the container130a, which is above a threshold of “5”. As a result of the cost144abeing less than the container limit132and the value being above the threshold, the allocation manager112can allocate the resource142ato the container130a.

In some examples, the allocation manager112can temporarily deactivate the container130aexecution in response to determining the cost144afor the resource142aexceeds the container limit132. Deactivating the container130acan involve the container130aexecution being postponed or paused for later execution. The allocation manager112can determine the cost144aexceeds the container limit132and then transmit a command for causing the container130ato be deactivated. The allocation manager112can continue to monitor the cost144aas it is adjusted based on the availability of the resources142a-b. At a subsequent time, the allocation manager112can determine the cost144afor the resource142ais less than the container limit132. In response, the allocation manager112can reactivate the container130aso that the container130acontinues executing and performing operations. The container130amay additionally include a maximum time limit for how long the container130acan be deactivated. The maximum time limit may be specified by a user during creation of the container130a. The resource allocation manager112can determine the maximum time limit and reactivate the container130aafter the maximum time limit has passed since the container130ahas been deactivated, even if the cost144afor the resource142ais not below the container limit132.

In some examples, the containers130a-bcan be a container group160. For example, the containers130a-bmay be associated with a same entity or organization. The container group160can be allocated resources from the pool of resources140, and the allocated resources can be shared between the containers130a-b. A cost for more of a resource may be less than a cost for less of a resource. For example, the cost for one-hundred seconds of one unit of CPU may be $0.50 and the cost for one-hundred seconds of three units of CPU may be $1.00. Since the container group160may consume more of a resource, a cost144bfor the resource142afor the container130ain the container group160may be less than the cost144afor the resource142afor the container130aoutside of the container group160.

In some examples, each container of the container group160can have a priority. The priority for a container can be specified by a user. The allocation manager112can determine the priority for each container of the container group160and allocate resources accordingly. For example, the allocation manager112can allocate resources to a container with a higher priority before allocating resources to a container with a lower priority. Additionally, the allocation manager112may deactivate containers of the container group160based on the priority. For example, the allocation manager112can deactivate containers with lower priorities prior to deactivating containers with higher priorities.

The allocation manager112can determine whether to allocate the resource142ato the container group160based on the cost144bfor the resource142afor the container group160. As one particular example, the container130acan use one unit of CPU for one-hundred seconds and the container130bcan use two units of CPU for one-hundred seconds. The cost144afor one unit of CPU for one-hundred seconds can be $0.50. As a result, the container130acan receive CPU for $0.50 and the container130bcan receive CPU for $1.00. Alternatively, the cost144bfor one-hundred seconds of three units of CPU can be $1.00 for the container group160. Accordingly, the container group160can receive CPU for $1.00 that can be shared between the containers130a-b. Thus, the container130acan receive CPU for $0.33 and the container130bcan receive CPU for $0.67 if the CPU is allocated to the container group160. Therefore, the allocation manager112can determine the cost144bfor the resource142afor the container group160is less than the cost144afor the resource142afor the container130a. In response, the allocation manager112can allocate the resource142ato the container group160.

In some examples, the allocation manager112may alternatively determine the cost144bfor the resource142afor the container group160exceeds the cost144afor the resource142afor the container130a. In response, the allocation manager112can allocate the resource142ato the container130a.

It will be appreciated thatFIG.1is intended to be illustrative and non-limiting. Other examples may include more components, fewer components, different components, or a different arrangement of the components shown inFIG.1. For instance, although the software-defined system100includes one client device and two resources in the example ofFIG.1, the software-defined system100may include a larger number of client devices and resources in other examples. AlthoughFIG.1is described with respect to containers, other examples can involve resource allocation for virtual machines in a software-defined system.

FIG.2is a block diagram of another example of a software-defined system200for implementing resource-allocation management according to some aspects of the present disclosure. The software-defined system200includes a processor202. The processor202may be part of a management node, such as the management node110inFIG.1.

In this example, the processor202is communicatively coupled with a memory204. The processor202can include one processor or multiple processors. Non-limiting examples of the processor202include a Field-Programmable Gate Array (FPGA), an application-specific integrated circuit (ASIC), a microprocessor, etc. The processor202can execute instructions206stored in the memory204to perform operations. The instructions206can include processor-specific instructions generated by a compiler or an interpreter from code written in any suitable computer-programming language, such as C, C++, C#, etc.

The memory204can include one memory or multiple memories. Non-limiting examples of the memory204can include electrically erasable and programmable read-only memory (EEPROM), flash memory, or any other type of non-volatile memory. At least some of the memory204includes a non-transitory computer-readable medium from which the processor202can read the instructions206. The non-transitory computer-readable medium can include electronic, optical, magnetic, or other storage devices capable of providing the processor202with computer-readable instructions or other program code. Examples of the non-transitory computer-readable medium can include magnetic disks, memory chips, ROM, random-access memory (RAM), an ASIC, optical storage, or any other medium from which a computer processor can read the instructions206.

In some examples, the processor202can execute the instructions206to perform operations. For example, the processor202can receive, for a container208in the software-defined system200, a container limit210specifying a maximum value212for the container208. The processor202can receive, for the container208, one or more benefit functions218that assign a weight220for the resource216in the software-defined system200. The one or more benefit functions218can include one or more of a static function, a dynamic function, and or a machine-learning function. The processor202can determine a value214for a resource216is less than the container limit210. In response to determining the value214for the resource216is less than the container limit210, the processor202can allocate the resource216to the container208based on the weight220from the one or more benefit functions218. The processor202can allocate the resource216to the container208in response to determining the weight220is above a threshold. Dynamic allocation of resources in the software-defined system200may result in a faster system with balanced resource usage.

In some examples, the processor202can implement some or all of the steps shown inFIG.3. Other examples can include more steps, fewer steps, different steps, or a different order of the steps than is shown inFIG.3. The steps ofFIG.3are discussed below with reference to the components discussed above in relation toFIG.2.

In block302, the processor202can receive, for a container208in a software-defined system200, a container limit210specifying a maximum value212for the container208. The maximum value212may correspond to a budget for executing the container208. The container limit210may be fixed or may change over time.

In block304, the processor202can receive, for the container208, one or more benefit functions218that assign a weight220for the resource216in the software-defined system200. The one or more benefit functions218can include a static function, a dynamic function, and a machine-learning function. The weight220may quantify performance benefits the container208may experience as a result of using the resource216. For example, a higher weight can indicate a higher benefit to the container208.

In block306, the processor202can determine a value214for a resource216is less than the container limit210. The value214may correspond to a cost for the resource216for the container208. The value214being less than the container limit210can indicate that the cost for the resource216is less than the budget for the container208.

In block308, the processor202can, in response to determining the value214for the resource216is less than the container limit210, allocate the resource216to the container208based on the weight220from the one or more benefit functions218. The processor202can determine the weight220is above a threshold and then allocate the resource216to the container208. Managing resource values and allocation may aid in improving resource usage and speed for the software-defined system200.

The foregoing description of certain examples, including illustrated examples, has been presented only for the purpose of illustration and description and is not intended to be exhaustive or to limit the disclosure to the precise forms disclosed. Numerous modifications, adaptations, and uses thereof will be apparent to those skilled in the art without departing from the scope of the disclosure. For instance, any examples described herein can be combined with any other examples to yield further examples.