Container vertical scaling method and device, node, storage medium and computer program product

By obtaining the memory usage of the container and the memory limit of the virtual machine, and dynamically adjusting the container resources, the problem of untimely scaling of containers in Kubernetes is solved, and the stability of the business and resource utilization efficiency are improved.

CN120045281APending Publication Date: 2025-05-27CHINA MOBILE (SUZHOU) SOFTWARE TECH CO LTD +1
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202510096994.X
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-01-21
Publication Date
2025-05-27

AI Technical Summary

Technical Problem

The tools used in Kubernetes to obtain the usage of Java application process resources are distorted, resulting in the container being untimely scalable, which may cause business crashes.

Method used

Dynamically adjust the container's memory resources to achieve more accurate vertical scaling by obtaining the available memory of the container, the memory limit when the virtual machine runs the application, and the container performance indicators.

Benefits of technology

Improve the accuracy of vertical scaling of containers, ensure the normal operation of business, and avoid crashes caused by insufficient resources or waste.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120045281A_ABST
    Figure CN120045281A_ABST
Patent Text Reader

Abstract

The invention discloses a container vertical scaling method and device, a node, a storage medium and a computer program product, and the method comprises the steps: obtaining a first value, first information and second information; based on the first numerical value, the first information and the second information, the container is vertically expanded and contracted; wherein the first numerical value indicates the available memory of the container; the first information represents a memory upper limit which can be used by a virtual machine under the condition that the virtual machine in the container runs a first application; the second information represents performance indexes of the container and at least comprises a second numerical value, and the second numerical value represents the maximum value of the difference between the total memory usage of the container and the memory usage of the first application in the first period.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of computer technology, and in particular to a method, device, node, storage medium and computer program product for vertical scaling of a container. Background Art

[0002] In the related art, the process resource usage acquisition tool provided by Kubernetes, when running a Java application in a Java virtual machine (JVM), obtains distorted process resource usage of the Java application, making it impossible to scale the container in time, causing business crashes. Summary of the invention

[0003] To solve related technical problems, embodiments of the present application provide a container vertical scaling method, device, node, storage medium and computer program product.

[0004] The technical solution of the embodiment of the present application is implemented as follows:

[0005] The present application provides a method for vertically extending and retracting a container, the method comprising:

[0006] Obtain a first value, first information, and second information; the first value indicates available memory of a container; the first information represents an upper limit of memory that can be used by a virtual machine in the container when the virtual machine runs a first application; the second information represents a performance indicator of the container, including at least a second value, and the second value represents a maximum value of a difference between a total memory usage of the container and a memory usage of the first application in a first period;

[0007] The container is vertically scaled based on the first value, the first information, and the second information.

[0008] In the above solution, vertically scaling the container based on the first value, the first information and the second information includes:

[0009] When the third value is less than or equal to the fourth value, adjust the upper limit of memory available to the virtual machine represented by the first information; wherein the third value represents the sum of the fifth value and the upper limit of memory available to the virtual machine represented by the first information, the fifth value is determined according to the sixth value and the second value, and the fourth value is determined according to the seventh value and the first value;

[0010] At least when the third value is greater than the fourth value, the container is rebuilt according to the adjusted upper limit of available memory of the virtual machine.

[0011] In the above solution, at least when the third value is greater than the fourth value, rebuilding the container according to the upper limit of the usable memory of the virtual machine after adjustment includes:

[0012] When the third value is greater than the fourth value and less than an eighth value, the container is rebuilt according to the adjusted upper limit of available memory of the virtual machine; the eighth value is determined according to the ninth value and the first value.

[0013] In the above scheme, the first information includes a tenth value and an eleventh value, and the upper limit of the memory available to the virtual machine is determined based on the tenth value and the eleventh value, the tenth value represents the maximum value of the heap memory of the virtual machine, and the eleventh value represents the maximum memory of the permanent area of ​​the virtual machine.

[0014] In the above scheme, the second information also includes a twelfth value, and the twelfth value represents the total number of global garbage collection (FGC, Full Garbage Collection) performed on the heap memory of the virtual machine in the container within the first cycle. The method also includes:

[0015] Obtaining a thirteenth value; the thirteenth value represents the number of times the container is vertically extended and retracted within the first cycle;

[0016] When the fourteenth value is outside the first interval, the seventh value and / or the ninth value is updated, and the fourteenth value represents the ratio of the twelfth value to the thirteenth value.

[0017] In the above solution, updating the sixth value and / or the eighth value based on the eleventh value, the twelfth value and the first interval includes:

[0018] When the fourteenth value is greater than the maximum value of the first interval, based on the difference between the fourteenth value and the maximum value of the first interval, the seventh value is updated, or the seventh value and the ninth value are updated; or

[0019] When the fourteenth value is smaller than the minimum value of the first interval, the ninth value is updated based on the difference between the minimum value of the first interval and the fourteenth value, or the seventh value and the ninth value are updated.

[0020] In the above solution, the second information also includes a fourteenth value, and the fourteenth value represents an average time consumed for performing FGC on the heap memory of the virtual machine in the container during the first cycle. The method also includes:

[0021] When the fourteenth value is greater than or equal to the first threshold, an alarm message is output, where the alarm message is used to indicate that the number of vertical extension and retraction times of the container reaches an upper limit.

[0022] In the above solution, before obtaining the first value, the first information and the second information, the method further includes:

[0023] Obtaining a running instruction of the container from a first file, where the first file is used to create the container;

[0024] When the running instruction of the container contains a start command of the first application, the second information is collected.

[0025] The embodiment of the present application also provides a container vertical expansion and contraction device, comprising:

[0026] A first acquisition unit is used to acquire a first value, first information, and second information; the first value indicates the available memory of the container; the first information represents an upper limit of memory that can be used by the virtual machine in the container when the virtual machine runs the first application; the second information represents a performance indicator of the container, including at least a second value, and the second value represents a maximum value of a difference between a total memory usage of the container and a memory usage of the first application in a first period;

[0027] A vertical scaling unit is used to vertically scale the container based on the first value, the first information and the second information.

[0028] The embodiment of the present application further provides a node, including a processor and a memory for storing a computer program that can be run on the processor,

[0029] Wherein, the processor is used to execute the steps of any of the above methods when running the computer program.

[0030] An embodiment of the present application further provides a storage medium on which a computer program is stored. When the computer program is executed by a processor, the steps of any of the above methods are implemented.

