GLOBAL VERTICAL AUTO-SCALING FOR APPLICATION CONTAINERS

A computer-implemented method, a computer program product, and a computer system for global vertical auto-scaling for processing units. A computer periodically learns one or more functions, based on resource consumption metrics samples of processing units. A computer uses the one or more functions to obtain a predicted maximal resource consumption value per resource and a predicted minimal resource consumption value per resource for a processing unit. A computer determines a global priority of the processing unit. A computer calculate a prioritized predicted consumption value per resource for the processing unit, based on the global priority, the predicted maximal resource consumption value, and the predicted minimal resource consumption value. A computer uses the prioritized predicted consumption value for vertical auto-scaling of the processing unit by a processing unit management system.

BACKGROUND

The present invention relates generally to application container management, and more particularly to global vertical auto-scaling for application containers.

Currently in container management systems, the resource requirements (for scheduling calculations) and the resource consumption limits (for enforcement) for a container are typically specified manually. The most common resources to specify are CPU (central processing unit), memory, and storage space. Recent vertical auto-scalers enable automatic scaling of these values based on observed resource consumption. However, existing vertical auto-scaling capabilities have limitations that should be addressed.

SUMMARY

In one aspect, a computer-implemented method for global vertical auto-scaling for processing units is provided. The computer-implemented method includes periodically learning one or more functions, based on resource consumption metrics samples of processing units. The computer-implemented method further includes using the one or more functions to obtain a predicted maximal resource consumption value per resource and a predicted minimal resource consumption value per resource for a processing unit. The computer-implemented method further includes determining a global priority of the processing unit, wherein the global priority determines a rank of the processing unit in an order of precedence for getting resources. The computer-implemented method further includes calculating a prioritized predicted consumption value per resource for the processing unit, based on the global priority, the predicted maximal resource consumption value, and the predicted minimal resource consumption value. The computer-implemented method further includes using the prioritized predicted consumption value for vertical auto-scaling of the processing unit by a processing unit management system.

In another aspect, a computer program product for global vertical auto-scaling for processing units is provided. The computer program product comprises a computer readable storage medium having program instructions embodied therewith, and the program instructions are executable by one or more processors. The program instructions are executable to: periodically learn one or more functions, based on resource consumption metrics samples of processing units; use the one or more functions to obtain a predicted maximal resource consumption value per resource and a predicted minimal resource consumption value per resource for a processing unit; determine a global priority of the processing unit, wherein the global priority determines a rank of the processing unit in an order of precedence for getting resources; calculate a prioritized predicted consumption value per resource for the processing unit, based on the global priority, the predicted maximal resource consumption value, and the predicted minimal resource consumption value; and use the prioritized predicted consumption value for vertical auto-scaling of the processing unit by a processing unit management system.

In yet another aspect, a computer system for global vertical auto-scaling for processing units is provided. The computer system comprises one or more processors, one or more computer readable tangible storage devices, and program instructions stored on at least one of the one or more computer readable tangible storage devices for execution by at least one of the one or more processors. The program instructions are executable to periodically learn one or more functions, based on resource consumption metrics samples of processing units. The program instructions are further executable to use the one or more functions to obtain a predicted maximal resource consumption value per resource and a predicted minimal resource consumption value per resource for a processing unit. The program instructions are further executable to determine a global priority of the processing unit, wherein the global priority determines a rank of the processing unit in an order of precedence for getting resources. The program instructions are further executable to calculate a prioritized predicted consumption value per resource for the processing unit, based on the global priority, the predicted maximal resource consumption value, and the predicted minimal resource consumption value. The program instructions are further executable to use the prioritized predicted consumption value for vertical auto-scaling of the processing unit by a processing unit management system.

DETAILED DESCRIPTION

