Container resource adaptive allocation system and method, computer device and medium
By using a container resource adaptive allocation system, the number of container resources and replicas is dynamically adjusted, which solves the problem of unreasonable resource allocation in reused equipment and improves resource utilization and service stability.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- BEIJING SIMULATION CENT
- Filing Date
- 2023-03-28
- Publication Date
- 2026-06-02
AI Technical Summary
In situations where existing equipment or resources are insufficient, the unreasonable allocation of service resources in existing technologies leads to low resource utilization or resource shortages, affecting user experience.
An adaptive container resource allocation system is adopted, which uses machine learning algorithms to dynamically adjust the number of container resources and replicas through a judgment module, a container resource adaptive module, and a container replica adaptive module, and makes real-time adjustments based on access volume and resource utilization.
It improved resource utilization, avoided resource waste and shortages, and ensured service stability and user experience.
Smart Images

Figure CN116302357B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of resource adaptation. More specifically, it relates to a container resource adaptive allocation system and method, computer equipment, and media. Background Technology
[0002] With the development of cloud platform technology, more and more enterprises are deploying services to cloud platforms. However, due to the high price of hardware and limited funds, they often use existing equipment to build their cloud platform environments. Cloud platforms built using existing equipment frequently suffer from low resource utilization or resource shortages due to unreasonable allocation of service resources. To address the shortcomings of existing equipment resources, a more rational allocation of service resources is needed.
[0003] In developing this invention, the inventors discovered at least the following problems in the prior art: Service access types mainly include two categories: high-concurrency services and low-concurrency services. For high-concurrency services, current cloud platform technology can solve the parallelism problem by creating multiple service replicas. However, service concurrency is usually concentrated within a certain time period and is not consistently high. Creating too many service replicas initially leads to a waste of service resources. For low-concurrency services, service resources can be configured based on experience. However, excessive service access during a certain period may cause service latency. Allocating too many resources initially results in wasted resources for most of the time. Both high-concurrency and low-concurrency services encounter resource waste or resource constraints, leading to a poor user experience for users using older or less resource-efficient equipment.
[0004] Therefore, there is a need to provide a container resource adaptive allocation system and method, computer equipment and media. Summary of the Invention
[0005] The purpose of this invention is to provide a container resource adaptive allocation system and method, computer device and medium to solve at least one of the problems existing in the prior art.
[0006] To achieve the above objectives, the present invention adopts the following technical solution:
[0007] The first aspect of this invention provides a container resource adaptive allocation system, which includes a judgment module, a container resource adaptive module, and a container replica adaptive module, wherein...
[0008] The judgment module is used to determine whether the number of accesses to the service within a first preset time period is higher than a first preset threshold.
[0009] The container resource adaptive module is used to dynamically adjust container resources when the service access volume does not exceed a first preset threshold within a first preset time period.
[0010] The container replica adaptive module is used to adjust the container replica when the number of service accesses exceeds a first preset threshold within a first preset time period.
[0011] Optionally, the container resource adaptive module includes a first threshold judgment module and a resource scheduling module, wherein,
[0012] The first threshold judgment module is used to determine whether the utilization rate of resources within the second preset time period is higher than the second preset threshold of container resources, and is also used to determine whether the utilization rate of resources within the second preset time period is lower than or equal to the third preset threshold of container resources.
[0013] The resource scheduling module is used to increase container resources when the utilization rate of resources within a second preset time period is higher than a second preset threshold of container resources, based on the judgment result; and to reclaim container resources when the judgment result is lower than or equal to a third preset threshold of container resources, so as to dynamically adjust the utilization rate of container resources.
[0014] Optionally, the container replica adaptive module includes a second threshold determination module and a service scheduling module, wherein,
[0015] The second threshold judgment module is used to determine whether the utilization rate of container resources has reached the fourth preset threshold.
[0016] The service scheduling module is used to increase the number of service replicas when the utilization rate of container resources reaches a fourth preset threshold, and decrease the number of service replicas when the threshold is not reached, in order to adjust the number of container replicas.
[0017] Optionally, the container resource adaptive module further includes a first calculation module, which uses a machine learning algorithm to fit the utilization rate of container resources to calculate whether the container resources have reached the second preset threshold and the third preset threshold of the container.
[0018] Optionally, the container replica adaptive module further includes a second calculation module, which uses a machine learning algorithm to fit the utilization rate of container resources to calculate whether the container resources have reached a fourth preset threshold.
[0019] A second aspect of the present invention provides a container resource adaptive allocation method, the method comprising:
[0020] Determine whether the number of accesses to the service within the first preset time period is higher than the first preset threshold: if it is not higher than the first preset threshold, then dynamically adjust the container resources; if it is higher than the first preset threshold, then adjust the container replicas.
[0021] Optionally, the step of dynamically adjusting container resources includes,
[0022] Record the container's CPU and memory utilization rates according to the configured second preset time period.
[0023] Linear regression equations were used to obtain fitting functions for container CPU utilization versus time and memory utilization versus time, respectively, and the upper limit of container CPU and memory utilization, the upper limit of utilization, the lower limit of utilization, and the average utilization were predicted.
[0024] If the average utilization rate of container resources is higher than the second preset threshold during the second preset time period, the container resource allocation will be increased; if it is lower than or equal to the third preset threshold, the container resources will be recycled.
[0025] Optionally, the step of adjusting the container copy includes,
[0026] According to the configured third preset time period, the utilization of container CPU and memory is recorded respectively;
[0027] Linear regression equations are used to obtain fitting functions for container CPU utilization versus time and memory utilization versus time, and the average resource utilization for each service access is calculated.
[0028] Predict the time frame, upper limit, lower limit, and average utilization of container CPU and container memory respectively.
[0029] Analyze the average resource utilization of services within the container: if the average resource utilization reaches the fourth preset threshold within the third preset time period, then create a container replica; otherwise, reduce the number of container replicas.
[0030] A third aspect of the present invention provides a computer device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the program to implement the method provided in the second aspect of the present invention.
[0031] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the second aspect of the present invention.
[0032] The beneficial effects of this invention are as follows:
[0033] This invention primarily addresses the rational allocation of resources when using existing equipment or when resources are limited. Its advantages are mainly reflected in the following aspects: First, it adaptively allocates container resources based on whether the service is a high-concurrency service, avoiding resource shortages or waste due to unreasonable allocation; second, by analyzing container resource scheduling, it creates container replicas for services when concentrated access leads to resource shortages during a certain period, preventing service delays caused by insufficient resources. Attached Figure Description
[0034] The specific embodiments of the present invention will be described in further detail below with reference to the accompanying drawings.
[0035] Figure 1 This diagram illustrates a flowchart of a container resource adaptive allocation system.
[0036] Figure 2 This diagram illustrates the container resource adaptive module in this invention.
[0037] Figure 3 This diagram illustrates the container replica adaptive module in this invention.
[0038] Figure 4 A schematic diagram of the computer device in this invention is shown. Detailed Implementation
[0039] To more clearly illustrate the present invention, the following description, in conjunction with preferred embodiments and accompanying drawings, further explains the invention. Similar components in the drawings are indicated by the same reference numerals. Those skilled in the art should understand that the specific description below is illustrative rather than restrictive and should not be construed as limiting the scope of protection of the present invention.
[0040] This invention provides a container resource adaptive allocation system and method, computer equipment, and media. Kubernetes is a container-based scheduling platform. Currently, because container resources need to be pre-configured, uneven resource allocation can occur, meaning that a certain service may have low access levels during a certain period, resulting in resource waste, or a certain service may have very high access levels during a certain period, leading to slow access speeds due to uneven resource allocation. To solve this problem, this invention combines container adaptive allocation technology with Kubernetes' automatic replica creation to address both the platform access issues and resource adaptation issues during specific time periods.
[0041] The first aspect of this invention provides a container resource adaptive allocation system, comprising a judgment module, a container resource adaptive module, and a container replica adaptive module, wherein,
[0042] The judgment module is used to determine whether the number of accesses to the service within a first preset time period is higher than a first preset threshold.
[0043] The container resource adaptive module is used to dynamically adjust container resources when the service access volume does not exceed the first preset threshold within a first preset time period.
[0044] The container replica adaptive module is used to adjust the container replicas when the service access volume exceeds a first preset threshold within a first preset time period.
[0045] When the number of accesses to the service within a first preset time period exceeds a first preset threshold, the service is considered a high-concurrency service. When the number of accesses to the service is less than or equal to the first preset threshold, the service is considered a low-concurrency service. The first preset time period is set to half an hour, and the first preset threshold is set to 80%.
[0046] The container resource adaptation module addresses the resource adaptation issue for services with low concurrency. Its main function is to dynamically adjust container resources, monitor application resource usage in real time, and dynamically adjust resource utilization to improve efficiency. It monitors container CPU frequency and memory usage, and after a period of monitoring, it statistically analyzes resource utilization data. A fitting function from machine learning algorithms is used to fit the data, calculating whether the container's virtual resources have reached the upper and lower limits of container resource utilization. The upper limit of container resource utilization is the second preset threshold, and the lower limit is the third preset threshold.
[0047] In one specific embodiment, taking a 10-second interval as an example, the container's CPU utilization and memory utilization are recorded every 10 seconds.
[0048] Linear regression is used to obtain the fitting function of CPU utilization versus time within the second preset time period, and to predict the upper limit of container CPU utilization over time, as well as the upper limit, lower limit and average utilization of CPU utilization.
[0049] Linear regression is used to obtain the fitting function of memory utilization rate versus time for the second preset time period, and to predict the upper limit of container memory utilization rate over time, as well as the upper limit, lower limit and average utilization rate of memory utilization rate.
[0050] Based on the lower limit and average utilization rate of container resources, the system determines whether to increase container resource allocation or reclaim resources: if the resource utilization rate exceeds a second preset threshold within a second preset time period, container resource allocation will be automatically increased; if the resource utilization rate is lower than a third preset threshold, container resources will be reclaimed. In this invention, the second preset time period is half an hour, the second preset threshold is 80%, and the third preset threshold is 20%.
[0051] Container replica adaptive technology addresses the resource adaptation problem for services with low concurrency. It primarily solves the resource scheduling problem by creating a container replica when there is a concentrated surge in access to a service within a certain timeframe, especially when the service's resources are insufficient. This involves analyzing container resource usage and scheduling frequency over a period of time, using machine learning to analyze the container scheduling status, and then creating container replicas for services with concentrated access during a specific timeframe to address resource shortages.
[0052] In one specific embodiment, taking a 10-second interval as an example, the container's CPU utilization and memory utilization are recorded every 10 seconds.
[0053] Linear regression is used to obtain the fitting function of CPU utilization versus time within the third preset time period, and to predict the upper limit of container CPU utilization at time, as well as the upper limit, lower limit and average utilization of CPU utilization.
[0054] Linear regression is used to obtain the fitting function of memory utilization rate versus time for the third preset time period, and to predict the upper limit of container memory utilization rate over time, as well as the upper limit, lower limit and average utilization rate of memory utilization rate.
[0055] A linear regression algorithm is used to analyze the service scheduling. If the utilization rate of container resources reaches a fourth preset threshold within a third preset time period, it is determined that container replicas need to be created. If the utilization rate of container resources falls below the fourth preset threshold after this time period, the created container replicas are reclaimed. The third preset time period is half an hour, and the fourth preset threshold is 80%.
[0056] The second aspect of this invention provides a method for adaptive allocation of container resources, the method comprising the following steps:
[0057] Determine whether the number of accesses to the service within the first preset time period is higher than the first preset threshold: if it is not higher than the first preset threshold, then dynamically adjust the container resources; if it is higher than the first preset threshold, then adjust the container replicas.
[0058] In one specific embodiment, when the container resource adaptive module dynamically adjusts the container resources, the container is configured with 2 cores and 4G memory. First, the service is monitored for resources, and resources are recorded with a frame of data at 10-second intervals. The time interval can be configured according to specific requirements.
[0059] Resource analysis is performed based on the recorded information, including the upper limit, lower limit and average utilization of CPU and memory usage over a day. This invention records the upper limit, lower limit and average utilization of CPU and memory usage every half hour.
[0060] Machine learning linear regression functions are used to fit the functions of CPU utilization versus time and memory utilization versus time.
[0061] Based on the fitted function obtained from the analysis, the system automatically adjusts resources. This service adjusts resources every half hour, but you can also configure it according to the specific needs of your business. The system can configure container thresholds, and when the threshold is reached, it can automatically add more resources.
[0062] When analyzing the usage of the previous day or several days, resources are expanded or reduced when the specified time arrives.
[0063] Taking the time interval t1-t2 as an example, when the time t1 is about to be reached, according to the data analysis of the fitting function, the utilization of CPU and memory is relatively stable and there are no special fluctuations. The average CPU utilization is 73%, the average memory utilization is 69%, the highest CPU utilization is 77%, and the highest memory utilization is 80%. Under the current circumstances, there is no need to modify the resources of this service. The resource configuration is 2 cores and 4G memory.
[0064] Between time t3 and t4, based on the calculated fitting function, the system is under resource pressure for a long period, with an average CPU utilization of 85% and an average memory utilization of 89%. The highest CPU utilization is 97% and the highest memory utilization is 95%. The system can be upgraded. When time t3 is about to be reached, the container resources will be reconfigured according to certain rules. The modified configuration is 2.6 cores and 6GB of memory.
[0065] Between t5 and t6, analysis showed that CPU and memory utilization remained relatively stable without significant fluctuations. However, due to a sudden increase in access volume, resources were under strain for an extended period during this time. In such cases, a second preset threshold, such as 80%, would be used. If this threshold was exceeded within the second preset time period, container resource allocation would be automatically increased to ensure service stability.
[0066] In one specific embodiment, when the container replica adaptive module adjusts the container replica, the container is configured with 2 cores and 4G memory. First, the service is monitored for resources, and resources are recorded with a frame of data at 10-second intervals. The time period can be configured according to specific requirements.
[0067] Resource analysis is performed based on the recorded information, including the upper and lower limits of CPU and memory usage and their average utilization over a day, the number of service accesses, and the average resource utilization per service access. This invention uses half an hour as an example, recording the upper and lower limits of CPU and memory usage, their average utilization, and the average resource utilization per service access every half hour.
[0068] The system employs machine learning linear regression to fit functions related to CPU utilization and time, as well as memory utilization and time, and the average resource utilization per service access. Based on the analyzed fitting functions, the number of service replicas is adjusted. This service adjusts the number of service replicas every half hour, but this can be customized according to specific business needs. The system allows configuration of a fourth preset threshold for containers to automatically increase and decrease service replicas. Typically, the fourth preset threshold is configured at 80%. When the threshold is reached, the number of replicas is increased; otherwise, the number of replicas is decreased.
[0069] When analyzing usage data from the previous day or several days, this system can add or destroy service replicas when time t1 arrives.
[0070] Taking the time interval t1-t2 as an example, which is half an hour apart, as time t1 is about to be reached, according to the data analysis of the fitting function, with 10-second intervals, the average number of accesses per 10 seconds is 15. Based on the average resource consumption of each service, 4 cores and 8GB of memory are required. If there is no service replica, the service resources will be severely insufficient. This method will automatically generate one replica of the service at time t1 based on the results of the fitting function analysis to ensure the stability of the service.
[0071] like Figure 4 As shown, a third aspect of the present invention provides a computer device, it is understood that... Figure 4 The computer device 12 shown is merely an example and should not impose any limitation on the functionality and scope of use of the embodiments of the present invention.
[0072] like Figure 4 As shown, the computer device 12 is represented in the form of a general-purpose computing device. The components of the computer device 12 may include, but are not limited to: one or more processors or processing units 16, system memory 28, and a bus 18 connecting different system components (including system memory 28 and processing unit 16).
[0073] Bus 18 represents one or more of several bus architectures, including a memory bus or memory controller, a peripheral bus, a graphics acceleration port, a processor, or a local bus using any of the various bus architectures. For example, these architectures include, but are not limited to, the Industry Standard Architecture (ISA) bus, the Micro Channel Architecture (MAC) bus, the Enhanced ISA bus, the Video Electronics Standards Association (VESA) local bus, and the Peripheral Component Interconnect (PCI) bus.
[0074] Computer device 12 typically includes a variety of computer system readable media. These media can be any available media that can be accessed by computer device 12, including volatile and non-volatile media, removable and non-removable media.
[0075] System memory 28 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) 30 and / or cache memory 32. Computer device 12 may further include other removable / non-removable, volatile / non-volatile computer system storage media. By way of example only, storage system 34 may be used to read and write non-removable, non-volatile magnetic media (…). Figure 4 Not shown; usually referred to as a "hard drive"). Although Figure 4 Not shown, a disk drive for reading and writing to a removable non-volatile disk (e.g., a "floppy disk") and an optical disk drive for reading and writing to a removable non-volatile optical disk (e.g., a CD-ROM, DVD-ROM, or other optical media) may be provided. In these cases, each drive may be connected to bus 18 via one or more data media interfaces. Memory 28 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of the present invention.
[0076] A program / utility 40 having a set (at least one) of program modules 42 may be stored, for example, in memory 28. Such program modules 42 include, but are not limited to, an operating system, one or more application programs, other program modules, and program data. Each or some combination of these examples may include an implementation of a network environment. Program modules 42 typically perform the functions and / or methods described in the embodiments of the present invention.
[0077] Computer device 12 can also communicate with one or more external devices 14 (e.g., keyboard, pointing device, display 24, etc.), and with one or more devices that enable a user to interact with the computer device 12, and / or with any device that enables the computer device 12 to communicate with one or more other computing devices (e.g., network card, modem, etc.). This communication can be performed through input / output (I / O) interface 22. Furthermore, computer device 12 can also communicate with one or more networks (e.g., local area network (LAN), wide area network (WAN), and / or public networks, such as the Internet) through network adapter 20. Figure 4 As shown, network adapter 20 communicates with other modules of computer device 12 via bus 18. It should be understood that, although... Figure 4As not shown, it can be used in conjunction with computer device 12 with other hardware and / or software modules, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0078] The processor unit 16 executes various functional applications and data processing by running programs stored in the system memory 28, such as implementing the method provided in the second aspect of the present invention.
[0079] A fourth aspect of the present invention provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the method provided in the second aspect of the present invention.
[0080] In practical applications, the computer-readable storage medium can be any combination of one or more computer-readable media. The computer-readable medium can be a computer-readable signal medium or a computer-readable storage medium. For example, a computer-readable storage medium can be, but is not limited to, an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, random access memory (RAM), read-only memory (ROM), erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this embodiment, the computer-readable storage medium can be any tangible medium containing or storing a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.
[0081] Computer-readable signal media may include data signals propagated in baseband or as part of a carrier wave, carrying computer-readable program code. Such propagated data signals may take various forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination thereof. Computer-readable signal media may also be any computer-readable medium other than computer-readable storage media, capable of sending, propagating, or transmitting programs for use by or in connection with an instruction execution system, apparatus, or device.
[0082] Program code contained on a computer-readable medium may be transmitted using any suitable medium, including but not limited to wireless, wire, optical fiber, RF, etc., or any suitable combination thereof.
[0083] Computer program code for performing the operations of this invention can be written in one or more programming languages or a combination thereof, including object-oriented programming languages such as Java, Smalltalk, and C++, as well as conventional procedural programming languages such as "C" or similar programming languages. The program code can be executed entirely on the user's computer, partially on the user's computer, as a standalone software package, partially on the user's computer and partially on a remote computer, or entirely on a remote computer or server. In cases involving remote computers, the remote computer can be connected to the user's computer via any type of network—including a local area network (LAN) or a wide area network (WAN)—or can be connected to an external computer (e.g., via the Internet using an Internet service provider).
[0084] In the description of this invention, it should be noted that the terms "upper," "lower," etc., indicating the orientation or positional relationship are based on the orientation or positional relationship shown in the accompanying drawings, and are only for the convenience of describing the invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation, and therefore should not be construed as a limitation of the invention. Unless otherwise expressly specified and limited, the terms "installed," "connected," and "linked" should be interpreted broadly. For example, they can refer to a fixed connection, a detachable connection, or an integral connection; they can refer to a mechanical connection or an electrical connection; they can refer to a direct connection or an indirect connection through an intermediate medium; they can refer to the internal communication between two elements. For those skilled in the art, the specific meaning of the above terms in this invention can be understood according to the specific circumstances.
[0085] It should also be noted that in the description of this invention, relational terms such as "first" and "second" are used only to distinguish one entity or operation from another, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Furthermore, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or apparatus that includes said element.
[0086] Obviously, the above embodiments of the present invention are merely examples for clearly illustrating the present invention, and are not intended to limit the implementation of the present invention. For those skilled in the art, other variations or modifications can be made based on the above description. It is impossible to exhaustively list all the implementation methods here. All obvious variations or modifications derived from the technical solutions of the present invention are still within the protection scope of the present invention.
Claims
1. A container resource adaptive allocation system, characterized in that, This includes a judgment module, a container resource adaptation module, and a container replica adaptation module. The judgment module is used to determine whether the number of accesses to the service within a first preset time period is higher than a first preset threshold. The container resource adaptive module is used to dynamically adjust container resources when the service access volume does not exceed a first preset threshold within a first preset time period. The container replica adaptive module is used to adjust the container replica when the service access volume is higher than a first preset threshold within a first preset time period. The container resource adaptive module includes a first threshold judgment module and a resource scheduling module, wherein, The first threshold judgment module is used to determine whether the utilization rate of resources within the second preset time period is higher than the second preset threshold of container resources, and is also used to determine whether the utilization rate of resources within the second preset time period is lower than or equal to the third preset threshold of container resources. The resource scheduling module is used to increase container resources when the utilization rate of resources within a second preset time period is higher than a second preset threshold of container resources, and to reclaim container resources when the utilization rate of container resources is lower than or equal to a third preset threshold of container resources, so as to dynamically adjust the utilization rate of container resources. The container replica adaptive module includes a second threshold judgment module and a service scheduling module, wherein... The second threshold judgment module is used to determine whether the utilization rate of container resources has reached the fourth preset threshold. The service scheduling module is used to increase the number of service replicas when the utilization rate of container resources reaches a fourth preset threshold, and decrease the number of service replicas when the threshold is not reached, in order to adjust the number of container replicas.
2. The system according to claim 1, characterized in that, The container resource adaptive module further includes a first calculation module, which uses a machine learning algorithm to fit the utilization rate of container resources and calculates whether the container resources have reached the second and third preset thresholds of the container.
3. The system according to claim 1, characterized in that, The container replica adaptive module also includes a second calculation module, which uses a machine learning algorithm to fit the utilization rate of container resources to calculate whether the container resources have reached a fourth preset threshold.
4. A container resource adaptive allocation method applied to a container resource adaptive allocation system as described in any one of claims 1-3, characterized in that, include Determine whether the number of accesses to the service within the first preset time period is higher than the first preset threshold: if it is not higher than the first preset threshold, then dynamically adjust the container resources; If the value exceeds the first preset threshold, the container copy will be adjusted. The steps for dynamically adjusting container resources include: Record the container's CPU and memory utilization rates according to the configured second preset time period. Linear regression equations were used to obtain fitting functions for container CPU utilization versus time and memory utilization versus time, respectively, and the upper limit of container CPU and memory utilization, the upper limit of utilization, the lower limit of utilization, and the average utilization were predicted. If the average utilization rate of container resources is higher than the second preset threshold during the second preset time period, then increase the container resource configuration; If the value is lower than or equal to the third preset threshold, then the container resources will be recycled. The step of adjusting the container copy includes, According to the configured third preset time period, the utilization of container CPU and memory is recorded respectively; Linear regression equations are used to obtain fitting functions for container CPU utilization versus time and memory utilization versus time, and the average resource utilization for each service access is calculated. Predict the time frame, upper limit, lower limit, and average utilization of container CPU and container memory respectively. Analyze the average resource utilization of services within the container: if the average resource utilization reaches the fourth preset threshold within the third preset time period, then create a container replica; If the target is not reached, reduce the number of container copies.
5. A computer device, comprising a memory, a processor, and a computer program stored in the memory and executable on the processor, characterized in that, When the processor executes the program, it implements the method as described in claim 4.
6. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the program is executed by the processor, it implements the method as described in claim 4.