[0031] An embodiment of the present application also provides a computer program product, including a computer program, which implements the steps of any of the above methods when executed by a processor.

[0032] In the container vertical scaling method, device, node, storage medium and computer program product provided in the embodiments of the present application, the node obtains a first value, a first information and a second information; based on the first value, the first information and the second information, the container is vertically scaled; wherein the first value indicates the available memory of the container; the first information represents the upper limit of the memory that can be used by the virtual machine in the container when the virtual machine runs the first application; the second information represents the performance index of the container, including at least a second value, and the second value represents the maximum value of the difference between the total memory usage of the container and the memory usage of the first application in the first period. In the above scheme, the node can obtain the second information, so that the obtained container memory load situation is more real and effective, and the container can be vertically scaled in combination with the second information, which improves the accuracy of the vertical scaling of the container and ensures the normal operation of the business. BRIEF DESCRIPTION OF THE DRAWINGS

[0033] Figure 1 A flowchart of a method for obtaining the memory usage of a container in the related art;

[0034] Figure 2 A schematic diagram of a process of a method for vertically extending and retracting a container according to an embodiment of the present application;

[0035] Figure 3 A schematic diagram of a process of a method for vertically extending and retracting a container according to an embodiment of the present application;

[0036] Figure 4 This is a schematic diagram of a device structure of a container vertical expansion and contraction method according to an embodiment of the present application;

[0037] Figure 5 This is a schematic diagram of a node structure according to an embodiment of the present application. DETAILED DESCRIPTION

[0038] Kubernetes is an open source container orchestration engine from Google that supports automated deployment, large-scale scalability, and containerized application management. It can run various processes in containers and orchestrate and manage containers through Kubernetes. The computing resources (such as central processing unit (CPU), memory, etc.) that can be used by the process to run are determined by the container that hosts the process. The resources of the container are defined according to the yaml configuration file when it is created. When the computing resources actually used by the process are different from the computing resources defined when the container is created, it is easy to cause insufficient computing resources or waste of resources. Therefore, it is necessary to scale the container regularly. Kubernetes provides horizontal autoscaling (HPA, Horizontal Pod Autoscaler) and vertical autoscaling (VPA, Vertical Pod Autoscaler) functions to cope with scenarios that require horizontal or vertical scaling; HPA achieves horizontal scaling of containers by adjusting the number of pod copies, and VPA achieves vertical scaling of containers by adjusting the size of container resource quotas and rebuilding containers. Pod is the smallest deployment unit in Kubernetes. HPA and VPA obtain container performance indicators or resource usage by calling Kubernetes' resource monitoring metrics interface. When the container performance indicators or resource usage reaches a certain threshold, they automatically scale horizontally or vertically. That is, the scaling behavior of the container depends on the acquisition of the container's performance indicators or resource usage. Kubernetes provides the metrics-server tool to obtain the resource usage of the process from the node control group (node ​​cgroup) and the pod control group (pod cgroup), thereby obtaining the container performance indicators.

[0039] like Figure 1 As shown, the user calls the first interface (such as API metrics.k8s.io) provided by the interface service through a first instruction (such as kubectl top) or triggers HPA or VPA, and obtains container performance indicators from a container performance indicator collection tool (such as metrics-server); the container performance indicator collection tool periodically obtains and stores container resource usage from the node agent (such as Kubelet) of the node; the node agent collects indicator data through a first plug-in (such as cAdvisor), stores the collected indicator data locally or in a third party, and exposes the collected indicator data to a specific first endpoint (such as / metrics / cadvisor) in the form of an HTTP request through the Metrics interface.

[0040] It can be seen that container elastic scaling is based on the resource utilization of the container obtained by cgroup, but the current container resource utilization acquisition scheme tends to ignore special cases. For example, Java applications run in the Java Virtual Machine (JVM), and the JVM has its own memory management mechanism. Therefore, when the container carries a Java application, the container memory utilization obtained through the cgroup cannot take into account the memory of the JVM and cannot accurately reflect the memory load state, thereby interfering with the container's scaling strategy and making the container unable to shrink in time; for example, the minimum operating memory requirement of a container carrying a Java application is 512M, and the maximum heap size (-Xmx, -XX:MaxHeapSize) parameter value of the JVM in the container is 50M. In this case, even if the JVM memory is full, the container memory utilization obtained from the cgroup is still only 10-20%, which does not reach the scaling threshold. If the container access volume continues to increase, it may cause business crashes.

[0041] Based on this, in various embodiments of the present application, the node obtains a first value, first information, and second information; based on the first value, the first information, and the second information, the container is vertically scaled; wherein the first value indicates the available memory of the container; the first information represents the upper limit of the memory that can be used by the virtual machine in the container when the virtual machine runs the first application; the second information represents the performance index of the container, including at least a second value, and the second value represents the maximum value of the difference between the total memory usage of the container and the memory usage of the first application in the first period. In the above scheme, the node can obtain the second information, so that the obtained container memory load situation is more real and effective, and can vertically scale the container in combination with the second information, thereby improving the accuracy of vertical scaling of the container and ensuring the normal operation of the business.

[0042] The present application is further described in detail below in conjunction with the accompanying drawings and embodiments.

[0043] The present application embodiment provides a container vertical scaling method, which is applied to a node, and the node can be any node in a cluster, such as any node in a Kubernetes system. Figure 2 As shown, the method includes:

[0044] Step 201: Obtain a first value, first information, and second information.

[0045] The first value indicates the available memory of the container; the first information represents the upper limit of the memory that can be used by the virtual machine in the container when the virtual machine runs the first application; the second information represents the performance index of the container, and at least includes a second value, and the second value represents the maximum value of the difference between the total memory usage of the container and the memory usage of the first application in the first period.