The limitations in the existing vertical auto-scaling capabilities include the following. (1) Many applications can be throttled and operate well using resource amounts which are in a range between a minimum (i.e., if resource availability is lower than the minimum the application cannot work) and a maximum (i.e., if resource availability is above the maximum there is no significant increase in throughput). Existing vertical auto-scalers do not consider the throttling option and do not tune their recommendation in a feasible range. This reduces the efficiency of the overall resource utilization in a cluster. Existing vertical auto-scalers use a range only for enforcement, namely for triggering eviction and restart of containers; however, the range is not considered for tuning the values recommended by the existing vertical auto-scalers. (2) The values recommended by the existing vertical auto-scalers per resource per container are calculated by considering only a container itself. The existing vertical auto-scalers do not consider any information regarding other containers or any global information. For examples, priorities of containers can be important for tuning recommendations by the existing vertical auto-scalers; however, these priorities are not considered by the existing vertical auto-scalers. (3) Determining recommended values by the existing vertical auto-scalers is done using simplified methods, that typically look only at the consumption values but do not look at explaining parameters and environmental parameters. Some references about estimating resource usage use a single aspect as basis for the estimation (e.g., data input to the application). However, existing vertical auto-scalers do not use a machine learning method that considers a multitude of explaining parameters and environmental parameters to determine recommended values. (4) The existing vertical auto-scalers do not consider smoothness in refinement of resource requirements over time. (5) The existing vertical auto-scalers handle containers over consumption events without any condition or differentiation with regards to whether the container's resource requirement and limit values are stable or not yet stable. Applying the same method for containers whose values are not yet stable can cause significant performance degradation.

Embodiments of the present invention address the above-mentioned limitations and therefore increase performance of applications and the overall resource utilization efficiency.

Embodiments of the present invention can be implemented in any containers management system, in any cloud platform (such as container, virtual machine, or any other type), and in any workload or job management system. While the term “container” is used in describing the present invention, the present invention can be applied to any type of processing units, for example, threads, processes, applications, jobs, pods, operating system instances, virtual machines, hosts, clusters, etc.

In the present invention, a method uses explaining parameters to predict ranges of resource requirements and limits for a container. The explaining parameters capture both the image type and the environment in which the container works (i.e., time, placement, network traffic, and storage input/output rates). The method uses machine learning to learn functions that predict resource consumption ranges based on the explaining parameters. Existing vertical auto-scalers use simplified methods, which typically look only at consumption values, do not look at explaining and environmental parameters, do not produce consumption ranges, and do not use machine learning. No current vertical auto-scaler uses the comprehensive machine learning design, including the explaining and environmental parameters and the output of consumption ranges.

In the present invention, a method is proposed for tuning the consumption predicted by a vertical auto-scaler in a feasible range for a container, by considering global containers' priorities in conjunction with predicted consumption ranges. Containers with higher priorities are tuned up on their ranges per resource. Containers with lower priorities are tuned down on their ranges per resource. Adding the priorities across containers to the vertical auto-scaler's calculations adds a global efficiency perspective to the calculations. Existing vertical auto-scalers calculate by considering only the container itself. No existing vertical auto-scaler uses global information for tuning calculated consumption values, and furthermore no existing vertical auto-scale tunes the calculated values in a feasible range per application.

In the present invention, a method is proposed for extrapolating resource requirement and limit values from predicted resource consumptions. In the present invention, a method is proposed for smooth incremental refinement of the resource request and limit values over time. To smooth the changes, current predicted values are combined with existing values that reflect a past period of time, and therefore the proposed method avoids the effect of skewed or outlier samples. No existing vertical auto-scaler provides an approach of incremental and smooth refinement.

In the present invention, a method is proposed for introducing a new container state—a pending stability state, where the resource limits are not yet stable. In the pending stability state, enforcement of limits is soft; in other words, exceeding the limits will not cause eviction or termination of the container. After existing the pending stability state, namely the container reaches a stable state, enforcement of limits becomes hard; in other words, eviction and termination become possible. No existing vertical auto-scaler provides conditional handling of containers over consumption events based on such a container state.

