Resource quota method and device, electronic equipment and computer program product
By obtaining container operation data, determining type information and elastic scaling information, and dynamically adjusting resource quotas, the problem that container resource quota cannot be adapted to different scenarios is solved, and dynamic load balancing of containers is achieved.
Patent Information
- Application Number
- CN202411746749.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-11-29
- Publication Date
- 2025-03-21
AI Technical Summary
In the prior art, the resource quota of the container is fixed and cannot be adjusted dynamically, resulting in the inability to adapt in different operating stages or hardware environments, and users cannot modify it themselves, resulting in the inability to achieve dynamic load balancing.
By obtaining the operating data of the container, determining the type information of the container and elastic scaling information, and dynamically adjusting the resource quota of the container to achieve load balancing.
Dynamic resource configuration based on container operation data is realized, adapted to different scenarios and hardware environments, avoiding the unadaptation problem caused by fixed resource quota, and improving the flexibility of load balancing.
Smart Images

Figure CN119668776A_ABST
Abstract
Description
Technical Field
[0001] The embodiments of the present application belong to the field of computer technology, and in particular, relate to a resource quota method, device, electronic device, and computer program product. Background Art
[0002] Container technology is a technology that can package an application and all its dependencies together to form an independent, portable operating environment. Container technology can provide more efficient resource utilization, simpler deployment processes and more convenient expansion methods, achieve cross-platform operation and rapid deployment, and also enhance the security and stability of applications.
[0003] Typically, when a user creates a container, he or she needs to set load rule information on the management platform that deploys the container. The management platform uses the load rule information to set a fixed resource quota for the application.
[0004] Since applications have different resource requirements at different running stages or when deployed on different physical devices, fixed resource quotas will affect the operation of applications. In addition, users cannot directly modify load rule information and require intervention from other personnel, resulting in the inability to achieve dynamic load balancing. Summary of the invention
[0005] In view of this, embodiments of the present application provide a resource quota method, apparatus, electronic device, and computer program product to improve the efficiency of resource allocation for containers and achieve dynamic load balancing.
[0006] A first aspect of an embodiment of the present application provides a resource quota method, including:
[0007] Get the running data of the container;
[0008] determining type information of the container based on the operating data;
[0009] Determining elastic scaling information corresponding to the container according to the type information;
[0010] A resource quota is performed on the container according to the elastic scaling information.
[0011] In some implementations, the operation data includes resource consumption information corresponding to each operation time; and determining the type information of the container based on the operation data includes:
[0012] Determining a cycle phase of the container according to the running time and the resource consumption information;
[0013] The type information of the container is determined according to the cycle phase and its corresponding resource consumption information.
[0014] In some implementations, the cycle phases include:
[0015] At least one of the start-up phase, flat peak phase, peak phase, and valley peak phase.
[0016] In some implementations, determining elastic scaling information corresponding to the container according to the type information includes:
[0017] Determine expected load information;
[0018] For each of the cycle stages, elastic scaling information is determined according to the type information and the expected load information.
[0019] In some implementations, the performing resource quota on the container according to the elastic scaling information includes:
[0020] determining a current cycle stage of the container;
[0021] A resource quota is performed on the container based on the elastic scaling information corresponding to the current cycle stage.
[0022] In some implementations, the method includes:
[0023] generating configuration information using the resource consumption information;
[0024] The configuration information is stored in a container management system corresponding to the container.
[0025] In some implementations, the method further includes:
[0026] Obtaining attribute information and replica information of the container;
[0027] Based on the type information, the attribute information and the copy information, migratable portrait data is generated.
[0028] A second aspect of an embodiment of the present application provides a resource quota device, including:
[0029] An operation data acquisition module is used to obtain the operation data of the container;
[0030] a type information determination module, configured to determine type information of the container based on the operation data;
[0031] Determine elastic scaling information, and determine elastic scaling information corresponding to the container according to the type information;
[0032] The resource quota module is used to perform resource quota on the container according to the elastic scaling information.
[0033] A third aspect of an embodiment of the present application provides an electronic device, comprising a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the resource quota method as described in the first aspect above.
[0034] A fourth aspect of the embodiments of the present application provides a computer program product, including a computer program. When the computer program is executed, the resource quota method described in the first aspect is executed.
[0035] A fifth aspect of an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the resource quota method as described in the first aspect above is implemented.
[0036] Compared with the prior art, the embodiments of the present application have the following beneficial effects:
[0037] In an embodiment of the present application, operating data of a container is obtained; type information of the container is determined based on the operating data; elastic scaling information corresponding to the container is determined based on the type information; resource quotas are applied to the container according to the elastic scaling information, thereby creating elastic scaling information corresponding to the container based on the operating data of the container, and load balancing of the container is achieved based on the elastic scaling information, thereby avoiding the situation in which the resources available to the container cannot be adapted to different scenarios or different hardware due to the user fixing the resource quota of the container when building the container. At the same time, it can also avoid the situation in which the user sets a single elastic scaling information for the container, which cannot meet the resource demand changes that may exist during its operation. BRIEF DESCRIPTION OF THE DRAWINGS
[0038] In order to more clearly illustrate the technical solutions in the embodiments of the present application, the following briefly introduces the drawings required for use in the embodiments or prior art descriptions. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0039] Figure 1 It is a schematic diagram of a resource quota method provided by the prior art;
[0040] Figure 2 is a schematic diagram of a resource quota method provided in an embodiment of the present application;
[0041] Figure 3 This is a framework diagram of a container management platform provided in an embodiment of the present application;
[0042] Figure 4is a schematic diagram of a resource quota device provided in an embodiment of the present application;
[0043] Figure 5 It is a schematic diagram of an electronic device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0044] In the following description, specific details such as specific system structures, technologies, etc. are provided for the purpose of illustration rather than limitation, so as to provide a thorough understanding of the embodiments of the present application. However, it should be clear to those skilled in the art that the present application may also be implemented in other embodiments without these specific details. In other cases, detailed descriptions of well-known systems, devices, circuits, and methods are omitted to prevent unnecessary details from obstructing the description of the present application.
[0045] It should be understood that when used in the present specification and the appended claims, the term "comprising" indicates the presence of described features, wholes, steps, operations, elements and / or components, but does not exclude the presence or addition of one or more other features, wholes, steps, operations, elements, components and / or combinations thereof.
[0046] It should also be understood that the term “and / or” used in the specification and appended claims refers to any and all possible combinations of one or more of the associated listed items, and includes these combinations.
[0047] As used in the specification and appended claims of this application, the term "if" can be interpreted as "when" or "uponce" or "in response to determining" or "in response to detecting", depending on the context. Similarly, the phrase "if it is determined" or "if [described condition or event] is detected" can be interpreted as meaning "uponce it is determined" or "in response to determining" or "uponce [described condition or event] is detected" or "in response to detecting [described condition or event]", depending on the context.
[0048] In addition, in the description of the present application specification and the appended claims, the terms "first", "second", "third", etc. are only used to distinguish the descriptions and cannot be understood as indicating or implying relative importance.
[0049] References to "one embodiment" or "some embodiments" etc. described in the specification of this application mean that one or more embodiments of the present application include specific features, structures or characteristics described in conjunction with the embodiment. Therefore, the statements "in one embodiment", "in some embodiments", "in some other embodiments", "in some other embodiments", etc. that appear in different places in this specification do not necessarily refer to the same embodiment, but mean "one or more but not all embodiments", unless otherwise specifically emphasized in other ways. The terms "including", "comprising", "having" and their variations all mean "including but not limited to", unless otherwise specifically emphasized in other ways.
[0050] Reference Figure 1 , illustrates a schematic diagram of a resource quota framework in the prior art, including:
[0051] Step 1: The user creates a container controller (for example, a stateless workload (Deployment)) in a container management platform according to his or her needs.
[0052] Step 2: The user creates an elastic scaling rule based on actual needs;
[0053] Step 3: The container management platform elastically scales the resources used by the container according to the configured elastic scaling rules, and can modify the number of container replicas or modify the resource quota of the container. For example, users can use elastic scaling rules to keep the average CPU usage of the business load below 50%. If the CPU usage exceeds 50%, a new container replica is added to balance the resource pressure required by the container.
[0054] Step 4: According to the newly configured rules, the container is elastically scaled horizontally or vertically, and the newly created container is restarted.
[0055] In the prior art, users need to manually set resource quotas. In different scenarios, there may be completely different hardware devices, and resource quotas need to be adjusted at this time. However, resource quotas need to be handled by personnel related to the container management platform, and users cannot modify them by themselves. Users need to learn cloud computing-related knowledge and set relevant elastic scaling rules, which has a high learning cost. Even in the same scenario, the container's demand for resources may not be completely consistent. Fixed resource quotas require users to choose between container performance and resource waste, taking into account both container performance and avoiding resource waste.
[0056] In order to solve the problems existing in the above-mentioned prior art, an embodiment of the present application provides a resource quota method. The technical solution of the present application is explained below through specific embodiments.
[0057] Reference Figure 2, showing a schematic diagram of a resource quota method provided in an embodiment of the present application, referring to Figure 3 , shows a schematic diagram of a load balancing framework provided by an embodiment of the present application. The embodiment of the present application can be applied to Figure 3 The load adaptation component shown in the embodiment of the present application may specifically include the following steps:
[0058] Step 201, obtaining the operation data of the container;
[0059] Before step 201, the user may predetermine the environment in which the user deploys the container, which may include but is not limited to: a local environment, a cloud environment (including but not limited to a public cloud environment, a private cloud environment, a public cloud and a private hybrid environment). By deploying a container management platform in a specified environment, the container can be built and managed in the environment.
[0060] The user can send a container build request to the container management platform. The container management platform user responds to the build request, generates a container for running the specified application, and sets the corresponding controller for the POD where the container is located. The controller includes but is not limited to: Deployment Controller, StatefulSet Controller, DaemonSet Controller. The specified program is the application that the user needs to deploy and run in the container.
[0061] After the container is built for the specified program, the application in the container can be run without resource usage restrictions, and the running data of the container can be obtained through the pre-set data acquisition component in the container management platform. The running data of the container is only the relevant data of the container when the application in the container is running.
[0062] Step 202, determining type information of the container based on the operation data;
[0063] The sample capacity may be preset, and the acquired operating data may be statistically analyzed to determine whether the collected operating data meets the preset sample capacity.
[0064] For example, the sample capacity can be calculated in units of time. The sample capacity is preset to 1 day. During the operation of the container application, the duration span corresponding to the collected operation data can be determined. If the duration span reaches one day, it is determined that the collected operation data meets the preset sample capacity. The type information of the container can be determined based on the collected operation data. The type is used to indicate the demand for resources when the application is running.
[0065] Step 203, determining elastic scaling information corresponding to the container according to the type information;
[0066] At least one elastic scaling information corresponding to the container may be determined based on multiple elastic scaling modes according to the type information of the container. The elastic scaling modes may include but are not limited to: one or more of horizontal elastic scaling (HPA), vertical elastic scaling (VPA), vertical elastic scaling in place (VPA in Place), tidal elastic scaling (Tide HPA), and startup elastic scaling (Startup VPA).
[0067] Horizontal elastic scaling: Dynamically adjust the number of Pods according to the load of the application to achieve horizontal expansion. It usually increases or decreases the number of Pod copies based on CPU usage or other custom indicators. HPA is suitable for stateless applications and can automatically increase the number of Pod copies during business peaks and automatically reduce the number of Pod copies during business off-peaks.
[0068] Vertical elastic scaling: Automatically adjust the CPU and memory requests and limits of Pods to achieve vertical expansion. Its goal is to allocate the most appropriate amount of resources to each Pod to avoid resource waste. VPA is usually used for stateful applications or single-instance applications to adjust Pod resources based on resource usage.
[0069] In-place vertical elastic scaling: allows resource limits to be adjusted directly while the Pod is running without having to recreate the Pod.
[0070] Tidal elastic scaling: A strategy for adjusting the number of Pods based on a schedule or periodic load changes. For example, some applications require more resources during specific time periods (such as working hours) and fewer resources during non-working hours. CronHPA is a tool that implements tidal elastic scaling, which allows the number of HPA replicas to be adjusted according to a predetermined schedule.
[0071] Initial elastic scaling: Resource requests are allocated when the Pod is created and are not adjusted afterwards. VPA in this mode only recommends resource requests based on historical data and configuration when the Pod is initialized, and does not dynamically adjust resources at runtime.
[0072] The elastic scaling information of the container may be determined based on the elastic scaling method. For example, the elastic scaling information may include elastic scaling response conditions, elastic scaling methods, elastic scaling adjustment range, and the like.
[0073] Step 204: perform resource quota on the container according to the elastic scaling information.
[0074] Elastic scaling information is used to adjust the resource quota of the container when the running data of the container meets certain conditions, so as to achieve load balancing of the container. For example, based on the operation, it is found that the resources required by the container increase greatly within time interval A, causing its load rate to reach 60%. At this time, elastic scaling information can be determined for the container, for example, determining a certain elastic scaling information of the container as: in a certain time period (elastic scaling condition), increase CPU resources (vertical elastic scaling method) by 20 units (elastic scaling range).
[0075] In an embodiment of the present application, by obtaining the running data of the container; determining the type information of the container based on the running data; determining the elastic scaling information corresponding to the container according to the type information; and allocating resources to the container according to the elastic scaling information, it is possible to create elastic scaling information corresponding to the container based on the running data of the container, and implement load balancing of the container based on the elastic scaling information, thereby avoiding the situation in which the resources that can be used by the container cannot be adapted to different scenarios or different hardware due to the user fixing the resource quota of the container when building the container. At the same time, it can also avoid the situation in which the user sets a single elastic scaling information for the container, which cannot meet the changes in resource requirements that may exist during its operation.
[0076] In some implementations of the present application, the operating data includes resource consumption information corresponding to each operating time; step 202 includes: determining the cycle stage of the container based on the operating time and the resource consumption information; determining the type information of the container based on the cycle stage and its corresponding resource consumption information.
[0077] Different types of resources may be consumed during the running of applications in the container, and the applications' needs for different resources may not be the same. The above resources include but are not limited to CPU resources (the time and / or number of processors allocated to the application), memory resources (the amount of random access memory allocated to the application), storage resources (the disk space allocated to the application), network bandwidth resources (the network transmission rate allocated to the application), and GPU resources (GPU usage).
[0078] The data acquisition component can continuously acquire the resource consumption information of the application at various times and generate corresponding operation data. The resource consumption information may include the above-mentioned categories of resources and the corresponding consumption amounts.
[0079] The load adaptation component can identify the running data, determine the fluctuation of resource consumption information, and divide the running time into one or more cycle stages. According to each cycle stage and the corresponding resource consumption information, the resource requirements of each cycle stage when the application is running are determined, and then the type of container is determined.
[0080] In some implementations of the present application, the cycle phases include:
[0081] At least one of the start-up phase, flat peak phase, peak phase, and valley peak phase.
[0082] According to the running data, it can be identified whether the application has completed startup, and the time from the start of the application startup to the completion of the startup is the startup phase.
[0083] Based on the running data, the resource consumption information corresponding to each time after the application is started can be identified, and the changing pattern of the resource consumption information can be identified, so that the flat peak phase, and / or peak phase, and / or valley peak phase of the application's running time can be identified.
[0084] It should be noted that the flat peak phase, peak phase, and valley peak phase are determined based on the relative differences in resource consumption information at each time during the running time of the application. The cycle phase of the application may include one or more of the flat peak phase, peak phase, and valley peak phase, which are not limited here.
[0085] As an example, the stage after the application completes startup can be defined as the stable operation stage, the operation cycle of the application can be divided into the startup stage and the stable operation stage, and corresponding elastic scaling information can be set for the startup stage and the stable operation stage, so that the resource quota for the container can adapt to the difference in resource requirements of the application in the startup stage and the stable operation stage. For example: For some applications, the resources required in the startup stage are much greater than the resources required in the stable operation stage. If resource quotas are allocated for the stable operation stage according to the resource requirements of the startup stage, it will cause a waste of resources; if resource quotas are allocated for the startup stage according to the resource requirements of the stable operation stage, it will cause the application startup time to be extended, affect the response time of the application, and reduce the user experience of the user. Through the embodiment of the present application, resource quotas can be dynamically allocated based on the difference in resource requirements of the application in the startup stage and the stable operation stage, thereby ensuring that the application can be started quickly while reducing resource waste.
[0086] In some implementations of the present application, determining the elastic scaling information corresponding to the container based on the type information includes: determining expected load information; and determining the elastic scaling information for each of the cycle stages based on the type information and the expected load information.
[0087] The expected load information may be determined in advance by a user or set by default by the container management platform, which is not limited here.
[0088] The load information may be the utilization rate of the allocated resource quota of one or more resources. For example, if a network bandwidth of 200 Mbps is pre-allocated to a certain application, and the bandwidth currently used by the application reaches 100 Mbps, the utilization rate is 50%.
[0089] Users can determine elastic scaling information based on the expected load information at each cycle stage to ensure that the application can run normally during the cycle stage.
[0090] In some implementations of the present application, allocating resources to the container according to the elastic scaling information includes: determining a current cycle stage of the container; and allocating resources to the container based on the elastic scaling information corresponding to the current cycle stage.
[0091] In actual applications, after completing the construction of elastic scaling information for each cycle stage, when the application is running, the load adaptation component can identify the current cycle stage of the application and the real-time load information. When the real-time load information exceeds the preset load information of the current cycle stage, the elastic scaling information corresponding to the current cycle stage is called for resource quota, thereby achieving load balancing in the container environment.
[0092] In some implementations of the present application, the method includes: generating configuration information using the resource consumption information; and storing the configuration information in a container management system corresponding to the container.
[0093] After determining each cycle stage of the application, configuration information is generated based on the resource consumption information corresponding to each cycle stage, and the configuration information is stored in the container management system corresponding to the container. When the user needs to create a copy or the same container, the configuration information can be directly read to determine the resource consumption information of each cycle stage of the application without having to re-obtain the running data of the application within a certain period of time.
[0094] In some implementations of the present application, the method further includes: obtaining attribute information and copy information of the container; and generating migratable portrait data based on the type information, the attribute information, and the copy information.
[0095] After determining the elastic rule information, a container replica can be constructed as the replica information, and migratable portrait data can be generated based on the type information, attribute information and replica information.
[0096] The attribute information is information inherent to the container, such as application name, application type, application version, etc.
[0097] As an example, the portrait data includes: the type of application, the duration of the application startup phase, the CPU, memory, network bandwidth, GPU and other resources required for the application startup phase, the CPU, memory, network bandwidth, GPU and other resources required for the application business stabilization phase, and one or more elastic scaling information.
[0098] Users can store the portrait data persistently in the current environment, so that when users deploy the same application again, they can quickly build elastic scaling information based on the portrait data without having to repeatedly obtain operating data within a certain period of time, thereby improving the efficiency of determining elastic scaling information when repeatedly deploying the same application.
[0099] Users can also transfer portrait data to other environments, so that when the same application is deployed in other environments, the container corresponding to the application and the corresponding elastic scaling information can be quickly deployed based on the portrait data and the resource conditions of the current environment, thereby improving the efficiency of building elastic scaling information when the same application is deployed in other environments.
[0100] It should be noted that the size of the serial numbers of the steps in the above embodiments does not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation on the implementation process of the embodiments of the present application.
[0101] Reference Figure 4 , shows a schematic diagram of a resource quota device provided in an embodiment of the present application, which may specifically include an operation data acquisition module 401, a type information determination module 402, an elastic scaling information determination module 403, and a resource quota module 404, wherein:
[0102] An operation data acquisition module 401 is used to acquire the operation data of the container;
[0103] A type information determination module 402, configured to determine type information of the container based on the operation data;
[0104] An elastic scaling information determination module 403, configured to determine elastic scaling information corresponding to the container according to the type information;
[0105] The resource quota module 404 is used to perform resource quota on the container according to the elastic scaling information.
[0106] In some implementations of the present application, the operation data includes resource consumption information corresponding to each operation time; the type information determination module 402 includes:
[0107] A cycle phase determination submodule, configured to determine the cycle phase of the container according to the running time and the resource consumption information;
[0108] The type information determination submodule is used to determine the type information of the container according to the cycle stage and its corresponding resource consumption information.
[0109] In some implementations of the present application, the cycle phases include:
[0110] At least one of the start-up phase, flat peak phase, peak phase, and valley peak phase.
[0111] In some implementations of the present application, the type information determination submodule includes:
[0112] An expected load information unit, used to determine expected load information;
[0113] The elastic scaling information determining unit is used to determine the elastic scaling information according to the type information and the expected load information for each of the cycle stages.
[0114] In some implementations of the present application, the performing resource quota on the container according to the elastic scaling information includes:
[0115] A current cycle phase determination submodule, used to determine the current cycle phase of the container;
[0116] The resource quota submodule is used to perform resource quota on the container based on the elastic scaling information corresponding to the current cycle stage.
[0117] In some implementations of the present application, the device further includes:
[0118] A configuration information generating module, used to generate configuration information using the resource consumption information;
[0119] The configuration information storage module is used to store the configuration information in a container management system corresponding to the container.
[0120] In some implementations of the present application, the device further includes:
[0121] A container related information acquisition module, used to acquire attribute information and replica information of the container;
[0122] The portrait data generation module is used to generate migratable portrait data based on the type information, the attribute information and the copy information.
[0123] An embodiment of the present application provides a resource quota device, and by using the device, each step in the aforementioned method embodiments can be implemented.
[0124] As for the device embodiment, since it is basically similar to the method embodiment, the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment part.
[0125] Reference Figure 5 , shows a schematic diagram of an electronic device provided by an embodiment of the present application. Figure 5 As shown, the electronic device 500 in the embodiment of the present application includes: a processor 510, a memory 520, and a computer program 521 stored in the memory 520 and executable on the processor 510. When the processor 510 executes the computer program 521, the steps in each embodiment of the resource quota method described above are implemented, for example Figure 2 Alternatively, when the processor 510 executes the computer program 521, the functions of each module / unit in the above-mentioned device embodiments are realized, for example, Figure 4 Functions of modules 401 to 404 are shown.
[0126] Exemplarily, the computer program 521 may be divided into one or more modules / units, which are stored in the memory 520 and executed by the processor 510 to complete the present application. The one or more modules / units may be a series of computer program instruction segments capable of completing specific functions, which may be used to describe the execution process of the computer program 521 in the electronic device 500. For example, the computer program 521 may be divided into an operation data acquisition module, a type information determination module, an elastic scaling information determination module, and a resource quota module, and the specific functions of each module are as follows:
[0127] Run the data acquisition module, type information determination module, elastic scaling information determination module, and resource quota module, where:
[0128] An operation data acquisition module is used to obtain the operation data of the container;
[0129] a type information determination module, configured to determine type information of the container based on the operation data;
[0130] An elastic scaling information determination module, used to determine the elastic scaling information corresponding to the container according to the type information;
[0131] The resource quota module is used to perform resource quota on the container according to the elastic scaling information.
[0132] The electronic device 500 may be a computing device such as a desktop computer or a cloud server. The electronic device 500 may include, but is not limited to, a processor 510 and a memory 520. Those skilled in the art will appreciate that Figure 5It is only an example of the electronic device 500 and does not constitute a limitation of the electronic device 500. It may include more or fewer components than shown in the figure, or a combination of certain components, or different components. For example, the electronic device 500 may also include input and output devices, network access devices, buses, etc.
[0133] The processor 510 may be a central processing unit (CPU), or other general-purpose processors, digital signal processors (DSP), application-specific integrated circuits (ASIC), field-programmable gate arrays (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. A general-purpose processor may be a microprocessor or any conventional processor, etc.
[0134] The memory 520 may be an internal storage unit of the electronic device 500, such as a hard disk or memory of the electronic device 500. The memory 520 may also be an external storage device of the electronic device 500, such as a plug-in hard disk, a smart media card (SMC), a secure digital (SD) card, a flash card, etc. equipped on the electronic device 500. Further, the memory 520 may also include both an internal storage unit of the electronic device 500 and an external storage device. The memory 520 is used to store the computer program 521 and other programs and data required by the electronic device 500. The memory 520 may also be used to temporarily store data that has been output or is to be output.
[0135] The embodiment of the present application further discloses a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the resource quota method as described in the above embodiments is implemented.
[0136] The embodiment of the present application further discloses a computer program product, including a computer program. When the computer program is executed, the resource quota method described in the above embodiments is executed.
[0137] The above-described embodiments are only used to illustrate the technical solutions of the present application, rather than to limit them. Although the present application is described in detail with reference to the above-mentioned embodiments, a person skilled in the art should understand that the technical solutions described in the above-mentioned embodiments can still be modified, or some of the technical features can be replaced by equivalents; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present application, and should be included in the protection scope of the present application.
Claims
1. A resource quota method, characterized in that: include: Get the running data of the container; determining type information of the container based on the operating data; Determining elastic scaling information corresponding to the container according to the type information; A resource quota is performed on the container according to the elastic scaling information.
2. The method according to claim 1, characterized in that The operation data includes resource consumption information corresponding to each operation time; and determining the type information of the container based on the operation data includes: Determining a cycle phase of the container according to the running time and the resource consumption information; The type information of the container is determined according to the cycle phase and its corresponding resource consumption information.
3. The method according to claim 2, characterized in that The cycle stages include: At least one of the start-up phase, flat peak phase, peak phase, and valley peak phase.
4. The method according to claim 2 or 3, characterized in that: The determining, according to the type information, elastic scaling information corresponding to the container includes: Determine expected load information; For each of the cycle stages, elastic scaling information is determined according to the type information and the expected load information.
5. The method according to claim 1, characterized in that The performing resource quota on the container according to the elastic scaling information includes: determining a current cycle stage of the container; A resource quota is performed on the container based on the elastic scaling information corresponding to the current cycle stage.
6. The method according to claim 2, characterized in that The method comprises: generating configuration information using the resource consumption information; The configuration information is stored in a container management system corresponding to the container.
7. The method according to claim 1 or 2, characterized in that: The method further comprises: Obtaining attribute information and replica information of the container; Based on the type information, the attribute information and the copy information, migratable portrait data is generated.
8. A resource quota device, characterized in that: include: An operation data acquisition module is used to obtain the operation data of the container; a type information determination module, configured to determine type information of the container based on the operation data; An elastic scaling information determination module, used to determine the elastic scaling information corresponding to the container according to the type information; The resource quota module is used to perform resource quota on the container according to the elastic scaling information.
9. An electronic device, characterized in that: The electronic device comprises a processor, a memory, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the computer program, the electronic device implements the method according to any one of claims 1 to 7.
10. A computer program product, characterized in that The invention comprises a computer program, which, when being executed, enables the method according to any one of claims 1 to 7 to be performed.