[0046] Here, the first value can be obtained from the configuration file of the container, the first information can be obtained from the virtual machine in the container, and the second information can be obtained from the tool for collecting resource usage indicators of aggregated containers and nodes; the configuration file of the container can be a YAML (YAML Ain't Markup Language) file, the first value can be understood as the value in containers.resources.requests.memory in the configuration file of the container, which can be expressed as CRRM, and the first value can also be understood as the memory size promised by the Kubernetes system to the container, or the minimum memory requirement for the container to run; the first information can be customized by the user when starting the virtual machine; the component or container performance indicator collection tool for collecting resource usage indicators of aggregated containers and nodes can be metrics-server, which can collect and store the performance indicators of the container in real time or periodically, so that the second information can be obtained by calling the metrics interface; the second value can be expressed as MMEUJ (Max Memory Used Excluding Java), and the second value can also be understood as the upper limit of the memory occupied by the process other than the first application. One or more pods can be run in a node, and a pod contains one or more containers. Pod is the smallest unit created and managed in the Kubernetes system. The first period may be any period, which may be understood as any period in the time period during which the container performance indicator collection tool collects the container performance indicators.

[0047] It should be noted that the first value, the first information and the second information may be obtained regularly or periodically, and the container may be vertically expanded or contracted based on the first value, the first information and the second information.

[0048] In actual applications, when a VPA instance is created, the target object (such as targetRef) of the VPA instance can be obtained, and when the target object of the VPA instance points to a container marked as a JAVA application container, the first value, the first information, and the second information can be obtained; the VPA instance is used to monitor the container corresponding to the target object, and to vertically scale the container when the VPA trigger condition is met. Vertical scaling of containers refers to optimizing the performance of a single pod by adjusting resource requests and restrictions within the pod or container, such as central processing unit (CPU) and memory. The first application can be a JAVA application, and the container can be a container that carries a JAVA application, which can also be called a JAVA application container or a first application container.

[0049] In order to obtain accurate container memory usage, in one embodiment, before obtaining the first value, the first information, and the second information, the method further includes:

[0050] Obtaining a running instruction of the container from a first file, where the first file is used to create the container;

[0051] When the running instruction of the container contains a start command of the first application, the second information is collected.

[0052] Here, when a container is created and run based on the first file, the running instructions of the container can be obtained from the first file; the first file includes a configuration file (such as a yaml file) and an image file (such as a dockerfile file) of the container. Specifically, when a container is created and run based on the first file, the configuration file of the container can be obtained, and the running instructions of the container can be extracted from the configuration file of the container by text parsing means (such as jsonpath); when the running instructions of the container do not exist in the configuration file of the container, the image tag corresponding to the container can be obtained, and the running instructions of the container in the image file can be obtained according to the image tag corresponding to the container. When the running instructions of the container are obtained from the first file, the second information can be collected when the startup command of the first application exists in the running instructions of the container, that is, when the startup command of the first application can be identified in the running instructions of the container. For example, when a JAVA startup command (such as java-jar) is identified in the running instruction of the container, the container is confirmed to be a JAVA application container, and the JAVA application container identifier (such as java-application-contrainer) can be added to the container; then enter the pod, open the JVM monitoring tool jstat to print the garbage collection (GC) information, and call the operating system (OS) interface to calculate the fifteenth value, store the GC information and the fifteenth value in the node specified directory at a regular time, and process the GC information and the fifteenth value to obtain the latest second information, and add the latest second information to the metrics interface return structure, so that the real-time second information can be obtained through the metrics interface. The fifteenth value can represent the difference between the total memory usage of the container at any time and the memory usage of the first application, which can be understood as the total memory usage of processes other than the first application at any time, and can be expressed as MUEJ (Memory Used Excluding Java); the maximum value of the fifteenth value collected in the first cycle is the second value.

[0053] Step 202: vertically scale the container based on the first value, the first information, and the second information.

[0054] Here, the first value, the first information and the second value included in the second information can be compared, and the container can be vertically scaled according to the comparison result. The upper limit of the memory available to the virtual machine and the total amount of memory occupied by processes other than the process of the first application in the total memory usage of the container can be considered as a basis for judging the vertical scaling of the container, so as to avoid the problem that when only the container memory usage obtained through the cgroup is used to vertically scale the container, the JVM memory is full, but due to the memory management mechanism of the JVM, the obtained container memory usage is always in a healthy state, the container scaling conditions are not met, and the container scaling cannot be continued, resulting in a business crash.

[0055] In order to take into account the upper limit of memory available to the JVM and increase the accuracy of vertical scaling of the container, in one embodiment, the first information includes a tenth value and an eleventh value, and the upper limit of memory available to the virtual machine is determined based on the tenth value and the eleventh value, the tenth value represents the maximum value of the heap memory of the virtual machine, and the eleventh value represents the maximum memory of the permanent area of ​​the virtual machine.

[0056] Here, the upper limit of memory available to the virtual machine can be the sum of the tenth value and the eleventh value, or the sum of the tenth value and the eleventh value and related memory settings of other virtual machines; the first information can also be understood as the upper limit of memory occupied by the process of the first application; the tenth value can be expressed as Xmx, and the eleventh value can be expressed as XX:MaxPermSize.

[0057] When using VPA to expand the container memory to prevent memory overflow (OOM, Out of Memory), the probability of OOM occurring in a process within a certain time period can be calculated based on historical operation conditions. When the probability of OOM occurring in a process within a certain time period exceeds a set threshold, the container memory expansion is triggered, that is, the original container is expelled, the first value of the container is increased (CRRM), and the container is recreated based on the increased first value, so that the probability of OOM occurring in the process within a certain time period is less than the set threshold; similarly, the container memory shrinkage can also be triggered. OOM occurs when the memory used by the container exceeds the first value of the container. When the first application is running in the virtual machine in the container, if the tenth value and the eleventh value included in the first information are set too low, the JVM will be running at full load, but the memory usage of the container is always a safe value, and it is considered that there is no possibility of OOM occurring. The conditions for triggering VPA to expand the container can never be met, making VPA invalid; in order to improve the accuracy of calculating the probability of OOM occurring and ensure the normal VPA by adjusting the first value of the container, in one embodiment, the vertical scaling of the container based on the first value, the first information and the second information includes:

[0058] When the third value is less than or equal to the fourth value, adjust the upper limit of memory available to the virtual machine represented by the first information; wherein the third value represents the sum of the fifth value and the upper limit of memory available to the virtual machine represented by the first information, the fifth value is determined according to the sixth value and the second value, and the fourth value is determined according to the seventh value and the first value;

[0059] At least when the third value is greater than the fourth value, the container is rebuilt according to the adjusted upper limit of available memory of the virtual machine.

[0060] Here, the latest first value, first information, and second information can be continuously obtained, and the third information can be calculated based on the first information and the second information, and the fourth value can be calculated based on the first value; the third value is compared with the fourth value; when the third value is less than or equal to the fourth value, it indicates that the memory usage of the container obtained through the cgroup is always low, OOM is unlikely to occur, the VPA memory expansion condition is unreachable, and the VPA is invalid. It is necessary to adjust the upper limit of the memory available to the virtual machine represented by the first information, that is, it is necessary to adjust the tenth value and the eleventh value, so that the third value calculated based on the upper limit of the memory available to the virtual machine represented by the adjusted first information is greater than the fourth value, and the container is rebuilt based on the upper limit of the memory available to the virtual machine represented by the adjusted first information, so that the memory usage of the container can be accurately obtained in the subsequent period, and the accuracy of the vertical scaling of the container is improved. The third value can be understood as the upper limit of the memory required to be used by the container, which can be the sum of the fifth value and the tenth value and the eleventh value included in the first information; the fifth value can be the product of the sixth value and the second value, and the sixth value can be a constant greater than 1. The fourth value can be the product of the seventh value and the first value, and the seventh value can also be a constant greater than 1, and the initial value can be 1.

[0061] It should be noted that adjusting the upper limit of memory available for the virtual machine represented by the first information may be adjusting the tenth value and the eleventh value in proportion to the ratio of the initial values ​​of the tenth value and the eleventh value. The initial values ​​of the tenth value and the eleventh value may be set by the user when starting the virtual machine. When the third value is less than or equal to the fourth value, the tenth value and the eleventh value may be increased in proportion to the ratio of the initial values ​​of the tenth value and the eleventh value.

[0062] It should be noted that each time the container is scaled, the tenth value and the eleventh value need to be adjusted so that the calculated third value is always greater than the fourth value. That is, when the memory usage of the container reaches the container scaling threshold or meets other container scaling conditions, when the first value is adjusted, the tenth value and the eleventh value also need to be adjusted at the same time, so that the third value calculated based on the obtained second value, the adjusted first value, the adjusted tenth value and the adjusted eleventh value is greater than the fourth value.

[0063] In this embodiment, the upper limit of the memory available to the virtual machine represented by the first information is adjusted by comparing the third value with the fourth value, so that the third value is always greater than the fourth value. The third value being greater than the fourth value can be expressed by the following inequality 1:

[0064] Xmx+XX:MaxPermSize+a×MMUEJ>L×CRRM

[0065] Among them, Xmx+XX:MaxPermSize+a×MMUEJ represents the third value, Xmx represents the tenth value, XX:MaxPermSize represents the eleventh value, a represents the sixth value, MMUEJ represents the second value; L×CRRM represents the fourth value, L represents the seventh value, and CRRM represents the first value.

[0066] In this embodiment, based on the first value, the first information, and the second information obtained in real time, periodically, or regularly, the tenth value and the eleventh value in the first information can be dynamically adjusted to obtain a more realistic and effective container memory load state, and the probability of OOM occurring in the container is controlled within a suitable range, thereby improving the accuracy of VPA for the container.

[0067] In the case of improper user configuration, or when the increase of the upper limit of the memory available to the virtual machine is triggered multiple times during the operation of the container, so that the tenth value is much larger than the first value, the available memory considered by the virtual machine is much larger than the actual available memory, making it impossible to perform GC in time and release memory in time, thus causing OOM. Therefore, it is necessary to limit the unlimited expansion of the upper limit of the memory available to the virtual machine. Based on this, in one embodiment, at least when the third value is greater than the fourth value, the container is rebuilt according to the upper limit of the available memory of the virtual machine after adjustment, including:

[0068] When the third value is greater than the fourth value and less than an eighth value, the container is rebuilt according to the adjusted upper limit of available memory of the virtual machine; the eighth value is determined according to the ninth value and the first value.

[0069] Here, when the third value is less than or equal to the fourth value, the upper limit of the memory available to the virtual machine represented by the first information can be adjusted, that is, the tenth value and the eleventh value are adjusted, so that the third value calculated based on the adjusted tenth value and the eleventh value is greater than the fourth value and less than the eighth value, and the container is rebuilt according to the adjusted tenth value and the adjusted eleventh value. The eighth value can be the product of the ninth value and the first value, the ninth value can be a constant greater than the seventh value, and the initial value can be 1.2.

[0070] It should be noted that each time the container is scaled, the tenth value and the eleventh value need to be adjusted so that the calculated third value is always greater than the fourth value and less than the eighth value. That is, when the memory usage of the container reaches the container scaling threshold or meets other container scaling conditions, when the first value is adjusted, the tenth value and the eleventh value also need to be adjusted at the same time, so that the third value calculated based on the obtained second value, the adjusted first value, the adjusted tenth value and the adjusted eleventh value is greater than the fourth value and less than the eighth value.

[0071] In this embodiment, the infinite expansion of the tenth and eleventh values ​​can be controlled by increasing the eighth value, so that the third value remains between the fourth and eighth values, thereby preventing the VPA from being completely or frequently triggered. The third value is greater than the fourth value and less than the eighth value, which can be expressed by the following inequality 2:

[0072] L×CRRM>Xmx+XX:MaxPermSize+a×MMUEJ>U×CRRM

[0073] Among them, U×CRRM represents the fourth value, and U represents the ninth value.

[0074] When the container memory usage is too high, in addition to triggering VPA expansion, the GC mechanism can also be triggered, that is, FGC is triggered to reduce memory usage, that is, the triggering of FGC will also affect the triggering of VPA. When the GC process is working, other processes will be suspended, resulting in business suspension. Frequent triggering of FGC will cause frequent business freezes, affecting user experience; VPA expansion requires rebuilding the container. If the number of FGC triggers is too small, that is, most of the high-load states are solved by triggering VPA expansion, it will cause multiple business interruptions and extend the duration of the business. Therefore, in order to ensure the smooth progress of the process and speed up the running speed of the process, it is necessary to balance the triggering frequency of FGC and VPA. Based on this, in one embodiment, the second information also includes a twelfth value, and the twelfth value represents the total number of global garbage collection FGCs on the heap memory of the virtual machine in the container during the second cycle. The method also includes:

[0075] Obtaining a thirteenth value; the thirteenth value represents the number of times the container is vertically extended and retracted in the second period;

[0076] When the fourteenth value is outside the first interval, the seventh value and / or the ninth value is updated, and the fourteenth value represents the ratio of the twelfth value to the thirteenth value.

[0077] Here, in the case of obtaining the first value, the first information, and the second information, the thirteenth value can also be obtained; the fourteenth value is obtained based on the ratio of the twelfth value and the thirteenth value; based on the fourteenth value and the first interval, it is determined whether the seventh value and / or the ninth value needs to be updated, that is, whether the triggering frequency of FGC and VPA needs to be controlled; when the fourteenth value is outside the first interval, the seventh value and / or the ninth value is updated. The first interval can be configured by the user based on actual business needs. The thirteenth value can be obtained from the log data. Vertical scaling of containers includes expanding and shrinking the container. In order to better balance the triggering ratio of FGC and VPA, only the number of times the container is expanded in the first cycle can be obtained, that is, the thirteenth value can only represent the number of times the container is expanded in the first cycle. The fourteenth value can be expressed as Among them, FGCT is the twelfth value and VPAT is the thirteenth value.

[0078] It should be noted that after the seventh value and / or the ninth value are updated, the fourth value and / or the eighth value can be recalculated immediately based on the updated seventh value and / or the ninth value; it is determined whether the third value is greater than the fourth value, or whether it is greater than the fourth value and less than the eighth value; when the third value is less than or equal to the fourth value, the tenth value and the eleventh value are adjusted so that based on the adjusted tenth value and the eleventh value, as well as the first value and the second information, the calculated third value is greater than the fourth value, that is, it satisfies the above inequality one; or is greater than the fourth value and less than the eighth value, that is, it satisfies the above inequality two. Normally, recalculating the fourth value and / or the eighth value based on the updated seventh value and / or the ninth value will cause the above inequality one or inequality two to fail.

[0079] It should be noted that the calculation of the third value based on the second value and other values ​​to determine whether it is necessary to adjust the upper limit of the memory available to the virtual machine represented by the first information, and the calculation of the fourteenth value based on the twelfth value and the thirteenth value to determine whether it is necessary to update the seventh value and / or the ninth value can occur in different time periods or in the same time period.

[0080] In this embodiment, the triggering ratio of FGC and VPA can be dynamically balanced without modifying the FGC and VPA algorithms, thereby realizing non-intrusive dynamic control of the triggering ratio of FGC and VPA to meet different business requirements.

[0081] In order to balance the triggering frequency of FGC and VPA, ensure the smooth progress of the business, and improve the user experience, in one embodiment, updating the sixth value and / or the eighth value based on the eleventh value, the twelfth value, and the first interval includes:

[0082] When the fourteenth value is greater than the maximum value of the first interval, based on the difference between the fourteenth value and the maximum value of the first interval, the seventh value is updated, or the seventh value and the ninth value are updated; or

[0083] When the fourteenth value is smaller than the minimum value of the first interval, the ninth value is updated based on the difference between the minimum value of the first interval and the fourteenth value, or the seventh value and the ninth value are updated.

[0084] Here, when the fourteenth value is greater than the maximum value of the first interval, the seventh value is increased based on the difference between the fourteenth value and the maximum value of the first interval, which can be understood as increasing the seventh value based on the portion of the fourteenth value that exceeds the first interval; there can be a set functional relationship between the difference between the fourteenth value and the maximum value of the first interval and the increase of the seventh value, for example, the seventh value can be increased arithmetic or geometrically according to the difference between the fourteenth value and the maximum value of the first interval. In the case of increasing the seventh value, the third value may be less than or equal to the fourth value calculated based on the increased seventh value. In order to keep the third value always greater than the fourth value, it is necessary to increase the tenth value and the eleventh value, that is, the seventh value increases, the tenth value and the eleventh value will also increase accordingly, that is, the difference between the third value and the first value increases, thereby increasing the probability of OOM and increasing the probability of triggering VPA; and, due to the increase of the tenth value, the threshold for triggering FGC will increase, the frequency of triggering FGC will decrease, so that the thirteenth value obtained in the next time period increases, the twelfth value decreases, and the fourteenth value calculated by the ratio of the twelfth value to the thirteenth value will also decrease, so that the fourteenth value is within the first interval. When the fourteenth value is still greater than the maximum value of the first interval, the above steps may be repeated, that is, the seventh value is increased until the fourteenth value is within the first interval.

[0085] When the fourteenth value is less than the minimum value of the first interval, the ninth value is reduced based on the difference between the minimum value of the first interval and the fourteenth value. This can be understood as reducing the ninth value based on the part of the fourteenth value that is lower than the first interval. There can be a set functional relationship between the difference between the minimum value of the first interval and the fourteenth value and the reduced value of the ninth value. For example, the ninth value can be reduced arithmetic or geometrically according to the difference between the minimum value of the first interval and the fourteenth value. In the case where the ninth value is reduced, the third value may be greater than or equal to the eighth value calculated based on the reduced ninth value. In order to keep the third value always less than the eighth value, the tenth value and the eleventh value need to be reduced, that is, the ninth value is reduced, and the tenth value and the eleventh value will also be reduced accordingly, that is, the difference between the third value and the first value is reduced, thereby reducing the probability of OOM and the probability of triggering VPA; and, due to the reduction of the tenth value, the threshold for triggering FGC is reduced, and the frequency of triggering FGC is increased, so that the thirteenth value obtained in the next time period is reduced, the twelfth value is increased, and the fourteenth value calculated by the ratio of the twelfth value and the thirteenth value is also increased, so that the fourteenth value is within the first interval. In the case where the fourteenth value is still less than the maximum value of the first interval, the above steps can be repeated, that is, the ninth value is reduced until the fourteenth value is within the first interval.

[0086] It should be noted that, when the increased seventh value is greater than or equal to the ninth value, the ninth value needs to be increased synchronously so that the ninth value is always greater than the seventh value; similarly, when the decreased ninth value is less than or equal to the seventh value, the seventh value also needs to be decreased synchronously so that the seventh value is always less than the ninth value. The seventh value and the ninth value can be used to adjust the probability that the third value exceeds the first value, that is, to adjust the probability of OOM, thereby adjusting the probability of triggering VPA to balance the triggering ratio of FGC and VPA.

[0087] After the tenth value is enlarged, that is, after the heap memory of the virtual machine is enlarged, the time consumption of a single FGC may increase, affecting the business. For example, when the heap memory usage of the virtual machine reaches more than 10 gigabytes (G), an FGC may take more than 10 seconds (s), which exceeds the tolerable range of business jams and affects user experience. Therefore, it is necessary to monitor the FGC duration and adjust the memory load mechanism in time. In one embodiment, the second information also includes a fourteenth value, and the fourteenth value represents the average time consumption of performing FGC on the heap memory of the virtual machine in the container during the first period. The method also includes:

[0088] When the fourteenth value is greater than or equal to the first threshold, an alarm message is output, where the alarm message is used to indicate that the number of vertical extension and retraction times of the container reaches an upper limit.

[0089] Here, when the fourteenth value is greater than or equal to the first threshold, an alarm message is output, that is, an alarm is issued to the user or administrator, indicating that the memory load problem cannot be solved by FGC and VPA alone at this time, and the load strategy needs to be changed, such as introducing HPA and other methods to share the load pressure. The first threshold can be customized by the user.

[0090] The present application is described in further detail below in conjunction with application examples.

[0091] like Figure 3 As shown in FIG. 1 , the container vertical scaling method is applied to a node, including the following steps:

[0092] Step 301: Obtain a running instruction of a container from a first file, and if a startup command of a first application exists in the running instruction of the container, collect second information.

[0093] Here, when the container is determined to be the first application container through the startup command of the first application present in the running instruction of the container, the container indicator collection tool (such as metrics-server) in the node can regularly collect and store GC information through the JVM monitoring tool (such as jstat), and at the same time, regularly call the OS interface to calculate and record the value of MUEJ; when the GC information and the value of MUEJ are collected, the collected GC information and the value of MUEJ are aggregated so that the second information can be obtained later through the interface of the container indicator collection tool. The second information can include a second value (which can be understood as MMUEJ), a fifth value (which can be understood as FGCT) and a seventh value (which can be understood as FGCA).

[0094] Step 302: Obtain a first value, first information, and second information.

[0095] Here, the specific implementation process of step 302 please refer to the relevant description above, which will not be repeated here.

[0096] Step 303: When the third value is less than or equal to the fourth value, adjust the upper limit of the memory available to the virtual machine represented by the first information.

[0097] Here, when the third value is less than or equal to the fourth value, the specific implementation process of adjusting the upper limit of the memory available to the virtual machine represented by the first information is referred to the above related description, which is not repeated here.

[0098] When the third value is greater than the fourth value, the first value, the first information and the second information continue to be acquired in the next time period, that is, step 302 is executed.

[0099] It should be noted that the first value may change due to the normal triggering and execution of the VPA, the first information may change when the third value is less than or equal to the fourth value, and the second information may also change based on the actual execution of the process. Therefore, the latest first value, first information and second information can be re-acquired in each time period.

[0100] Step 304: Obtain a thirteenth value. When the fourteenth value is outside the first interval, update the seventh value and / or the ninth value. The fourteenth value represents the ratio of the twelfth value to the thirteenth value.

[0101] Here, when the seventh value and / or the ninth value are updated, the fourth value may be recalculated based on the updated seventh value and / or the ninth value; and the third value and the fourth value are compared to execute step 303 .

[0102] Step 305: Rebuild the container according to the adjusted upper limit of available memory of the virtual machine.

[0103] Here, when the third value is greater than the fourth value, the container can be rebuilt according to the adjusted upper limit of available memory of the virtual machine; or, when the third value is greater than the fourth value and less than the eighth value, the container can be rebuilt according to the adjusted upper limit of available memory of the virtual machine.

[0104] Here, the specific implementation process of step 305 can be found in the above description, which will not be repeated here.

[0105] In order to implement the node-side method of the embodiment of the present application, the embodiment of the present application further provides a container vertical expansion and contraction device, which is arranged on the node, such as Figure 4 As shown, the device comprises:

[0106] A first acquisition unit 401 is used to acquire a first value, first information, and second information; the first value indicates the available memory of the container; the first information represents the upper limit of the memory that can be used by the virtual machine in the container when the virtual machine runs the first application; the second information represents the performance index of the container, including at least a second value, and the second value represents the maximum value of the difference between the total memory usage of the container and the memory usage of the first application in the first period;

[0107] The vertical scaling unit 402 is configured to vertically scale the container based on the first value, the first information, and the second information.

[0108] In one embodiment, the vertical scaling unit 402 is specifically configured to adjust the upper limit of memory available to the virtual machine represented by the first information when the third value is less than or equal to the fourth value; wherein the third value represents the sum of the fifth value and the upper limit of memory available to the virtual machine represented by the first information, the fifth value is determined according to the sixth value and the second value, and the fourth value is determined according to the seventh value and the first value;

[0109] At least when the third value is greater than the fourth value, the container is rebuilt according to the adjusted upper limit of available memory of the virtual machine.

[0110] In one embodiment, the vertical scaling unit 402 is specifically used to rebuild the container according to the adjusted upper limit of available memory of the virtual machine when the third value is greater than the fourth value and the third value is less than an eighth value; the eighth value is determined based on the ninth value and the first value.

[0111] In one embodiment, the first information includes a tenth value and an eleventh value, and the upper limit of memory available to the virtual machine is determined based on the tenth value and the eleventh value, the tenth value represents the maximum value of the heap memory of the virtual machine, and the eleventh value represents the maximum memory of the permanent area of ​​the virtual machine.

[0112] In one embodiment, the second information further includes a twelfth value, and the twelfth value represents the total number of times that the heap memory of the virtual machine in the container is subjected to global garbage collection FGC in the first cycle, and the device further includes:

[0113] A second acquisition unit is used to acquire a thirteenth value; the thirteenth value represents the number of times the container is vertically extended and retracted within the first cycle;

[0114] An updating unit is used to update the seventh value and / or the ninth value when the fourteenth value is outside the first interval, and the fourteenth value represents the ratio of the twelfth value to the thirteenth value.

[0115] In one embodiment, the updating unit is specifically configured to update the seventh value, or update the seventh value and the ninth value, based on a difference between the fourteenth value and the maximum value of the first interval when the fourteenth value is greater than the maximum value of the first interval; or

[0116] When the fourteenth value is smaller than the minimum value of the first interval, the ninth value is updated based on the difference between the minimum value of the first interval and the fourteenth value, or the seventh value and the ninth value are updated.

[0117] In one embodiment, the second information further includes a fourteenth value, and the fourteenth value represents an average time consumed for performing FGC on the heap memory of the virtual machine in the container during the first cycle, and the device further includes:

[0118] The output unit is used to output an alarm message when the fourteenth value is greater than or equal to the first threshold, wherein the alarm message is used to indicate that the number of vertical extension and retraction times of the container reaches an upper limit.

[0119] In one embodiment, the device further comprises:

[0120] a third acquiring unit, configured to acquire, before acquiring the first value, the first information, and the second information, an operating instruction of the container from a first file, where the first file is used to create the container;

[0121] A collecting unit is used to collect the second information when a start command of the first application exists in the running instruction of the container.

[0122] In practical applications, the output unit can be implemented by a processor in the container vertical expansion and contraction device in combination with a communication interface; the first acquisition unit 401, the vertical expansion and contraction unit 402, the second acquisition unit, the update unit, the third acquisition unit and the collection unit can be implemented by a processor in the container vertical expansion and contraction device.

[0123] It should be noted that: the above embodiment provides a container vertical expansion and contraction device, and only uses the division of the above program modules as an example to illustrate when performing vertical expansion and contraction of the container. In actual applications, the above processing can be assigned to different program modules as needed, that is, the internal structure of the device is divided into different program modules to complete all or part of the above-described processing. In addition, the container vertical expansion and contraction device provided in the above embodiment and the container vertical expansion and contraction method embodiment belong to the same concept, and the specific implementation process is detailed in the method embodiment, which will not be repeated here.

[0124] Based on the hardware implementation of the above program modules, and in order to implement the method of the node side of the embodiment of the present application, the embodiment of the present application also provides a node, such as Figure 5 As shown, the node 500 includes:

[0125] The communication interface 501 can exchange information with other network nodes.

[0126] The processor 502 is connected to the communication interface 501 to implement information interaction with other network nodes, and is used to execute the methods provided by one or more of the above technical solutions when running a computer program.

[0127] The memory 503 is used to store computer programs that can be executed on the processor 502 .

[0128] Specifically, the processor 502 is used to obtain a first value, first information, and second information; the first value indicates the available memory of the container; the first information represents an upper limit of memory that can be used by the virtual machine in the container when the virtual machine runs the first application; the second information represents a performance indicator of the container, including at least a second value, and the second value represents a maximum value of a difference between a total memory usage of the container and a memory usage of the first application in a first period;

[0129] The container is vertically scaled based on the first value, the first information, and the second information.

[0130] In one embodiment, the processor 502 is specifically configured to adjust an upper limit of memory available to the virtual machine represented by the first information when the third value is less than or equal to the fourth value; wherein the third value represents the sum of a fifth value and an upper limit of memory available to the virtual machine represented by the first information, the fifth value is determined according to the sixth value and the second value, and the fourth value is determined according to the seventh value and the first value;

[0131] At least when the third value is greater than the fourth value, the container is rebuilt according to the adjusted upper limit of available memory of the virtual machine.

[0132] In one embodiment, the processor 502 is specifically used to rebuild the container according to the adjusted upper limit of available memory of the virtual machine when the third value is greater than the fourth value and the third value is less than an eighth value; the eighth value is determined based on the ninth value and the first value.

[0133] In one embodiment, the first information includes a tenth value and an eleventh value, and the upper limit of memory available to the virtual machine is determined based on the tenth value and the eleventh value, the tenth value represents the maximum value of the heap memory of the virtual machine, and the eleventh value represents the maximum memory of the permanent area of ​​the virtual machine.

[0134] In one embodiment, the second information further includes a twelfth value, the twelfth value represents the total number of times the global garbage collection FGC is performed on the heap memory of the virtual machine in the container in the first cycle, and the processor 502 is further used to obtain a thirteenth value; the thirteenth value represents the number of times the container is vertically scaled in the first cycle;

[0135] When the fourteenth value is outside the first interval, the seventh value and / or the ninth value is updated, and the fourteenth value represents the ratio of the twelfth value to the thirteenth value.

[0136] In one embodiment, the processor 502 is specifically configured to update the seventh value, or update the seventh value and the ninth value, based on a difference between the fourteenth value and the maximum value of the first interval when the fourteenth value is greater than the maximum value of the first interval; or

[0137] When the fourteenth value is smaller than the minimum value of the first interval, the ninth value is updated based on the difference between the minimum value of the first interval and the fourteenth value, or the seventh value and the ninth value are updated.

[0138] In one embodiment, the second information also includes a fourteenth value, and the fourteenth value represents the average time consumed for FGC of the heap memory of the virtual machine in the container during the first cycle. The communication interface 501 is used to output an alarm message when the fourteenth value is greater than or equal to the first threshold, and the alarm message is used to indicate that the number of vertical scaling times of the container has reached an upper limit.

[0139] In one embodiment, the processor 502 is further configured to obtain an execution instruction of the container from a first file, where the first file is used to create the container;

[0140] When the running instruction of the container contains a start command of the first application, the second information is collected.

[0141] It should be noted that the specific processing process of the processor 502 and the communication interface 501 can be understood by referring to the above method.

[0142] Of course, in actual application, the various components in the node 500 are coupled together through the bus system 504. It can be understood that the bus system 504 is used to realize the connection and communication between these components. In addition to the data bus, the bus system 504 also includes a power bus, a control bus, and a status signal bus. However, for the sake of clarity, Figure 5 Various buses are labeled as bus system 504 .

[0143] The memory 503 in the embodiment of the present application is used to store various types of data to support the operation of the node 500. Examples of such data include: any computer program used to operate on the node 500.

[0144] The method disclosed in the above embodiment of the present application can be applied to the processor 502, or implemented by the processor 502. The processor 502 may be an integrated circuit chip with signal processing capabilities. In the implementation process, each step of the above method can be completed by the hardware integrated logic circuit or software instructions in the processor 502. The above-mentioned processor 502 may be a general-purpose processor, a digital signal processor (DSP, Digital Signal Processor), or other programmable logic devices, discrete gates or transistor logic devices, discrete hardware components, etc. The processor 502 can implement or execute the methods, steps and logic block diagrams disclosed in the embodiments of the present application. A general-purpose processor may be a microprocessor or any conventional processor, etc. In combination with the steps of the method disclosed in the embodiment of the present application, it can be directly embodied as a hardware decoding processor to execute, or it can be executed by a combination of hardware and software modules in the decoding processor. The software module can be located in a storage medium, which is located in the memory 503, and the processor 502 reads the information in the memory 503 and completes the steps of the above method in combination with its hardware.

[0145] In an exemplary embodiment, the node 500 may be implemented by one or more application specific integrated circuits (ASIC), DSP, programmable logic device (PLD), field programmable gate array (FPGA), general processor, controller, microcontroller (MCU), microprocessor, or other electronic components to execute the aforementioned method.

[0146] It can be understood that the memory (memory 503) of the embodiment of the present application can be a volatile memory or a non-volatile memory, and can also include both a volatile memory and a non-volatile memory. Among them, the non-volatile memory can be a read-only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), a magnetic random access memory (FRAM), a flash memory, a magnetic surface memory, an optical disc, or a compact disc read-only memory (CD-ROM); the magnetic surface memory can be a disk memory or a tape memory. The volatile memory can be a random access memory (RAM), which is used as an external cache. By way of example and not limitation, many forms of RAM are available, such as static random access memory (SRAM), synchronous static random access memory (SSRAM), dynamic random access memory (DRAM), synchronous dynamic random access memory (SDRAM), double data rate synchronous dynamic random access memory (DDRSDRAM), enhanced synchronous dynamic random access memory (ESDRAM), synchronous link dynamic random access memory (SLDRAM, SyncLink Dynamic Random Access Memory), and direct RAM bus random access memory (DRRAM, Direct Rambus Random Access Memory).The memory described in the embodiments of the present application is intended to include, but is not limited to, these and any other suitable types of memory.