In the present invention, a protocol is proposed for implementation between a system implementing the proposed method and a container for which resource requirement and/or resource limit values are updated (i.e., increased or decreased). The proposed protocol enables safe and efficient handling of these events. No existing vertical auto-scaler specifies this proposed protocol.

The proposed method in the present invention does not require any changes in existing application programming interfaces (APIs) of a scheduling sub-system. The proposed method in the present invention does not require any changes in containers or in applications inside the containers. This is important for keeping backward compatibility and facilitating the implementation of the proposed global vertical auto-scaler of the present invention.

FIG.1is a flowchart showing operational steps of predicting and tuning resource requirements and resource consumption limits for a container, in accordance with one embodiment of the present invention. The operational steps of predicting and tuning resource requirements and resource consumption limits for a container are implemented by a computer or server (such as computer601inFIG.6).

In step101, the computer or server maintains a database that stores a history of resource consumption metrics samples of containers. Each record in the database is a sample of the resource consumption metrics of a specific running container at a specific time. A record may include image instance identification parameters, container runtime parameters, and resource consumption metrics. The image instance identification parameters may include an image global unique ID, an image name and tag, and an image last layer digest. The container runtime parameters may include time parameters and placement parameters. The time parameters indicate when the container is deployed for running, when the resource consumption metrics sample is taken, and the interval of time covered by the resource consumption metrics in the sample. The placement parameters indicate a cluster where the container is deployed and a host where the container is deployed. The resource consumption metrics may include CPU, memory, network rates (in and out), and I/O rates. The resource consumption metrics specify the maximum, minimum, and mean resource consumption per resource for the sampled interval of time. The database may store records for a single cluster or alternatively multiple different clusters by being available from a shared location.

In step102, the computer or server periodically learns one or more functions, based on information in the database.FIG.2illustrates an example of learning a function for predicting resource requirements and resource consumption limits for a container, in accordance with one embodiment of the present invention. As shown inFIG.2, the input for machine learning is explaining parameters, which may include image identification parameters, time parameters, placement parameters, network traffic parameters, and I/O (input/output) metrics parameters. As shown inFIG.2, the output for machine learning is explained parameters, which may include a maximal resource consumption value per resource and a minimal resource consumption value per resource. The rationale of the one or more functions is as follows. Image instance A behaves and consumes resources in a certain way when used in the environment and context described by time, placement, network traffic, and I/O metrics. The network traffic and I/O metrics can explain the external interaction of the container, which may affect how the container behaves. In the example shown inFIG.2, the computer or server uses a regression model to learn the one or more functions. In other embodiments, any other models that supports predicting continuous values can be used.

In step103, the computer or server uses the one or more functions (which has been learned in step102) to obtain a predicted maximal resource consumption value per resource and a predicted minimal resource consumption value per resource for a container, given the explaining input parameters.

In step104, the computer or server determines a global priority of the container. The global priority determines a rank of the container in an order of precedence for getting resources. The computer or server determines global priorities for respective ones of pending or running containers. Each container is assigned with a global priority value. A container with a higher global priority value has higher precedence in getting resources relative to a container with a lower global priority value. The global priority values of the plurality of containers are incorporated in resource calculations. The inputs used for the computer or server to determine the global priorities can come from a user, an administrator, or automated information collected by a container management system. The global priorities can be determined dynamically or statically by the computer or server. In addition, the computer or server transforms the priorities to a unified scale of 0 to 1.

In step105, the computer or server calculates a prioritized predicted consumption value per resource for the container. In this step, the computer or server applies a function

where a is the global priority determined in step104, xmaxis the predicted maximal resource consumption value obtained in step103, and xminis the predicted minimal resource consumption value also obtained in step103. The function is used to calculate the prioritized predicted resource consumption value. For example, the implementation of above function may be

The computer or server applies the function in which the global priority of the container, the predicted maximal resource consumption value, and the predicted minimal resource consumption value are used as input. From the function, the computer or server produces one prioritized predicted resource consumption value per resource for the container. The computer or server uses the prioritized predicted consumption value for vertical auto-scaling of the processing unit by a processing unit management system.