[0147] In an exemplary embodiment, the present application also provides a storage medium, namely a computer storage medium, specifically a computer-readable storage medium, for example, including a memory 503 storing a computer program, and the computer program can be executed by a processor 502 of a node 500 to complete the steps of the aforementioned node-side method. The computer-readable storage medium can be a memory such as FRAM, ROM, PROM, EPROM, EEPROM, Flash Memory, magnetic surface storage, optical disk, or CD-ROM.

[0148] Illustratively, an embodiment of the present application further provides a computer program product, including a computer program, and the computer program can be executed by the processor 502 of the node 500 to complete the steps of any of the aforementioned methods.

[0149] It should be noted that "first", "second", etc. are used to distinguish similar objects, and are not necessarily used to describe a specific order or sequence; "multiple" refers to two or more items. The term "and / or" herein is merely a description of the association relationship of associated objects, indicating that three relationships may exist. For example, A and / or B may represent: A exists alone, A and B exist at the same time, and B exists alone. In addition, the technical solutions described in the embodiments of the present application may be arbitrarily combined without conflict. The above is only a preferred embodiment of the present application and is not intended to limit the scope of protection of the present application.

Claims

1. A method for vertically extending a container, characterized in that: The method comprises: Obtain a first value, first information, and second information; the first value indicates available memory of a container; the first information represents an upper limit of memory that can be used by a virtual machine in the container when the virtual machine runs a first application; the second information represents a performance indicator of the container, including at least a second value, and the second value represents a maximum value of a difference between a total memory usage of the container and a memory usage of the first application in a first period; The container is vertically scaled based on the first value, the first information, and the second information.

2. The method according to claim 1, characterized in that The vertically scaling the container based on the first value, the first information, and the second information includes: When the third value is less than or equal to the fourth value, adjust the upper limit of memory available to the virtual machine represented by the first information; wherein the third value represents the sum of the fifth value and the upper limit of memory available to the virtual machine represented by the first information, the fifth value is determined according to the sixth value and the second value, and the fourth value is determined according to the seventh value and the first value; At least when the third value is greater than the fourth value, the container is rebuilt according to the adjusted upper limit of available memory of the virtual machine.

3. The method according to claim 2, characterized in that At least when the third value is greater than the fourth value, rebuilding the container according to the upper limit of the usable memory of the virtual machine after adjustment includes: When the third value is greater than the fourth value and less than an eighth value, the container is rebuilt according to the adjusted upper limit of available memory of the virtual machine; the eighth value is determined according to the ninth value and the first value.

4. The method according to claim 2 or 3, characterized in that: The first information includes a tenth value and an eleventh value, and the upper limit of the memory available to the virtual machine is determined based on the tenth value and the eleventh value, the tenth value represents the maximum value of the heap memory of the virtual machine, and the eleventh value represents the maximum memory of the permanent area of ​​the virtual machine.

5. The method according to claim 3, characterized in that: The second information further includes a twelfth value, where the twelfth value represents the total number of times that global garbage collection FGC is performed on the heap memory of the virtual machine in the container during the first cycle. The method further includes: Obtaining a thirteenth value; the thirteenth value represents the number of times the container is vertically extended and retracted within the first cycle; When the fourteenth value is outside the first interval, the seventh value and / or the ninth value is updated, and the fourteenth value represents the ratio of the twelfth value to the thirteenth value.