In step106, the computer or server extrapolates, from the prioritized predicted consumption value, a resource requirement value per resource and a resource consumption limit value per resource for the container. In the extrapolation, the computer or server uses a function. For example, the resource requirement value is higher than the prioritized predicted consumption value by a predetermined percentage or amount, or is equal to the prioritized predicted consumption value. For example, the resource consumption limit value is higher than the resource requirement value by another predetermined percentage or amount or is equal to the resource requirement value.

The following example shows how the resource requirement value and the resource consumption limit value are obtained from the predicted maximal resource consumption value and the predicted minimal resource consumption value. For a container C and a resource R, using the one or more prediction functions, the computer or server obtains:

The computer or server therefore obtains a range of the predicted resource consumption values; the range is from 2 to 10.

The global priority of the container C relative to other containers is determined as 0.8. The computer or server calculates the prioritized predicted consumption value as follows:

In extrapolating the resource requirement value from the prioritized predicted consumption value, the computer or server uses a simple function in which the resource requirement value adds 20% over the prioritized predicted consumption value; in other words, the resource requirement value is 20% higher than the prioritized predicted consumption value. The calculation of the resource requirement value is as follows:

Alternatively, the resource requirement value is set to be equal to the prioritized predicted consumption value; therefore,

In extrapolating the resource consumption limit value, the computer or server uses another simple function in which the resource consumption limit value adds 50% over the resource requirement value; in other words, the resource consumption limit value is 50% higher than the resource requirement value. The calculation of the resource consumption limit value is as follows:

In step107, the computer or server feeds the resource requirement value and the resource consumption limit value to a container management system. The resource requirement value and the resource consumption limit value are obtained in step106. The resource requirement value is a value that is fed into the containers management system for the corresponding resource and the container. The resource requirement values for different resources are used by the container management system to allocate resources for the container. The resource consumption limit value is a value that is fed into the containers management system for the corresponding resource and the container. The resource limit values for different resources are used by the container management system to determine whether the container exceeds any resource consumption limit value. If the container exceeds any resource consumption limit value, the container management system takes an appropriate action such as evicting or terminating the container.

FIG.3is a flowchart showing operational steps of updating the resource requirements and limits of a container over time, in accordance with one embodiment of the present invention. In one embodiment, the operational steps of updating the resource requirements and limits of a container over time are implemented by a container management system which is hosted by a computer or server (such as computer601inFIG.6).

Over time, many elements change. For example, the database that stores the history of the resource consumption metrics samples of containers changes (such as new samples are added to the database); the one or more machine learning functions are periodically relearned; the environment parameters and the priorities that affect all the pending and running containers change over time. Therefore, the computer or server updates the resource requirements and limits for each pending and running container periodically.

The goal of the operational steps is to smooth the changes in the resource requirement value per container and the resource consumption limit value per container, avoid sharp changes, and avoid the effect of skewed or outlier samples.

In step301, the computer or server combines a predicted resource requirement value per resource with a current resource requirement value per resource assigned to the container and combines a predicted resource consumption limit value per resource with a current resource consumption limit value per resource assigned to the container. In step302, the computer or server produces a refined resource requirement value per resource and a refined resource consumption limit value per resource.

For example, in combining the predicted resource requirement value with the current resource requirement value assigned to the container, the computer or server uses a weight of the predicted resource requirement value and a weight of the current resource requirement value. For example, in combining the predicted resource consumption limit value with the current resource consumption limit value assigned to the container, the computer or server uses a weight of the predicted resource consumption limit value and a weight of the current resource consumption limit value. The weights may depend on at least one of the following: the number of samples used for obtaining the already assigned values (the current resource requirement value and the current resource consumption limit value), the time interval of the already assigned values compared with the time interval of the predicted values (the predicted resource requirement value and the predicted resource consumption limit value), and the difference between the already assigned values and the predicted values. Consider that the already assigned values represent a much larger time interval compared to the predicted values.