6. The method according to claim 5, characterized in that The updating of the sixth value and / or the eighth value based on the eleventh value, the twelfth value and the first interval includes: When the fourteenth value is greater than the maximum value of the first interval, based on the difference between the fourteenth value and the maximum value of the first interval, the seventh value is updated, or the seventh value and the ninth value are updated; or When the fourteenth value is smaller than the minimum value of the first interval, the ninth value is updated based on the difference between the minimum value of the first interval and the fourteenth value, or the seventh value and the ninth value are updated.

7. The method according to any one of claims 1 to 3, 5 to 6, characterized in that: The second information further includes a fourteenth value, where the fourteenth value represents an average time consumed for performing FGC on the heap memory of the virtual machine in the container during the first cycle, and the method further includes: When the fourteenth value is greater than or equal to the first threshold, an alarm message is output, where the alarm message is used to indicate that the number of vertical extension and retraction times of the container reaches an upper limit.

8. The method according to claim 1, characterized in that Before obtaining the first value, the first information, and the second information, the method further includes: Obtaining a running instruction of the container from a first file, where the first file is used to create the container; When the running instruction of the container contains a start command of the first application, the second information is collected.

9. A container vertical expansion and contraction device, characterized in that: include: A first acquisition unit, used to acquire a first value, first information, and second information; The first value indicates the available memory of the container; The first information represents an upper limit of memory that can be used by the virtual machine in the container when the virtual machine runs the first application; The second information represents a performance indicator of the container, and includes at least a second value, where the second value represents a maximum value of a difference between a total memory usage of the container and a memory usage of the first application in a first period; A vertical scaling unit is used to vertically scale the container based on the first value, the first information and the second information.

10. A node, characterized in that: comprising a processor and a memory for storing a computer program capable of being executed on the processor, Wherein, when the processor is used to run the computer program, it executes the steps of the method described in any one of claims 1 to 8.

11. A storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 8 are implemented.

12. A computer program product, comprising a computer program, characterized in that The computer program implements the steps of the method according to any one of claims 1 to 8 when executed by a processor.