In step303, the computer or server determines whether the refined resource requirement value and the refined resource consumption limit value are to be set for the container. The computer or server uses a criterion for this determination, where the criterion can be based on the difference between the refined values and the already assigned values. In response to determining that the refined values are to be set for the container, in step304, the computer or server determines whether in place replacement of the refined resource requirement value and the refined resource consumption limit value is supported.

In response to determining that in place replacement is supported (YES branch of decision block304), in step305, the computer or server sets the refined resource requirement value and the refined resource consumption limit value by using the in place replacement.

In response to determining that in place replacement is not supported (NO branch of decision block304), in step306, the computer or server sets the refined resource requirement value and the refined resource consumption limit value by restarting the container.

FIG.4(A)andFIG.4(B)are flowcharts showing operational steps of conditional handling of containers over consumption events, in accordance with one embodiment of the present invention. In one embodiment, the operational steps of conditional handling of containers over consumption events are implemented by a container management system which is hosted by a computer or server (such as computer601inFIG.6).

Referring toFIG.4(A), in step401, the computer or server sets a container that is being started to a pending stability state. In step402, the computer or server determines whether the refined resource consumption limit value is modified beyond a predetermined delta threshold over a last period of time for the container.

In response to determining the refined resource consumption limit value being modified beyond the predetermined delta threshold (YES branch of decision block402), in step403, the computer or server sets the container to the pending stability state. After setting the container to the pending stability state in step403, the computer or server periodically checks whether the refined resource consumption limit value is modified beyond the predetermined delta threshold; the computer or server will periodically iterate step402.

In response to determining the refined resource consumption limit value being modified not beyond the predetermined delta threshold (NO branch of decision block402), in step404, the computer or server sets the container to a stable state. After setting the container to the stable state in step404, the computer or server periodically checks whether the refined resource consumption limit value is modified beyond a predetermined delta threshold; the computer or server will periodically iterate step402.

Referring toFIG.4(B), in step405, the computer or server determines whether the container is in the pending stability state or the stable state. In step406, in response to determining the container being in the pending stability state and in response to determining the container exceeding any of resource consumption limit values for different resources, the computer or server continues running the container without eviction or termination of the container. In step407, in response to determining the container being in the stable state and in response to determining the container exceeding any of resource consumption limit values for different resources, the computer or server takes an action to evict or terminate the container.

FIG.5is a flowchart showing operational steps of handling a container for which resource requirement or resource limit values are updated, in accordance with one embodiment of the present invention. In one embodiment, the operational steps are implemented by a container management system which is hosted by a computer or server (such as computer601inFIG.6).

In step501, the computer or server determines whether the resource requirement value or the resource consumption limit value is updated for the container. In response to determining the resource requirement value is updated for the container, in step502, the computer or server determines whether the resource requirement value is increased or decreased.

Following step502, in response to determining the resource requirement value being increased, in step503, the computer or server determines whether a host running the container meets a demand of an increased amount of the resource requirement value. In response to determining the host meeting the demand (YES branch of decision block503), in step504, the computer or server reserves the increased amount on the host. In response to determining the host not meeting the demand (NO branch of decision block503), in step505, the computer or server marks the container with a resource requirement deficiency flag. For a predetermined time interval in the future, the computer or server attempts to satisfy the demand when any of other containers on the same host completes or is removed. If the predetermined time interval finishes and the deficiency still exists, the computer or server attempts to relocate the container to a host where sufficient resources are available. Upon successful reservation of the increased amount of the resource, the computer or server notifies the container on the successful reservation.

Following step502, in response to determining the resource requirement value being decreased, in step506, the computer or server notifies the container of releasing a decreased amount of the resource requirement value and waits for confirmation from the container. In step507, the computer or server releases the decreased amount to the host.

Following step501, in response to determining the resource consumption limit value is updated for the container, in step508, the computer or server determines whether the resource consumption limit value is increased or decreased.

Following step508, in response to determining the resource consumption limit value being increased, in step509, the computer or server determines whether the resource consumption limit value exceeds a capacity of a host running the container. In response to determining the resource consumption limit value exceeding the capacity of the host, in step510, the computer or server sets the capacity of the host as a new resource consumption limit value. In step511, the computer or server applies the new resource consumption limit value for the container on the host. In response to determining the resource consumption limit value being decreased, in step512, the computer or server applies the resource consumption limit value for the container on the host.

InFIG.6, computing environment600contains an example of an environment for the execution of at least some of the computer code involved in performing the inventive methods, such as program(s)626for global vertical auto-scaling for containers. In addition to block626, computing environment600includes, for example, computer601, wide area network (WAN)602, end user device (EUD)603, remote server604, public cloud605, and private cloud606. In this embodiment, computer601includes processor set610(including processing circuitry620and cache621), communication fabric611, volatile memory612, persistent storage613(including operating system622and block626, as identified above), peripheral device set614(including user interface (UI) device set623, storage624, and Internet of Things (IoT) sensor set625), and network module615. Remote server604includes remote database630. Public cloud605includes gateway640, cloud orchestration module641, host physical machine set642, virtual machine set643, and container set644.

Processor set610includes one, or more, computer processors of any type now known or to be developed in the future. Processing circuitry620may be distributed over multiple packages, for example, multiple, coordinated integrated circuit chips. Processing circuitry620may implement multiple processor threads and/or multiple processor cores. Cache621is memory that is located in the processor chip package(s) and is typically used for data or code that should be available for rapid access by the threads or cores running on processor set610. Cache memories are typically organized into multiple levels depending upon relative proximity to the processing circuitry. Alternatively, some, or all, of the cache for the processor set may be located “off chip.” In some computing environments, processor set610may be designed for working with qubits and performing quantum computing.

Volatile memory612is any type of volatile memory now known or to be developed in the future. Examples include dynamic type random access memory (RAM) or static type RAM. Typically, the volatile memory is characterized by random access, but this is not required unless affirmatively indicated. In computer601, the volatile memory612is located in a single package and is internal to computer601, but, alternatively or additionally, the volatile memory may be distributed over multiple packages and/or located externally with respect to computer601.

End user device (EUD)603is any computer system that is used and controlled by an end user (for example, a customer of an enterprise that operates computer601), and may take any of the forms discussed above in connection with computer601. EUD603typically receives helpful and useful data from the operations of computer601. For example, in a hypothetical case where computer601is designed to provide a recommendation to an end user, this recommendation would typically be communicated from network module615of computer601through WAN602to EUD603. In this way, EUD603can display, or otherwise present, the recommendation to an end user. In some embodiments, EUD603may be a client device, such as thin client, heavy client, mainframe computer, desktop computer and so on.

Remote server604is any computer system that serves at least some data and/or functionality to computer601. Remote server604may be controlled and used by the same entity that operates computer601. Remote server604represents the machine(s) that collect and store helpful and useful data for use by other computers, such as computer601. For example, in a hypothetical case where computer601is designed and programmed to provide a recommendation based on historical data, then this historical data may be provided to computer601from remote database630of remote server604.

Private cloud606is similar to public cloud605, except that the computing resources are only available for use by a single enterprise. While private cloud606is depicted as being in communication with WAN602, in other embodiments a private cloud may be disconnected from the internet entirely and only accessible through a local/private network. A hybrid cloud is a composition of multiple clouds of different types (for example, private, community or public cloud types), often respectively implemented by different vendors. Each of the multiple clouds remains a separate and discrete entity, but the larger hybrid cloud architecture is bound together by standardized or proprietary technology that enables orchestration, management, and/or data/application portability between the multiple constituent clouds. In this embodiment, public cloud605and private cloud606are both part of a larger hybrid cloud.