CN117519956A - Resource quota determination method, device, computing equipment and medium - Google Patents

Resource quota determination method, device, computing equipment and medium Download PDF

Info

Publication number
CN117519956A
CN117519956A CN202210883725.4A CN202210883725A CN117519956A CN 117519956 A CN117519956 A CN 117519956A CN 202210883725 A CN202210883725 A CN 202210883725A CN 117519956 A CN117519956 A CN 117519956A
Authority
CN
China
Prior art keywords
resource
target
memory
quota value
determining
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202210883725.4A
Other languages
Chinese (zh)
Inventor
李大伟
于立
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Chuanyang Technology Co ltd
Original Assignee
Beijing Chuanyang Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Chuanyang Technology Co ltd filed Critical Beijing Chuanyang Technology Co ltd
Priority to CN202210883725.4A priority Critical patent/CN117519956A/en
Priority to JP2022160735A priority patent/JP7214287B1/en
Publication of CN117519956A publication Critical patent/CN117519956A/en
Pending legal-status Critical Current

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/50Allocation of resources, e.g. of the central processing unit [CPU]
    • G06F9/5005Allocation of resources, e.g. of the central processing unit [CPU] to service a request
    • G06F9/5027Allocation of resources, e.g. of the central processing unit [CPU] to service a request the resource being a machine, e.g. CPUs, Servers, Terminals
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F9/00Arrangements for program control, e.g. control units
    • G06F9/06Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
    • G06F9/46Multiprogramming arrangements
    • G06F9/48Program initiating; Program switching, e.g. by interrupt
    • G06F9/4806Task transfer initiation or dispatching
    • G06F9/4843Task transfer initiation or dispatching by program, e.g. task dispatcher, supervisor, operating system
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D10/00Energy efficient computing, e.g. low power processors, power management or thermal management

Abstract

The application provides a resource quota determination method, a resource quota determination device, computing equipment and a medium. According to the method and the device, the resource usage amount of the target application in the set time period and the historical resource quota value of the target application are obtained, so that the running type and the average resource usage amount of the target application are determined based on the resource usage amount of the target application in the set time period, and further, the target parameter is determined based on the average resource usage amount and the historical resource quota value, so that the target resource quota value of the target application is determined based on the target parameter and the running type of the target application. Through the process, the determination of the resource quota value can be realized based on the historical use condition of the resource and the operation type indicating the use fluctuation condition of the resource of the target application, so that the determined resource quota value is ensured to be more in line with the operation type of the target application, and the resource configuration effect is improved.

Description

Resource quota determination method, device, computing equipment and medium
Technical Field
The present disclosure relates to the field of computer technologies, and in particular, to a method, an apparatus, a computing device, and a medium for determining a resource quota.
Background
The reasonable allocation of the resources is realized by calculating the reasonable resource quota required by the application in running through an algorithm based on the application history data, so that the resource allocation of the application is realized according to the calculated resource quota, and the purposes of saving the resources and saving the cost are achieved.
In the related art, when calculating a reasonable resource quota required by an application in running, a historical usage of the resource in a past period of time is mainly obtained, including a historical usage of a central processing unit (Central Processing Unit, CPU) and a historical usage of a Memory (Memory), so that an average value or a maximum value is calculated based on the obtained historical usage of the resource, and the calculated average value or maximum value is used as the reasonable resource quota required by the application in running.
However, the running types of the applications are various, and the calculation index of the above-mentioned resource quota calculation mode is single, so that the calculated resource quota cannot be adapted to the applications with various running types, and further, the resource allocation effect is poor.
Disclosure of Invention
In order to overcome the problems in the related art, the present specification provides a method, an apparatus, a computing device, and a medium for determining a resource quota.
According to a first aspect of an embodiment of the present application, there is provided a resource quota determining method, including:
acquiring the resource usage amount of a target application in a set time period and a historical resource quota value of the target application;
determining an operation type of the target application and an average use amount of resources based on the use amount of the resources of the target application in a set time period, wherein the operation type is used for indicating the fluctuation condition of the use amount of the resources of the target application;
determining a target parameter based on the average usage amount of the resource and the historical resource quota value, wherein the target parameter is used for indicating to reduce the resource quota value or improve the resource quota value;
and determining a target resource quota value of the target application based on the target parameter and the running type of the target application.
In some embodiments, determining the type of operation of the target application based on the amount of resource usage of the target application over the set period of time includes:
if the resource usage of the target application in the set time period meets the set condition, determining the running type of the target application as a stable resource type;
and if the resource usage amount of the target application in the set time period does not meet the set condition, determining the running type of the target application as a resource fluctuation type.
In some embodiments, the historical resource quota value comprises a historical resource maximum quota value;
determining the target parameter based on the average usage of the resource and the historical resource quota value comprises:
and determining the ratio of the average use amount of the resources to the maximum quota value of the historical resources as a target parameter.
In some embodiments, the historical resource quota value comprises a historical resource maximum quota value and a historical resource minimum quota value, and the target resource quota value comprises a target resource maximum quota value and a target resource minimum quota value;
determining a target resource quota value of the target application based on the target parameter and the running type of the target application, including:
determining a target resource maximum quota value based on an operation type, an average resource usage amount, a maximum resource usage amount, a standard deviation of the resource usage amount, a CPU throttling amount and an application memory overflow number under the condition that the target parameter is larger than a first parameter threshold value, and determining a target resource minimum quota value based on the minimum resource usage amount and the average resource usage amount, wherein the CPU throttling amount and the application memory overflow number are data acquired in advance, and the maximum resource usage amount, the minimum resource usage amount and the standard deviation of the resource usage amount are determined and obtained based on the resource usage amount of the target application in a set time period;
Determining a target resource maximum quota value based on the average use amount of the resource and the historical resource maximum quota value under the condition that the target parameter is smaller than a second parameter threshold value, and determining a target resource minimum quota value based on the minimum use amount of the resource;
and under the condition that the target parameter is larger than or equal to the second parameter threshold and smaller than or equal to the first parameter threshold, taking the history resource maximum quota value as the target resource maximum quota value and taking the history resource minimum quota value as the target resource minimum quota value.
In some embodiments, the process of obtaining the number of memory overflows includes:
acquiring the application memory overflow times of a stored target application;
and acquiring the stored restart times and the stored restart reasons of the target application, and determining the restart times of which the restart reasons meet the set conditions as the application memory overflow times of the target application.
In some embodiments, the resources include CPU resources and memory resources;
determining a target resource maximum quota value based on the operation type, the average use amount of the resource, the maximum use amount of the resource, the standard deviation of the use amount of the resource, the throttling amount of the CPU and the overflow number of the application memory, wherein the method comprises the following steps:
when the operation type is used for indicating the resource use fluctuation condition of the CPU, determining a target CPU maximum quota value based on the CPU average use amount, the CPU maximum use amount, the CPU use amount standard deviation and the CPU throttling amount;
When the running type is used for indicating the resource use fluctuation condition of the memory, determining the memory overflow condition of the target application based on the application memory overflow times, and determining the maximum quota value of the target memory based on the memory overflow condition, the average memory use amount, the maximum memory use amount and the standard deviation of the memory use amount, wherein the memory overflow condition is used for indicating whether the target application overflows the memory or not.
In some embodiments, when the operation type is used to indicate a resource usage fluctuation condition of the CPU, determining the target CPU maximum quota value based on the CPU average usage, the CPU maximum usage, the CPU usage standard deviation, and the CPU throttling amount includes:
under the condition that the operation type is CPU stable, determining a target CPU maximum quota value based on the CPU average use amount, the CPU use amount standard deviation, the CPU throttling amount and the first set parameter value;
in the case where the operation type is a CPU fluctuation type, the target CPU maximum quota value is determined based on the CPU maximum usage amount, the CPU throttle amount, the CPU usage standard deviation, the CPU average usage amount, and the first set parameter value.
In some embodiments, determining the target memory maximum quota value based on the memory overflow condition, the average memory usage, the maximum memory usage, and the standard deviation of the memory usage includes:
If the running type is the stable memory, if the memory overflow condition indicates that the target application has memory overflow, determining a maximum quota value of the target memory based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs;
if the running type is the stable memory, if the memory overflow condition indicates that the target application does not overflow the memory, determining a maximum quota value of the target memory based on the average memory usage, the standard deviation of the memory usage and the first set parameter value;
if the running type is the memory fluctuation type, if the memory overflow condition indicates that the target application has memory overflow, determining a maximum quota value of the target memory based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs;
and if the running type is the memory fluctuation type and the memory overflow condition indicates that the target application does not overflow the memory, determining the maximum quota value of the target memory based on the maximum memory usage, the standard deviation of the memory usage, the average memory usage and the first set parameter value.
In some embodiments, determining the target resource minimum quota value based on the resource minimum usage and the resource average usage comprises:
when the running type is used for indicating the resource use fluctuation condition of the CPU, determining a minimum quota value of the target CPU based on the minimum use amount of the CPU;
and when the operation type is used for indicating the resource use fluctuation condition of the memory, determining the minimum quota value of the target memory based on the average use amount of the memory.
In some embodiments, where the target parameter is less than the second parameter threshold, determining the target resource maximum quota value based on the average usage of resources and the historical resource maximum quota value comprises:
determining the average utilization rate of the resources based on the average utilization amount of the resources and the historical maximum quota value of the resources under the condition that the target parameter is smaller than the second parameter threshold;
and determining a target resource maximum quota value based on the average utilization rate of the resources and the historical resource maximum quota value.
In some embodiments, determining the target resource maximum quota value based on the average usage of resources and the historical resource maximum quota value comprises:
determining a target resource maximum quota value based on the historical resource maximum quota value and the second set parameter value under the condition that the average resource utilization rate is smaller than a third set threshold value;
Determining a target resource maximum quota value based on the historical resource maximum quota value and the third set parameter value under the condition that the average resource utilization rate is larger than or equal to a third set threshold value and smaller than a fourth set threshold value;
and taking the historical maximum quota value of the resource as the target maximum quota value of the resource under the condition that the average utilization rate of the resource is larger than or equal to a fourth set threshold value.
In some embodiments, the method further comprises:
and determining the set resource minimum quota value as the target resource minimum quota value of the target application under the condition that the determined target resource minimum quota value is smaller than the set resource minimum quota value based on the target parameter and the running type of the target application.
In some embodiments, after determining the target resource quota value for the target application based on the target parameter and the target resource quota value satisfying the running type of the resource quota adjustment condition application, the method further comprises:
and under the condition that the target resource quota value meets the resource quota adjustment condition, adjusting the resource quota of the target application based on the target resource quota value.
In some embodiments, adjusting the resource quota of the target application based on the target resource quota value includes:
Setting the resource quota of the target application as a target resource quota value under the condition that the target resource quota value determined by the automatic application is set;
and displaying first prompt information for inquiring whether to set the resource quota of the target application as the target resource quota value or not under the condition that the target resource quota value determined by the automatic application is not set.
In some embodiments, the method further comprises:
and under the condition that the resource quota of the target application is set to be the target resource quota value, sending second prompting information to the target device, wherein the second prompting information is used for prompting based on the resource quota adjustment condition of the target application.
In some embodiments, before obtaining the resource usage of the target application and the historical resource quota value of the target application over the set period of time, the method further includes any one of:
under the condition that the resource quota determining process is carried out every preset time, responding to the reaching of the resource quota determining time, acquiring an application list, wherein the application list comprises at least one target application;
in response to receiving the resource allocation instruction, an application list is obtained, the application list including at least one target application.
According to a second aspect of embodiments of the present application, there is provided a resource quota determining apparatus, including:
the acquisition module is used for acquiring the resource usage amount of the target application in a set time period and the historical resource quota value of the target application;
the determining module is used for determining the running type and the average resource usage amount of the target application based on the resource usage amount of the target application in a set time period, wherein the running type is used for indicating that the target application is in a resource usage fluctuation condition;
the determining module is further used for determining a target parameter based on the average use amount of the resources and the historical resource quota value, wherein the target parameter is used for indicating to reduce the resource quota value or improve the resource quota value;
the determining module is further used for determining a target resource quota value of the target application based on the target parameter and the running type of the target application.
In some embodiments, the determining module, when configured to determine the type of operation of the target application based on the amount of resource usage of the target application within the set period of time, is configured to:
if the resource usage of the target application in the set time period meets the set condition, determining the running type of the target application as a stable resource type;
and if the resource usage amount of the target application in the set time period does not meet the set condition, determining the running type of the target application as a resource fluctuation type.
In some embodiments, the historical resource quota value comprises a historical resource maximum quota value;
the determining module, when used for determining the target parameter based on the average usage amount of the resource and the historical resource quota value, is used for:
and determining the ratio of the average use amount of the resources to the maximum quota value of the historical resources as a target parameter.
In some embodiments, the historical resource quota value comprises a historical resource maximum quota value and a historical resource minimum quota value, and the target resource quota value comprises a target resource maximum quota value and a target resource minimum quota value;
the determining module is used for determining a target resource quota value of the target application based on the target parameter and the running type of the target application, and is used for:
determining a target resource maximum quota value based on an operation type, an average resource usage amount, a maximum resource usage amount, a standard deviation of the resource usage amount, a CPU throttling amount and an application memory overflow number under the condition that the target parameter is larger than a first parameter threshold value, and determining a target resource minimum quota value based on the minimum resource usage amount and the average resource usage amount, wherein the CPU throttling amount and the application memory overflow number are data acquired in advance, and the maximum resource usage amount, the minimum resource usage amount and the standard deviation of the resource usage amount are determined and obtained based on the resource usage amount of the target application in a set time period;
Determining a target resource maximum quota value based on the average use amount of the resource and the historical resource maximum quota value under the condition that the target parameter is smaller than a second parameter threshold value, and determining a target resource minimum quota value based on the minimum use amount of the resource;
and under the condition that the target parameter is larger than or equal to the second parameter threshold and smaller than or equal to the first parameter threshold, taking the history resource maximum quota value as the target resource maximum quota value and taking the history resource minimum quota value as the target resource minimum quota value.
In some embodiments, the process of obtaining the number of memory overflows includes:
acquiring the application memory overflow times of a stored target application;
and acquiring the stored restart times and the stored restart reasons of the target application, and determining the restart times of which the restart reasons meet the set conditions as the application memory overflow times of the target application.
In some embodiments, the resources include CPU resources and memory resources;
the determining module is used for determining a target resource maximum quota value based on the operation type, the average use amount of the resource, the maximum use amount of the resource, the standard deviation of the use amount of the resource, the CPU throttling amount and the overflow number of the application memory, and is used for:
when the operation type is used for indicating the resource use fluctuation condition of the CPU, determining a target CPU maximum quota value based on the CPU average use amount, the CPU maximum use amount, the CPU use amount standard deviation and the CPU throttling amount;
When the running type is used for indicating the resource use fluctuation condition of the memory, determining the memory overflow condition of the target application based on the application memory overflow times, and determining the maximum quota value of the target memory based on the memory overflow condition, the average memory use amount, the maximum memory use amount and the standard deviation of the memory use amount, wherein the memory overflow condition is used for indicating whether the target application overflows the memory or not.
In some embodiments, the determining module, when configured to determine the target CPU maximum quota value based on the CPU average usage, the CPU maximum usage, the CPU usage standard deviation, and the CPU throttling amount when the operation type is used to indicate a resource usage fluctuation condition of the CPU, is configured to:
under the condition that the operation type is CPU stable, determining a target CPU maximum quota value based on the CPU average use amount, the CPU use amount standard deviation, the CPU throttling amount and the first set parameter value;
in the case where the operation type is a CPU fluctuation type, the target CPU maximum quota value is determined based on the CPU maximum usage amount, the CPU throttle amount, the CPU usage standard deviation, the CPU average usage amount, and the first set parameter value.
In some embodiments, the determining module, when configured to determine the target memory maximum quota value based on the memory overflow condition, the average memory usage, the maximum memory usage, and the standard deviation of the memory usage, is configured to:
If the running type is the stable memory, if the memory overflow condition indicates that the target application has memory overflow, determining a maximum quota value of the target memory based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs;
if the running type is the stable memory, if the memory overflow condition indicates that the target application does not overflow the memory, determining a maximum quota value of the target memory based on the average memory usage, the standard deviation of the memory usage and the first set parameter value;
if the running type is the memory fluctuation type, if the memory overflow condition indicates that the target application has memory overflow, determining a maximum quota value of the target memory based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs;
and if the running type is the memory fluctuation type and the memory overflow condition indicates that the target application does not overflow the memory, determining the maximum quota value of the target memory based on the maximum memory usage, the standard deviation of the memory usage, the average memory usage and the first set parameter value.
In some embodiments, the determining module, when configured to determine the target resource minimum quota value based on the resource minimum usage and the resource average usage, is configured to:
when the running type is used for indicating the resource use fluctuation condition of the CPU, determining a minimum quota value of the target CPU based on the minimum use amount of the CPU;
and when the operation type is used for indicating the resource use fluctuation condition of the memory, determining the minimum quota value of the target memory based on the average use amount of the memory.
In some embodiments, the determining module, when configured to determine the target resource maximum quota value based on the average usage of resources and the historical resource maximum quota value if the target parameter is less than the second parameter threshold, is configured to:
determining the average utilization rate of the resources based on the average utilization amount of the resources and the historical maximum quota value of the resources under the condition that the target parameter is smaller than the second parameter threshold;
and determining a target resource maximum quota value based on the average utilization rate of the resources and the historical resource maximum quota value.
In some embodiments, the determining module, when configured to determine the target resource maximum quota value based on the average usage of resources and the historical resource maximum quota value, is configured to:
determining a target resource maximum quota value based on the historical resource maximum quota value and the second set parameter value under the condition that the average resource utilization rate is smaller than a third set threshold value;
Determining a target resource maximum quota value based on the historical resource maximum quota value and the third set parameter value under the condition that the average resource utilization rate is larger than or equal to a third set threshold value and smaller than a fourth set threshold value;
and taking the historical maximum quota value of the resource as the target maximum quota value of the resource under the condition that the average utilization rate of the resource is larger than or equal to a fourth set threshold value.
In some embodiments, the determining module is further configured to determine the set resource minimum quota value as the target resource minimum quota value of the target application if the target resource minimum quota value determined based on the target parameter and the running type of the target application is less than the set resource minimum quota value.
In some embodiments, the apparatus further comprises:
and the adjusting module is used for adjusting the resource quota of the target application based on the target resource quota value under the condition that the target resource quota value meets the resource quota adjusting condition.
In some embodiments, the adjustment module, when configured to adjust the resource quota of the target application based on the target resource quota value, is configured to:
setting the resource quota of the target application as a target resource quota value under the condition that the target resource quota value determined by the automatic application is set;
And displaying first prompt information for inquiring whether to set the resource quota of the target application as the target resource quota value or not under the condition that the target resource quota value determined by the automatic application is not set.
In some embodiments, the apparatus further comprises:
the sending module is used for sending second prompt information to the target equipment under the condition that the resource quota of the target application is set to be a target resource quota value, and the second prompt information is used for prompting based on the resource quota adjustment condition of the target application.
In some embodiments, the obtaining module is further configured to, in a case where the resource quota determining process has been set to be performed once every a preset duration, obtain an application list in response to reaching the resource quota determining time, where the application list includes at least one target application;
the acquisition module is further configured to acquire an application list in response to receiving the resource allocation instruction, where the application list includes at least one target application.
According to a third aspect of embodiments of the present application, there is provided a computing device including a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements operations performed by the above-described resource quota determination method when the computer program is executed by the processor.
According to a fourth aspect of embodiments of the present application, there is provided a computer-readable storage medium having a program stored thereon, the program being executed by a processor to perform operations performed by the above-described resource quota determination method.
According to a fifth aspect of embodiments of the present application, there is provided a computer program product comprising a computer program which, when executed by a processor, implements the operations performed by the above-described resource quota determination method.
The technical scheme provided by the embodiment of the application can comprise the following beneficial effects:
by the technical scheme provided by the embodiment of the application, the determination of the resource quota value can be realized based on the historical use condition of the resource and the operation type indicating the use fluctuation condition of the resource of the target application, so that the determined resource quota value is ensured to be more in line with the operation type of the target application, and the resource configuration effect is improved.
It is to be understood that both the foregoing general description and the following detailed description are exemplary and explanatory only and are not restrictive of the disclosure.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the specification and together with the description, serve to explain the principles of the specification.
Fig. 1 is a flowchart of a method for determining a resource quota according to an exemplary embodiment of the application.
Fig. 2 is a flow chart of a resource quota adjustment process, according to an example embodiment.
Fig. 3 is a block diagram of a resource quota determining apparatus according to an exemplary embodiment of the application.
FIG. 4 is a schematic diagram of a computing device according to an exemplary embodiment of the present application.
Detailed Description
Reference will now be made in detail to exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, the same numbers in different drawings refer to the same or similar elements, unless otherwise indicated. The implementations described in the following exemplary examples do not represent all implementations consistent with the present specification. Rather, they are merely examples of apparatus and methods consistent with some aspects of the present description as detailed in this application.
The terminology used in the description presented herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the description. As used in this application, the singular forms "a", "an" and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any or all possible combinations of one or more of the associated listed items.
It should be understood that although the terms first, second, third, etc. may be used in this specification to describe various information, these information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, the first information may also be referred to as second information, and similarly, the second information may also be referred to as first information, without departing from the scope of the present description. The word "if" as used herein may be interpreted as "at … …" or "at … …" or "responsive to a determination", depending on the context.
The application provides a resource quota determining method, which is used for dynamically acquiring the resource usage amount generated by a target application in the running process, so that the running type of the target application is determined based on the resource usage amount, and the target resource quota is determined according to the running type of the target application, so that dynamic application resource allocation is achieved, and the purpose of reasonable resource allocation is achieved.
For easy understanding, the application scenario of the resource quota determining method provided by the present application will be described below by taking two scenarios to which the resource quota determining method provided by the present application may be applied as an example.
For example, the resource quota determination method provided by the application can be used for realizing the resource quota determination of the application in the terminal equipment. In a possible case, when a user uses the terminal device, a situation that a plurality of applications simultaneously keep running state may occur, and at this time, the resource quota determination method provided by the application can be used for determining the resource quota of a plurality of target applications in the terminal device. The target application may be an application installed in the terminal device and currently in an operating state.
For another example, the resource quota determination method provided by the application may be used to implement resource quota determination for an application in a server. In a possible case, the server may provide resources (including running resources and storage resources) for a plurality of applications, and the resource quota determining method provided by the present application may determine resource quotas corresponding to the plurality of applications, so as to ensure smooth running of each application, so that each application may be normally used by a plurality of users. The target application may be an application deployed in a server.
Corresponding to the two application scenarios, the method for determining the resource quota may be executed by a computing device, where the computing device may be a terminal device, such as a desktop computer, a portable computer, a smart phone, a tablet computer, or optionally, the computing device may also be a server, a plurality of servers, a server cluster, a cloud computing platform, or the like, and the application does not limit the device type and the device number of the computing device.
The foregoing is merely illustrative of the application scenario of the present application, and is not limited to the application scenario of the present application, and in many possible implementations, the present application may be applied to various other scenarios involving a resource quota allocation process, and the present application is not limited to a specific application scenario.
After the application scenario of the present application is introduced, the method for determining the resource quota provided by the present application is described in detail below in conjunction with the embodiments of the present application.
As shown in fig. 1, fig. 1 is a flowchart of a resource quota determination method according to an exemplary embodiment of the present application, the method comprising the steps of:
step 101, obtaining the resource usage of the target application in a set time period and the historical resource quota value of the target application.
The target application may be any type of application, and the application type of the target application is not limited in this application. The set time period may be a time period with a duration between the current moments being a preset duration, optionally, the preset duration is any duration, and the specific duration of the preset duration is not limited in the present application.
The resources used by the target application may include running resources and storage resources, for example, the resources used by the target application may include running resources provided by a central processing unit (Central Processing Unit, CPU) and storage resources provided by memory. Accordingly, the historical resource quota value may include a historical CPU resource quota value and a historical memory resource quota value, the historical CPU resource quota value may include a historical CPU maximum quota value and a historical CPU minimum quota value, and the historical memory resource quota value includes a historical memory maximum quota value and a historical memory minimum quota value.
Step 102, determining an operation type and an average use amount of resources of the target application based on the use amount of resources of the target application in a set time period, wherein the operation type is used for indicating the fluctuation condition of the use amount of resources of the target application.
Step 103, determining a target parameter based on the average usage amount of the resource and the historical resource quota value, wherein the target parameter is used for indicating to reduce the resource quota value or increase the resource quota value.
Step 104, determining a target resource quota value of the target application based on the target parameter and the running type of the target application.
The target resource quota value comprises a target CPU resource quota value and a target memory resource quota value, wherein the target CPU resource quota value comprises a target CPU maximum quota value and a target CPU minimum quota value, and the target memory resource quota value comprises a target memory maximum quota value and a target memory minimum quota value.
By the resource quota determining method, the determination of the resource quota value can be realized based on the historical use condition of the resource and the operation type indicating the use fluctuation condition of the resource of the target application, so that the determined resource quota value is ensured to be more in line with the operation type of the target application, and the resource configuration effect is improved.
Having described the basic implementation of the present application, various non-limiting embodiments of the present application are specifically described below.
In some embodiments, the related technician may preset a period for performing resource quota, for example, the related technician may set to perform resource quota determination every preset time, and the computing device may obtain the application list in response to reaching the resource quota determination time determined based on the preset time, where the application list may include at least one target application.
Optionally, the related technicians can also manually trigger the resource quota process at any time according to actual working requirements. In some embodiments, the relevant technician may trigger a resource allocation instruction on the computing device, and the computing device may obtain an application list in response to the resource allocation instruction, where the application list may include at least one target application.
The at least one target application needs to meet two conditions, one is that the target application needs to be installed or deployed in the computing device, and the other is that the target application needs to be currently in a running state.
After the computing device obtains the application list including at least one target application, the computing device may determine, through steps 101 to 104, a target resource quota value of each target application, and description will be given on specific implementation procedures of steps 101 to 104.
It should be noted that, in some embodiments, various running data (including the resource usage amount and the historical resource quota value determined during the past running process of the application) may be generated during the running process of each application, and in some embodiments, the running data generated during the running process of each application may be stored in a database associated with the computing device, so that in step 101, the resource usage amount of the target application in the set period and the historical resource quota value of the target application may be directly obtained from the database associated with the computing device.
When the historical resource quota value of the target application is stored, each time a resource quota value is newly determined, the determined resource quota value and the time for determining the resource quota value can be stored in a database associated with the computing device, and in this case, the database includes a plurality of historical resource quota values and time information corresponding to each historical resource quota value. Optionally, each time a resource quota value is newly determined, the newly determined resource quota value may also be stored in a database associated with the computing device, and the originally stored historical resource quota value is deleted from the database, so that the historical resource quota value stored in the database is only one, and is the latest historical resource quota value closest to the current time point in time.
Accordingly, when the historical resource quota value is obtained from the database, there may be two ways:
under the condition that a plurality of historical resource quota values and time information corresponding to each historical resource quota value are stored in the database, determining time information closest to the time of the current time point based on the time information corresponding to each historical resource quota value stored in the database, and further acquiring the historical resource quota value corresponding to the time information closest to the time of the current time point as the historical resource quota value to be acquired in the step 101.
When only one historical resource quota value closest to the current time point in time is stored in the database, the historical resource quota value is directly obtained from the database and used as the historical resource quota value to be obtained in step 101.
Optionally, the operation data may further include a CPU throttle amount and an Out Of Memory (ook) number. The application may be directly run in the computing device or may be run in a virtual machine of the computing device, and when the application running in the computing device overflows the memory, the application may be perceived and recorded by the computing device, but when the application running in the virtual machine overflows the memory, the computing device may not be perceived, but in this case, the computing device may still restart as much as when the application running in the computing device overflows the memory, so the computing device may obtain the number of times of memory overflow of the application based on the recorded number of times of restarting and the restart reason.
That is, when acquiring the number of overflow of the application memory of the target application, the following two acquisition approaches may be included:
acquiring the application memory overflow times of a stored target application;
and acquiring the stored restart times and the stored restart reasons of the target application, and determining the restart times of which the restart reasons meet the set conditions as the application memory overflow times of the target application.
In one possible implementation manner, after obtaining the number of times of restarting and the reason of restarting the stored target application, the computing device may determine whether there is a device restarting process caused by memory overflow of the application running in the virtual machine when restarting, and determine the number of times of restarting the device restarting process caused by memory overflow of the application running in the virtual machine when determining that there is a device restarting process caused by memory overflow of the application running in the virtual machine, so as to determine the sum of the determined number of times of restarting and the number of times of memory overflow of the stored target application as the total number of times of memory overflow of the application of the target application.
It should be noted that, because the application types are various, when the database stores the operation data corresponding to different applications, each application may be stored in association with the operation data corresponding to each application, so that in step 101, the operation data corresponding to the target application, such as the resource usage amount and the historical resource quota value of the target application in the set period, may be directly obtained from the database based on the application identifier of the target application.
After the resource usage amount of the target application in the set period and the historical resource quota value determined when the target application last performs the resource quota are obtained through step 101, the operation type of the target application can be determined through step 102 based on the data obtained through step 101, so that the determination of the target resource quota value can be realized based on the operation type later. It should be noted that, the operation type may be used to indicate a resource usage fluctuation condition of the target application, and the operation type may be a resource stable type or a resource fluctuation type.
In one possible implementation, if the resource usage of the target application in the set period of time meets the set condition, the running type of the target application is determined to be a resource stable type.
In another possible implementation manner, if the resource usage of the target application in the set period of time does not meet the set condition, the running type of the target application is determined as a resource fluctuation type.
The setting condition may be that the duty ratio of the duration of fluctuation in the setting resource range in the setting time period reaches the setting proportion threshold, the setting resource range may be a value range set according to the actual processing requirement, the setting proportion threshold may be any value, and the setting resource range and the setting proportion threshold are not limited in this application.
It should be noted that, since the resource may be a CPU resource or a memory resource, the resource usage may include a CPU usage and a memory usage, and thus, in step 102, an operation type may be determined based on the CPU usage and the memory usage, so that the target application may correspond to two operation types, which are respectively for the CPU and the memory, and therefore, there is no conflict.
For the CPU, the running type of the target application may be a CPU stationary type or a CPU fluctuation type; for the memory, the operation type of the target application may be a memory stable type or a memory fluctuation type, and the process of determining two operation types corresponding to the target application is described below.
In some embodiments, for step 102, when determining the running type of the target application based on the resource usage of the target application in the set period of time in the case where the resource usage is the CPU usage, any implementation manner may be included as follows:
if the fluctuation condition of the CPU usage amount of the target application in the set time period meets the first set condition, determining the running type of the target application as a CPU stable type;
If the fluctuation condition of the CPU usage amount of the target application in the set time period does not meet the first set condition, determining the running type of the target application as a CPU fluctuation type.
The first setting condition may be that a duty ratio of a time fluctuating in a first setting resource range in a setting time period reaches a first proportional threshold, the first setting resource range may be a value range set according to an actual processing requirement, and the first proportional threshold may be any value.
And when determining the running type of the target application based on the resource usage amount of the target application in the set time period under the condition that the resource usage amount is the memory usage amount, any one of the following implementation manners may be included:
if the fluctuation condition of the memory usage amount of the target application in the set time period meets a second set condition, determining the running type of the target application as a stable memory type;
and if the fluctuation condition of the memory usage amount of the target application in the set time period does not meet the second set condition, determining the running type of the target application as a memory fluctuation type.
The second setting condition may be that the duty ratio of the time fluctuating in the second setting resource range in the setting time period reaches a second proportion threshold, the second setting resource range may be a value range set according to the actual processing requirement, the second proportion threshold may be any value, and the first proportion threshold and the second proportion threshold may be the same or different.
The above describes the process of determining the operation type of the target application in step 102, and for step 102, when determining the average usage of resources based on the usage of resources of the target application in the set period of time, the average usage of resources of the target application in the set period of time may be averaged to obtain the average usage of resources.
As described above, the resource usage amount may include the CPU usage amount and the memory usage amount, and thus, the resource average usage amount also includes the CPU average usage amount and the memory average usage amount, and thus, when determining the resource average usage amount based on the resource usage amount of the target application in the set period of time, it may include two items:
averaging the CPU usage of the target application in a set time period to obtain the average CPU usage;
and averaging the memory usage of the target application in a set time period to obtain the average memory usage.
Through the process, the average use amount of the resources corresponding to the CPU and the memory respectively can be determined, so that the resource quota corresponding to the target application in the CPU and the memory respectively can be determined based on the average use amount of the resources corresponding to the CPU and the memory respectively.
Alternatively, the average usage amount of resources may be determined based on the usage amount of resources of the target application in the set period, and the maximum usage amount of resources, the minimum usage amount of resources, and the standard deviation of the usage amount of resources of the target application may be determined based on the usage amount of resources of the target application in the set period.
And in the case that the resource usage includes the CPU usage and the memory usage, correspondingly, the resource maximum usage includes the CPU maximum usage and the memory maximum usage, the resource minimum usage includes the CPU minimum usage and the memory minimum usage, and the resource usage standard deviation includes the CPU usage standard deviation and the memory usage standard deviation.
Therefore, when determining the maximum usage amount, the minimum usage amount, and the standard deviation of the resource usage amount of the target application based on the resource usage amount of the target application in the set period, the maximum usage amount, the minimum usage amount, and the standard deviation of the CPU usage amount of the target application may be determined based on the CPU usage amount of the target application in the set period, and the maximum usage amount, the minimum usage amount, and the standard deviation of the memory usage amount of the target application may be determined based on the memory usage amount of the target application in the set period.
The determination of the target resource quota value may be subsequently achieved based on the data by determining the maximum usage of the resource, the minimum usage of the resource, and the poor annotation of the usage of the resource.
In some embodiments, for a historical resource quota value, when a value size is taken as a partitioning angle, the historical resource quota value may include a historical resource maximum quota value and a historical resource minimum quota value, and when a corresponding component is taken as a partitioning angle, the historical resource quota value may include a historical CPU resource quota value and a historical memory resource quota value, but in either partitioning manner, the historical resource quota value includes a historical CPU maximum quota value, a historical CPU minimum quota value, a historical memory maximum quota value, and a historical memory minimum quota value.
On this basis, for step 103, when determining the target parameters based on the average usage of resources and the historical resource quota value, the first target parameters may be determined based on the average usage of CPUs and the historical CPU maximum quota value, and the second target parameters may be determined based on the average usage of memories and the historical memory maximum quota value.
When determining the first target parameter based on the average CPU usage and the historical CPU maximum quota value, determining the first target parameter based on the ratio of the average CPU usage and the historical CPU maximum quota value; when determining the second target parameter based on the average memory usage and the historical memory maximum quota value, the second target parameter may be determined based on a ratio of the average memory usage and the historical memory maximum quota value.
By determining the target parameter, whether the last determined historical resource quota value needs to be adjusted or not can be determined based on the target parameter, and the scheme for calculating the target resource quota value based on the historical resource quota value in a quota value increasing and decreasing mode can be different, so that the target resource quota value can be determined in a corresponding calculating mode based on the target parameter later.
After determining the target parameter in step 103, the target resource quota value of the target application may be determined in step 104 based on the target parameter and the operation type of the target application.
For step 104, when determining the target resource quota value of the target application based on the target parameter and the running type of the target application, the following procedure may be implemented:
in one possible implementation, when the target parameter is greater than the first parameter threshold, the target resource maximum quota value is determined based on the operation type, the average usage amount of the resource, the maximum usage amount of the resource, the standard deviation of the usage amount of the resource, the throttling amount of the CPU, and the overflow number of the application memory, and the target resource minimum quota value is determined based on the minimum usage amount of the resource and the average usage amount of the resource.
It should be noted that, the first parameter threshold may be a parameter threshold that is preset by a related technician and needs to increase the resource quota value, and the first parameter threshold may be any value, for example, the first parameter threshold may be 0.9, and when the target parameter is greater than the first parameter threshold, it indicates that the resource quota value of the target application needs to be increased on the basis of the historical resource quota value.
In another possible implementation, in a case where the target parameter is smaller than the second parameter threshold, the target resource maximum quota value is determined based on the average usage of the resource and the historical resource maximum quota value, and the target resource minimum quota value is determined based on the minimum usage of the resource.
It should be noted that, the second parameter threshold may be a parameter threshold that is preset by a related technician and needs to reduce the resource quota value, and the second parameter threshold may be any value, for example, the second parameter threshold may be 0.5, and when the target parameter is smaller than or greater than the second parameter threshold, it indicates that the resource quota value of the target application needs to be reduced on the basis of the historical resource quota value.
In another possible implementation manner, when the target parameter is greater than or equal to the second parameter threshold and less than or equal to the first parameter threshold, the historical resource maximum quota value is taken as the target resource maximum quota value, and the historical resource minimum quota value is taken as the target resource minimum quota value.
It should be noted that, since the data involved in steps 101 to 103 may be classified into CPU-specific and memory-specific data, when determining the target resource quota value of the target application based on the target parameter and the operation type of the target application, the target CPU resource quota value of the target application may be determined based on the first target parameter and the operation type of the target application, and the target memory resource quota value of the target application may be determined based on the second target parameter and the operation type of the target application, for step 104.
That is, step 104 may determine two sets of target resource quota values, where one set is a target CPU resource quota value, including a target CPU maximum quota value and a target CPU minimum quota value, and the other set is a target memory resource quota value, including a target memory maximum quota value and a target memory minimum quota value, and the process of determining the two sets of target resource quota values is described below.
First, a procedure for determining a target resource quota value when a target parameter is greater than a first parameter threshold is introduced.
1. Determining a target CPU maximum quota value
It should be noted that, when determining the target CPU quota value, the target parameter used is the first target parameter.
That is, if the first target parameter is greater than the first parameter threshold, when the operation type is used to indicate a resource usage fluctuation condition of the CPU, the target CPU maximum quota value is determined based on the CPU average usage, the CPU maximum usage, the CPU usage standard deviation, and the CPU throttling amount.
And determining a target CPU maximum quota value based on the CPU average usage, the CPU usage standard deviation, the CPU throttling amount and the first set parameter value under the condition that the operation type is CPU stable.
Optionally, when determining the target CPU maximum quota value based on the CPU average usage amount, the CPU throttling amount, the CPU usage standard deviation, and the first set parameter value, the CPU average usage amount may be used as the resource allocation base, and the CPU throttling amount, the CPU usage standard deviation, and the floating CPU resource amount may be added on the basis of the CPU average usage amount, so as to obtain the target CPU maximum quota value. The floating CPU resource amount may be the product of the average CPU usage and the first set parameter value.
It should be noted that, the first set parameter value may be a floating percentage preset by a related technician, the first set parameter value may be any value, for example, the first set parameter value may be 0.2, and by setting the first set parameter value, resource redundancy configuration may be performed based on the first set parameter value, so that the situation that the resource usage amount suddenly rises through reasonable redundancy of resources may be effectively applied.
In addition, in the case where the operation type is a CPU fluctuation type, the target CPU maximum quota value is determined based on the CPU maximum usage amount, the CPU throttle amount, the CPU usage standard deviation, the CPU average usage amount, and the first set parameter value.
Optionally, when determining the target CPU maximum quota value based on the CPU maximum usage amount, the CPU throttling amount, the CPU usage standard deviation, the CPU average usage amount, and the first set parameter value, the CPU maximum usage amount may be used as the resource allocation base, and the CPU throttling amount, the CPU usage standard deviation, and the floating CPU resource amount are added on the basis of the CPU maximum usage amount, so as to obtain the target CPU maximum quota value. The floating CPU resource amount may be the product of the average CPU usage and the first set parameter value.
2. Determining a target CPU minimum quota value
And determining a target CPU minimum quota value based on the CPU minimum usage when the running type is used for indicating the resource usage fluctuation condition of the CPU.
Alternatively, in determining the target CPU minimum quota value based on the CPU minimum usage amount, the CPU minimum usage amount may be determined as the target CPU minimum quota value regardless of whether the operation type is a CPU stationary type or a CPU fluctuation type.
3. Determining a maximum quota value for a target memory
It should be noted that, when determining the target memory quota value, the target parameter used is the second target parameter.
That is, if the second target parameter is greater than the first parameter threshold, determining a memory overflow condition of the target application based on the number of times of memory overflow of the application when the operation type is used for indicating a resource usage fluctuation condition of the memory, and determining a target memory maximum quota value based on the memory overflow condition, the average memory usage, the maximum memory usage and a standard deviation of the memory usage, wherein the memory overflow condition is used for indicating whether the target application overflows the memory.
If the memory overflow condition indicates that the target application has memory overflow, determining a maximum quota value of the target memory based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs.
It should be noted that, if the number of overflow times of the application memory of the target application is 0, it indicates that the target application has not overflowed the memory; if the number of the overflow times of the application memory of the target application is not 0, the target application is indicated to overflow the memory.
The above embodiment has introduced that the obtained application memory overflow times not only include the application memory overflow times in the virtual machine that are directly recorded by the computing device, but also include the application memory overflow times in the virtual machine that are determined based on the restart times and the restart reasons, so that the application memory overflow times can be ensured to more conform to the actual running situation, and further the accuracy degree of determining whether the target application has memory overflow or not is ensured.
When determining the target memory maximum quota value based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs, the memory usage amount when the memory overflow occurs can be used as a resource allocation base, and the memory usage standard deviation and the floating memory resource amount are added on the basis of the memory usage amount when the memory overflow occurs, so as to obtain the target memory maximum quota value. The floating memory resource amount may be the product of the average memory usage amount and the first set parameter value, and the description of the first set parameter value may be referred to the above embodiment, which is not repeated herein.
It should be noted that, if the target application has multiple memory overflows, the memory usage amount when the memory overflows will have multiple values, so that the maximum value can be determined from the multiple memory usage amounts when the memory overflows, and the determined maximum value is used as the resource configuration base number. And under the condition that the target application only has once memory overflow, the memory usage amount during the memory overflow is directly used as a resource allocation base number.
And under the condition that the operation type is the memory stable type, if the memory overflow condition indicates that the target application does not overflow the memory, determining the maximum quota value of the target memory based on the average memory usage, the standard deviation of the memory usage and the first set parameter value.
When determining the target memory maximum quota value based on the memory average usage, the memory usage standard deviation and the first set parameter value, the memory average usage may be used as a resource allocation base, and the memory usage standard deviation and the floating memory resource amount may be added to obtain the target memory maximum quota value based on the memory average usage. The floating memory resource amount may be the product of the average memory usage amount and the first set parameter value, and the description of the first set parameter value may be referred to the above embodiment, which is not repeated herein.
If the running type is the memory fluctuation type, if the memory overflow condition indicates that the target application has memory overflow, determining a maximum quota value of the target memory based on the memory usage amount, the memory average usage amount, the standard deviation of the memory usage amount and the first set parameter value when the memory overflow occurs.
When determining the target memory maximum quota value based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs, the memory usage amount when the memory overflow occurs can be used as a resource allocation base, and the memory usage standard deviation and the floating memory resource amount are added on the basis of the memory usage amount when the memory overflow occurs, so as to obtain the target memory maximum quota value. The floating memory resource amount may be the product of the average memory usage amount and the first set parameter value, and the description of the first set parameter value may be referred to the above embodiment, which is not repeated herein.
And if the running type is the memory fluctuation type and the memory overflow condition indicates that the target application does not overflow the memory, determining the maximum quota value of the target memory based on the maximum memory usage, the standard deviation of the memory usage, the average memory usage and the first set parameter value.
When determining the target memory maximum quota value based on the memory maximum usage, the memory usage standard deviation, the memory average usage and the first set parameter value, the memory maximum usage may be used as a resource allocation base, and the memory usage standard deviation and the floating memory resource amount may be added to obtain the target memory maximum quota value based on the memory maximum usage. The floating memory resource amount may be the product of the average memory usage amount and the first set parameter value, and the description of the first set parameter value may be referred to the above embodiment, which is not repeated herein.
4. Determining a target memory minimum quota value
And when the operation type is used for indicating the resource use fluctuation condition of the memory, determining the minimum quota value of the target memory based on the average use amount of the memory.
Optionally, when determining the target memory minimum quota value based on the memory minimum usage, the average memory usage may be determined as the target memory minimum quota value regardless of whether the operation type is a memory smooth type or a memory wavy type.
Next, a procedure for determining the target resource quota value when the target parameter is smaller than the second parameter threshold is described.
1. Determining a target resource maximum quota value
The process of determining the maximum quota value of the target resource may be: determining the average utilization rate of the resources based on the average utilization amount of the resources and the historical maximum quota value of the resources under the condition that the target parameter is smaller than the second parameter threshold; and determining a target resource maximum quota value based on the average utilization rate of the resources and the historical resource maximum quota value.
When determining the average usage rate of the resources based on the average usage amount of the resources and the historical maximum quota value of the resources, the ratio of the average usage amount of the resources to the historical maximum quota value of the resources can be determined as the average usage rate of the resources.
In determining the target resource maximum quota value based on the average usage of resources and the historical resource maximum quota value, the following implementation manner may be included:
in one possible implementation, in a case where the average usage of the resources is less than the third set threshold, the target resource maximum quota value is determined based on the historical resource maximum quota value and the second set parameter value.
The third set threshold may be a value set by a related technician according to a technical requirement, and the third set threshold may be any value, for example, the third set threshold may be 0.5. The second set parameter value may be any value, for example, the second set parameter value may be 0.5.
Optionally, when determining the target resource maximum quota value based on the historical resource maximum quota value and the second set parameter value, a product of the historical resource maximum quota value and the second set parameter value may be determined as the target resource maximum quota value.
In another possible implementation, in a case where the average usage of the resource is greater than or equal to the third set threshold and less than the fourth set threshold, the target resource maximum quota value is determined based on the historical resource maximum quota value and the third set parameter value.
The fourth set threshold may be a value set by a related technician according to a technical requirement, and the fourth set threshold may be any value, for example, the fourth set threshold may be 0.7. The third setting parameter value may be any value, for example, the third setting parameter value may be 0.7.
Optionally, when determining the target resource maximum quota value based on the historical resource maximum quota value and the third set parameter value, a product of the historical resource maximum quota value and the third set parameter value may be determined as the target resource maximum quota value.
In another possible implementation manner, in a case that the average usage rate of the resources is greater than or equal to the fourth set threshold value, the historical maximum quota value of the resources is taken as the target maximum quota value of the resources.
For ease of understanding, the process of determining the target CPU maximum quota value and the target memory maximum quota value is described below, respectively.
(1) Determining a target CPU maximum quota value
It should be noted that, when determining the target CPU quota value, the target parameter used is the first target parameter.
That is, if the first target parameter is smaller than the second parameter threshold, determining the average CPU usage based on the average CPU usage and the historical maximum CPU quota value, and further determining the target maximum CPU quota value based on the average CPU usage and the historical maximum CPU quota value.
Wherein, when determining the target CPU maximum quota value based on the CPU average usage and the historical CPU maximum quota value, the method may include the following implementation manner:
determining a target CPU maximum quota value based on the historical CPU maximum quota value and the second set parameter value under the condition that the CPU average usage is smaller than a third set threshold;
determining a target CPU maximum quota value based on the historical CPU maximum quota value and the third set parameter value under the condition that the CPU average usage is larger than or equal to a third set threshold and smaller than a fourth set threshold;
and taking the historical CPU maximum quota value as the target CPU maximum quota value under the condition that the average CPU usage rate is larger than or equal to a fourth set threshold value.
(2) Determining a maximum quota value for a target memory
It should be noted that, when determining the target memory quota value, the target parameter used is the second target parameter.
That is, if the second target parameter is smaller than the second parameter threshold, determining the average memory usage based on the average memory usage and the historical memory maximum quota value, and further determining the target memory maximum quota value based on the average memory usage and the historical memory maximum quota value.
When determining the target memory maximum quota value based on the memory average usage and the historical memory maximum quota value, the method may include the following implementation modes:
determining a target memory maximum quota value based on the historical memory maximum quota value and the second set parameter value under the condition that the average memory usage is smaller than a third set threshold;
determining a target memory maximum quota value based on the historical memory maximum quota value and the third set parameter value under the condition that the average memory usage rate is larger than or equal to a third set threshold value and smaller than a fourth set threshold value;
and under the condition that the average memory usage rate is greater than or equal to a fourth set threshold value, taking the historical memory maximum quota value as the target memory maximum quota value.
2. Determining a target resource minimum quota value
The process of determining the minimum quota value of the target resource may be: and determining a minimum quota value of the target resource based on the minimum usage of the resource under the condition that the target parameter is smaller than the second parameter threshold.
Optionally, when determining the target resource minimum quota value based on the minimum usage amount of the resource, the minimum usage amount of the resource may be determined as the target resource minimum quota value regardless of whether the operation type is a steady type of the resource or a fluctuating type of the resource.
That is, when determining the target CPU minimum quota value, the CPU minimum usage amount can be determined as the CPU minimum quota value regardless of whether the operation type is the CPU stationary type or the CPU fluctuating type; when the target memory minimum quota value is determined, the memory minimum usage amount can be determined as the memory minimum quota value no matter the operation type is a memory stable type or a memory fluctuation type.
Next, a procedure for determining the target resource quota value when the target parameter is greater than the second parameter threshold and less than or equal to the first parameter threshold is described.
When the target parameter is greater than or equal to the second parameter threshold and less than or equal to the first parameter threshold, it indicates that the target resource quota value to be determined this time can be used as the historical resource quota value determined when the resource quota is performed last time, so that the historical resource quota value is directly determined as the target resource maximum quota value.
That is, when the first target parameter is greater than or equal to the second parameter threshold and less than or equal to the first parameter threshold, the historical CPU maximum quota value is directly determined as the target CPU maximum quota value, and the historical CPU minimum quota value is determined as the target CPU minimum quota value; and under the condition that the second target parameter is larger than or equal to the second parameter threshold and smaller than or equal to the first parameter threshold, directly determining the maximum historical memory quota value as the maximum target memory quota value, and determining the minimum historical memory quota value as the minimum target memory quota value.
The above process describes a process of determining a target resource maximum quota value (including a target CPU maximum quota value and a target memory maximum quota value) and a target resource minimum quota value (including a target CPU minimum quota value and a target memory minimum quota value), and in more possible implementations, a related technician may also preset a set resource minimum quota value, so that when an application is first online or a calculated resource quota is lower than the set resource minimum quota value, the set resource minimum quota value may be defaulted to be the target resource minimum quota value.
That is, in the case where the target resource minimum quota value determined based on the target parameter and the running type of the target application is smaller than the set resource minimum quota value, the set resource minimum quota value is determined as the target resource minimum quota value of the target application.
Optionally, setting the resource minimum quota value may include setting a CPU minimum quota value and setting a memory minimum quota value, so in some embodiments, after determining the target CPU minimum quota value based on the first target parameter and the operation type of the target application, the determined target CPU minimum quota value and the set CPU minimum quota value may be further compared, and when the determined target CPU minimum quota value is less than the set CPU minimum quota value, the set CPU minimum quota value may be used as the target CPU minimum quota value; and under the condition that the determined minimum quota value of the target CPU is larger than or equal to the set minimum quota value of the CPU, the determined result based on the first target parameter and the running type of the target application is still used as the minimum quota value of the target CPU. The set minimum CPU quota value may be any value, for example, the set minimum CPU quota value may be 500M.
In addition, after determining the minimum quota value of the target memory based on the second target parameter and the operation type of the target application, the determined minimum quota value of the target memory and the set minimum quota value of the memory can be compared, and if the determined minimum quota value of the target memory is smaller than the set minimum quota value of the memory, the set minimum quota value of the memory is used as the minimum quota value of the target memory; and under the condition that the determined minimum quota value of the target memory is larger than or equal to the set minimum quota value of the memory, the determined result based on the second target parameter and the running type of the target application is still used as the minimum quota value of the target memory. The set memory minimum quota value may be any value, for example, the set memory minimum quota value may be 250MiB.
In addition, when the application is online for the first time, the target resource maximum quota value may not be set for the application, but only the resource minimum quota threshold may be used as the target resource minimum quota value.
Through the above process, the target resource quota value has been determined, and whether the target resource quota value meets the resource quota adjustment condition can also be determined, so that the resource quota of the target application is adjusted based on the target resource quota value when the target resource quota value meets the resource quota adjustment condition.
When determining whether the target resource quota value meets the resource quota adjustment condition, the ratio of the target resource quota value to the historical resource quota value can be determined, the determined ratio is compared with a preset ratio, and when the determined ratio is larger than the preset ratio, the target resource quota value can be determined to meet the resource quota adjustment condition, otherwise, the target resource quota value is considered to not meet the resource quota adjustment condition.
It should be noted that, since the target resource quota value includes a target resource maximum quota value and a target resource minimum quota value, a ratio of the target resource maximum quota value to the historical resource maximum quota value and a ratio of the target resource minimum quota value to the historical resource minimum quota value may be determined respectively, so that the two ratios are compared with preset ratios respectively.
Alternatively, the preset ratio may be any value, for example, the preset ratio may be 0.2.
In addition, in the case where the target resource quota value satisfies the resource quota adjustment condition, the computing device may also determine whether to apply the determined target resource quota value according to the user setting.
In one possible implementation manner, the user may preset the target resource quota value determined by the automatic application, and if the target resource quota value determined by the automatic application is set in a case that the target resource quota value meets the resource quota adjustment condition, the computing device may directly set the resource quota of the target application to the target resource quota value after determining the target resource quota value through the above process.
In another possible implementation manner, the user may preset the target resource quota value determined by the non-automatic application, and if the target resource quota value determined by the automatic application is not set under the condition that the target resource quota value meets the resource quota adjustment condition, the computing device may display the first prompt information after determining the target resource quota value through the above process, so as to query whether to set the resource quota of the target application to the target resource quota value through the first prompt information.
Optionally, the first prompt information may provide a first control and a second control, and the user may confirm that the resource quota of the target application is set to the target resource quota value by triggering the first control, and confirm that the resource quota of the target application is not set to the target resource quota value by triggering the second control.
It should be noted that, after setting the resource quota of the target application to the target resource quota value, the target application may restart itself, so that the restarted target application may provide services for the user based on the target resource quota value.
In more possible implementations, after setting the resource quota of the target application to the target resource quota value, second prompting information may also be sent to the target device, so as to prompt, by using the second prompting information, a resource quota adjustment condition of the target application, for example, what a resource quota adjustment result (that is, the target resource quota value) of the target application is, whether the target application has been successfully allocated to a resource corresponding to the target resource quota value at present, and so on.
The target device may be a management device corresponding to the computing device, and the related technician may monitor the application running condition through the target device.
It should be noted that, whether the second prompt information needs to be sent to the target device may also be set by the user according to actual needs, for example, the user may set on the computing device to automatically send the second prompt information to the target device after setting the resource quota of the target application to the target resource quota value, or may set to set the resource quota of the target application to the target resource quota value without sending the second prompt information to the target device, which is not limited in this application.
Referring to fig. 2, fig. 2 is a flowchart of a resource quota adjustment process according to an exemplary embodiment of the present application, as shown in fig. 2, after an application list is acquired, for each application, a computing device may acquire a monitor indicator of the application (that is, a CPU usage amount, a memory usage amount, an application restart number, a restart reason, a CPU throttling amount, an application memory overflow number, etc.) so as to determine an operation type of the application (such as a CPU stable type, a CPU fluctuation type, a memory stable type, or a memory fluctuation type) based on the acquired monitor indicator, calculate a CPU average usage amount, a memory average usage amount, a CPU maximum usage amount, a CPU minimum usage amount, a memory minimum usage amount, a CPU usage standard deviation, and a memory usage standard deviation of the application, so as to implement determination of a target resource quota value of the application based on the above data, and then, when the determined target resource quota value satisfies a resource quota adjustment condition, perform quota setting based on the target resource value, restart the application after the quota setting is completed, and when the target resource value does not satisfy the resource adjustment condition, a quota is not satisfied, and a quota is obtained again, or a quota is waited for the application can be obtained, and the quota is determined.
Corresponding to the embodiments of the aforementioned method, the present application also provides embodiments of the corresponding apparatus and computing device to which it is applied.
As shown in fig. 3, fig. 3 is a block diagram of a resource quota determining apparatus according to an exemplary embodiment of the present application, the apparatus comprising:
an obtaining module 301, configured to obtain a resource usage amount of a target application in a set period of time and a historical resource quota value of the target application;
a determining module 302, configured to determine an operation type of the target application and an average usage amount of resources based on the usage amount of resources of the target application in a set period, where the operation type is used to indicate that the target application is a resource usage fluctuation situation;
the determining module 302 is further configured to determine a target parameter, based on the average usage amount of the resource and the historical resource quota value, where the target parameter is used to indicate to decrease the resource quota value or increase the resource quota value;
the determining module 302 is further configured to determine a target resource quota value of the target application based on the target parameter and the running type of the target application.
In some embodiments, the determining module 302, when configured to determine the type of operation of the target application based on the resource usage of the target application within the set period of time, is configured to:
If the resource usage of the target application in the set time period meets the set condition, determining the running type of the target application as a stable resource type;
and if the resource usage amount of the target application in the set time period does not meet the set condition, determining the running type of the target application as a resource fluctuation type.
In some embodiments, the historical resource quota value comprises a historical resource maximum quota value;
the determining module 302, when configured to determine the target parameter based on the average usage of the resource and the historical resource quota value, is configured to:
and determining the ratio of the average use amount of the resources to the maximum quota value of the historical resources as a target parameter.
In some embodiments, the historical resource quota value comprises a historical resource maximum quota value and a historical resource minimum quota value, and the target resource quota value comprises a target resource maximum quota value and a target resource minimum quota value;
the determining module 302, when configured to determine the target resource quota value of the target application based on the target parameter and the running type of the target application, is configured to:
determining a target resource maximum quota value based on an operation type, an average resource usage amount, a maximum resource usage amount, a standard deviation of the resource usage amount, a CPU throttling amount and an application memory overflow number under the condition that the target parameter is larger than a first parameter threshold value, and determining a target resource minimum quota value based on the minimum resource usage amount and the average resource usage amount, wherein the CPU throttling amount and the application memory overflow number are data acquired in advance, and the maximum resource usage amount, the minimum resource usage amount and the standard deviation of the resource usage amount are determined and obtained based on the resource usage amount of the target application in a set time period;
Determining a target resource maximum quota value based on the average use amount of the resource and the historical resource maximum quota value under the condition that the target parameter is smaller than a second parameter threshold value, and determining a target resource minimum quota value based on the minimum use amount of the resource;
and under the condition that the target parameter is larger than or equal to the second parameter threshold and smaller than or equal to the first parameter threshold, taking the history resource maximum quota value as the target resource maximum quota value and taking the history resource minimum quota value as the target resource minimum quota value.
In some embodiments, the process of obtaining the number of memory overflows includes:
acquiring the application memory overflow times of a stored target application;
and acquiring the stored restart times and the stored restart reasons of the target application, and determining the restart times of which the restart reasons meet the set conditions as the application memory overflow times of the target application.
In some embodiments, the resources include CPU resources and memory resources;
the determining module 302, when configured to determine the target resource maximum quota value based on the operation type, the average usage of resources, the maximum usage of resources, the standard deviation of usage of resources, the throttling amount of the CPU, and the overflow number of the application memory, is configured to:
when the operation type is used for indicating the resource use fluctuation condition of the CPU, determining a target CPU maximum quota value based on the CPU average use amount, the CPU maximum use amount, the CPU use amount standard deviation and the CPU throttling amount;
When the running type is used for indicating the resource use fluctuation condition of the memory, determining the memory overflow condition of the target application based on the application memory overflow times, and determining the maximum quota value of the target memory based on the memory overflow condition, the average memory use amount, the maximum memory use amount and the standard deviation of the memory use amount, wherein the memory overflow condition is used for indicating whether the target application overflows the memory or not.
In some embodiments, the determining module 302, when configured to determine the target CPU maximum quota value based on the CPU average usage, the CPU maximum usage, the CPU usage standard deviation, and the CPU throttling amount when the operation type is used to indicate a resource usage fluctuation condition of the CPU, is configured to:
under the condition that the operation type is CPU stable, determining a target CPU maximum quota value based on the CPU average use amount, the CPU use amount standard deviation, the CPU throttling amount and the first set parameter value;
in the case where the operation type is a CPU fluctuation type, the target CPU maximum quota value is determined based on the CPU maximum usage amount, the CPU throttle amount, the CPU usage standard deviation, the CPU average usage amount, and the first set parameter value.
In some embodiments, the determining module 302, when configured to determine the target memory maximum quota value based on the memory overflow condition, the average memory usage, the maximum memory usage, and the standard deviation of the memory usage, is configured to:
If the running type is the stable memory, if the memory overflow condition indicates that the target application has memory overflow, determining a maximum quota value of the target memory based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs;
if the running type is the stable memory, if the memory overflow condition indicates that the target application does not overflow the memory, determining a maximum quota value of the target memory based on the average memory usage, the standard deviation of the memory usage and the first set parameter value;
if the running type is the memory fluctuation type, if the memory overflow condition indicates that the target application has memory overflow, determining a maximum quota value of the target memory based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs;
and if the running type is the memory fluctuation type and the memory overflow condition indicates that the target application does not overflow the memory, determining the maximum quota value of the target memory based on the maximum memory usage, the standard deviation of the memory usage, the average memory usage and the first set parameter value.
In some embodiments, the determining module 302, when configured to determine the target resource minimum quota value based on the resource minimum usage and the average usage of resources, is configured to:
when the running type is used for indicating the resource use fluctuation condition of the CPU, determining a minimum quota value of the target CPU based on the minimum use amount of the CPU;
and when the operation type is used for indicating the resource use fluctuation condition of the memory, determining the minimum quota value of the target memory based on the average use amount of the memory.
In some embodiments, the determining module 302, when configured to determine the target resource maximum quota value based on the average usage of resources and the historical resource maximum quota value if the target parameter is less than the second parameter threshold, is configured to:
determining the average utilization rate of the resources based on the average utilization amount of the resources and the historical maximum quota value of the resources under the condition that the target parameter is smaller than the second parameter threshold;
and determining a target resource maximum quota value based on the average utilization rate of the resources and the historical resource maximum quota value.
In some embodiments, the determining module 302, when configured to determine the target resource maximum quota value based on the average usage of resources and the historical resource maximum quota value, is configured to:
Determining a target resource maximum quota value based on the historical resource maximum quota value and the second set parameter value under the condition that the average resource utilization rate is smaller than a third set threshold value;
determining a target resource maximum quota value based on the historical resource maximum quota value and the third set parameter value under the condition that the average resource utilization rate is larger than or equal to a third set threshold value and smaller than a fourth set threshold value;
and taking the historical maximum quota value of the resource as the target maximum quota value of the resource under the condition that the average utilization rate of the resource is larger than or equal to a fourth set threshold value.
In some embodiments, the determining module 302 is further configured to determine the set resource minimum quota value as the target resource minimum quota value of the target application if the target resource minimum quota value determined based on the target parameter and the running type of the target application is less than the set resource minimum quota value.
In some embodiments, the apparatus further comprises:
and the adjusting module is used for adjusting the resource quota of the target application based on the target resource quota value under the condition that the target resource quota value meets the resource quota adjusting condition.
In some embodiments, the adjustment module, when configured to adjust the resource quota of the target application based on the target resource quota value, is configured to:
Setting the resource quota of the target application as a target resource quota value under the condition that the target resource quota value determined by the automatic application is set;
and displaying first prompt information for inquiring whether to set the resource quota of the target application as the target resource quota value or not under the condition that the target resource quota value determined by the automatic application is not set.
In some embodiments, the apparatus further comprises:
the sending module is used for sending second prompt information to the target equipment under the condition that the resource quota of the target application is set to be a target resource quota value, and the second prompt information is used for prompting based on the resource quota adjustment condition of the target application.
In some embodiments, the obtaining module 301 is further configured to, in a case where the resource quota determining process has been set to be performed once every preset duration, obtain, in response to reaching the resource quota determining time, an application list, where the application list includes at least one target application;
the obtaining module 301 is further configured to obtain, in response to receiving the resource allocation instruction, an application list, where the application list includes at least one target application.
The implementation process of the functions and roles of each module in the above device is specifically shown in the implementation process of the corresponding steps in the above method, and will not be described herein again.
For the device embodiments, reference is made to the description of the method embodiments for the relevant points, since they essentially correspond to the method embodiments. The apparatus embodiments described above are merely illustrative, wherein the modules illustrated as separate components may or may not be physically separate, and the components shown as modules may or may not be physical, i.e., may be located in one place, or may be distributed over a plurality of network modules. Some or all of the modules may be selected according to actual needs to achieve the purposes of the present description. Those of ordinary skill in the art will understand and implement the present invention without undue burden.
The present application also provides a computing device, referring to fig. 4, fig. 4 is a schematic structural diagram of a computing device according to an exemplary embodiment. As shown in fig. 4, the computing device includes a processor 410, a memory 420, and a network interface 430, where the memory 420 is configured to store computer instructions executable on the processor 410, the processor 410 is configured to implement the resource quota determination method provided in any embodiment of the application when the computer instructions are executed, and the network interface 430 is configured to implement an input-output function. In further possible implementations, the computing device may also include other hardware, which is not limited in this application.
The present application also provides a computer-readable storage medium, which may take many forms, for example, in different examples, the computer-readable storage medium may be: RAM (Radom Access Memory, random access memory), volatile memory, non-volatile memory, flash memory, a storage drive (e.g., hard drive), a solid state drive, any type of storage disk (e.g., optical disk, DVD, etc.), or a similar storage medium, or a combination thereof. In particular, the computer readable medium may also be paper or other suitable medium capable of printing the program. The computer readable storage medium stores a computer program, which when executed by a processor implements the method for determining a resource quota provided by any embodiment of the application.
The application also provides a computer program product, which comprises a computer program, and the computer program realizes the resource quota determining method provided by any embodiment of the application when being executed by a processor.
It will be apparent to one of ordinary skill in the art that one or more embodiments of the present description may be provided as a method, apparatus, computing device, computer-readable storage medium, or computer program product. Accordingly, one or more embodiments of the present description may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Moreover, one or more embodiments of the present description can take the form of a computer program product on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, etc.) having computer-usable program code embodied therein.
In this specification, each embodiment is described in a progressive manner, and identical and similar parts of each embodiment are all referred to each other, and each embodiment mainly describes differences from other embodiments. In particular, for embodiments corresponding to computing devices, the description is relatively simple, as it is substantially similar to method embodiments, with reference to the partial description of method embodiments being relevant.
The foregoing describes specific embodiments of the present disclosure. Other embodiments are within the scope of the present application. In some cases, the acts or steps recited in the present application may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing are also possible or may be advantageous.
Embodiments of the subject matter and the functional operations described in this specification can be implemented in: digital electronic circuitry, tangibly embodied computer software or firmware, computer hardware including the structures disclosed in this specification and structural equivalents thereof, or a combination of one or more of them. Embodiments of the subject matter described in this specification can be implemented as one or more computer programs, i.e., one or more modules of computer program instructions encoded on a tangible, non-transitory program carrier for execution by, or to control the operation of, data processing apparatus. Alternatively or additionally, the program instructions may be encoded on a manually generated propagated signal, e.g., a machine-generated electrical, optical, or electromagnetic signal, that is generated to encode and transmit information to suitable receiver apparatus for execution by the resource quota determination apparatus. The computer storage medium may be a machine-readable storage device, a machine-readable storage substrate, a random or serial access memory device, or a combination of one or more of them.
The processes and logic flows described in this specification can be performed by one or more programmable computers executing one or more computer programs to perform corresponding functions by operating on input data and generating output. The processes and logic flows can also be performed by, and apparatus can also be implemented as, special purpose logic circuitry, e.g., an FPGA (field programmable gate array) or an ASIC (application-specific integrated circuit).
Computers suitable for executing computer programs include, for example, general purpose and/or special purpose microprocessors, or any other type of central processing unit. Typically, the central processing unit will receive instructions and data from a read only memory and/or a random access memory. The essential elements of a computer include a central processing unit for carrying out or executing instructions and one or more memory devices for storing instructions and data. Typically, a computer will also include, or be operatively coupled to receive data from or transfer data to, or both, one or more mass storage devices for storing data, e.g., magnetic, magneto-optical disks, or optical disks, etc. However, a computer does not have to have such a device. Furthermore, the computer may be embedded in another device, such as a mobile phone, a Personal Digital Assistant (PDA), a mobile audio or video player, a game console, a Global Positioning System (GPS) receiver, or a portable storage device such as a Universal Serial Bus (USB) flash drive, to name a few.
Computer readable media suitable for storing computer program instructions and data include all forms of non-volatile memory, media and memory devices including, for example, semiconductor memory devices (e.g., EPROM, EEPROM, and flash memory devices), magnetic disks (e.g., internal hard disk or removable disks), magneto-optical disks, and CD-ROM and DVD-ROM disks. The processor and the memory can be supplemented by, or incorporated in, special purpose logic circuitry.
While this specification contains many specific implementation details, these should not be construed as limitations on the scope of any invention or of what may be claimed, but rather as descriptions of features of specific embodiments of particular inventions. Certain features that are described in this specification in the context of separate embodiments can also be implemented in combination in a single embodiment. On the other hand, the various features described in the individual embodiments may also be implemented separately in the various embodiments or in any suitable subcombination. Furthermore, although features may be acting in certain combinations and even initially claimed as such, one or more features from a claimed combination can in some cases be excised from the combination, and the claimed combination may be directed to a subcombination or variation of a subcombination.
Similarly, although operations are depicted in the drawings in a particular order, this should not be understood as requiring that such operations be performed in the particular order shown or in sequential order, or that all illustrated operations be performed, to achieve desirable results. In some cases, multitasking and parallel processing may be advantageous. Moreover, the separation of various system modules and components in the embodiments described above should not be understood as requiring such separation in all embodiments, and it should be understood that the described program components and systems can generally be integrated together in a single software product or packaged into multiple software products.
Thus, particular embodiments of the subject matter have been described. Other embodiments are within the scope of the present application. In some cases, the acts noted in this application may be performed in a different order and still achieve desirable results. Furthermore, the processes depicted in the accompanying drawings are not necessarily required to be in the particular order shown, or sequential order, to achieve desirable results. In some implementations, multitasking and parallel processing may be advantageous.
Other embodiments of the present description will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This specification is intended to cover any variations, uses, or adaptations of the specification following, in general, the principles of the specification and including such departures from the present disclosure as come within known or customary practice within the art to which the specification pertains. That is, the present specification is not limited to the precise structure that has been described above and shown in the drawings, and various modifications and changes may be made without departing from the scope thereof.
The foregoing description of the preferred embodiments is merely exemplary in nature and is in no way intended to limit the invention, since it is intended that all modifications, equivalents, improvements, etc. that fall within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims (14)

1. A method for determining a resource quota, the method comprising:
acquiring the resource usage amount of a target application in a set time period and a historical resource quota value of the target application;
determining an operation type and an average resource usage amount of the target application based on the resource usage amount of the target application in a set time period, wherein the operation type is used for indicating the resource usage fluctuation condition of the target application;
determining a target parameter based on the average usage amount of the resource and the historical resource quota value, wherein the target parameter is used for indicating to reduce the resource quota value or increase the resource quota value;
and determining a target resource quota value of the target application based on the target parameter and the running type of the target application.
2. The method of claim 1, wherein determining the type of operation of the target application based on the amount of resource usage of the target application over a set period of time comprises:
If the resource usage amount of the target application in the set time period meets the set condition, determining the running type of the target application as a resource stable type;
and if the resource usage amount of the target application in the set time period does not meet the set condition, determining the running type of the target application as a resource fluctuation type.
3. The method of claim 1, wherein the historical resource quota value comprises a historical resource maximum quota value;
the determining a target parameter based on the average usage amount of the resource and the historical resource quota value includes:
and determining the ratio of the average use amount of the resources to the maximum quota value of the historical resources as the target parameter.
4. The method of claim 1, wherein the historical resource quota value comprises a historical resource maximum quota value and a historical resource minimum quota value, and wherein the target resource quota value comprises a target resource maximum quota value and a target resource minimum quota value;
the determining, based on the target parameter and the running type of the target application, a target resource quota value of the target application includes:
determining a target resource maximum quota value based on the operation type, the average use amount of resources, the maximum use amount of resources, the standard deviation of the use amount of resources, the CPU throttling amount and the overflow number of application memories, and determining the target resource minimum quota value based on the minimum use amount of resources and the average use amount of resources, wherein the CPU throttling amount and the overflow number of application memories are data acquired in advance, and the maximum use amount of resources, the minimum use amount of resources and the standard deviation of the use amount of resources are determined based on the use amount of resources of the target application in a set time period;
Determining the target resource maximum quota value based on the average use amount of the resource and the historical resource maximum quota value, and determining the target resource minimum quota value based on the minimum use amount of the resource when the target parameter is smaller than a second parameter threshold;
and under the condition that the target parameter is larger than or equal to a second parameter threshold and smaller than or equal to a first parameter threshold, taking the historical resource maximum quota value as the target resource maximum quota value and taking the historical resource minimum quota value as the target resource minimum quota value.
5. The method of claim 4, wherein the resources comprise CPU resources and memory resources;
the determining the target resource maximum quota value based on the operation type, the average usage amount of the resource, the maximum usage amount of the resource, the standard deviation of the usage amount of the resource, the CPU throttling amount and the application memory overflow times comprises:
when the running type is used for indicating the resource use fluctuation condition of the CPU, determining a target CPU maximum quota value based on the CPU average use amount, the CPU maximum use amount, the CPU use amount standard deviation and the CPU throttling amount;
When the running type is used for indicating the resource use fluctuation condition of the memory, determining the memory overflow condition of the target application based on the application memory overflow times, and determining the maximum quota value of the target memory based on the memory overflow condition, the average memory use amount, the maximum memory use amount and the standard deviation of the memory use amount, wherein the memory overflow condition is used for indicating whether the target application has memory overflow or not.
6. The method of claim 5, wherein when the operation type is used to indicate a resource usage fluctuation condition of the CPU, determining the target CPU maximum quota value based on the CPU average usage amount, the CPU maximum usage amount, the CPU usage standard deviation, and the CPU throttling amount comprises:
under the condition that the operation type is CPU stable, determining a target CPU maximum quota value based on the CPU average usage, the CPU usage standard deviation, the CPU throttling amount and the first set parameter value;
and under the condition that the operation type is a CPU fluctuation type, determining a target CPU maximum quota value based on the CPU maximum usage, the CPU throttling amount, the CPU usage standard deviation, the CPU average usage and the first set parameter value.
7. The method of claim 6, wherein the determining the target memory maximum quota value based on the memory overflow condition, the average memory usage, the maximum memory usage, and the standard deviation of the memory usage comprises:
If the running type is the stable memory, if the memory overflow condition indicates that the target application has memory overflow, determining a maximum quota value of the target memory based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs;
if the running type is the stable memory, if the memory overflow condition indicates that the target application does not overflow the memory, determining a maximum quota value of the target memory based on the average memory usage, the standard deviation of the memory usage and a first set parameter value;
if the running type is a memory fluctuation type, if the memory overflow condition indicates that the target application has memory overflow, determining a maximum quota value of the target memory based on the memory usage amount, the memory average usage amount, the memory usage standard deviation and the first set parameter value when the memory overflow occurs;
and if the running type is a memory fluctuation type and the memory overflow condition indicates that the target application does not overflow, determining a target memory maximum quota value based on the maximum memory usage, the standard deviation of the memory usage, the average memory usage and the first set parameter value.
8. The method of claim 4, wherein the determining the target resource minimum quota value based on the resource minimum usage and the resource average usage comprises:
when the running type is used for indicating the resource use fluctuation condition of the CPU, determining a minimum quota value of the target CPU based on the minimum CPU use amount;
and when the running type is used for indicating the resource use fluctuation condition of the memory, determining the minimum quota value of the target memory based on the average use amount of the memory.
9. The method of claim 4, wherein the determining the target resource maximum quota value based on the average usage of resources and the historical resource maximum quota value if the target parameter is less than a second parameter threshold comprises:
determining an average utilization rate of the resources based on the average utilization amount of the resources and the historical maximum quota value under the condition that the target parameter is smaller than a second parameter threshold;
and determining the target resource maximum quota value based on the average utilization rate of the resources and the historical resource maximum quota value.
10. The method of claim 9, wherein the determining the target resource maximum quota value based on the average usage of resources and the historical resource maximum quota value comprises:
Determining the target resource maximum quota value based on the historical resource maximum quota value and a second set parameter value under the condition that the average resource utilization rate is smaller than a third set threshold value;
determining the target resource maximum quota value based on the historical resource maximum quota value and a third set parameter value under the condition that the average resource utilization rate is larger than or equal to a third set threshold value and smaller than a fourth set threshold value;
and under the condition that the average utilization rate of the resources is larger than or equal to a fourth set threshold value, taking the historical maximum quota value of the resources as the maximum quota value of the target resources.
11. The method according to claim 4, wherein the method further comprises:
and determining the set resource minimum quota value as the target resource minimum quota value of the target application under the condition that the target resource minimum quota value determined based on the target parameter and the running type of the target application is smaller than the set resource minimum quota value.
12. A resource quota determining apparatus, the apparatus comprising:
the acquisition module is used for acquiring the resource usage amount of the target application in a set time period and the historical resource quota value of the target application;
The determining module is used for determining the running type and the average resource usage amount of the target application based on the resource usage amount of the target application in a set time period, wherein the running type is used for indicating that the target application is in a resource usage fluctuation condition;
the determining module is further configured to determine a target parameter based on the average usage amount of the resource and the historical resource quota value, where the target parameter is used to indicate to decrease the resource quota value or increase the resource quota value;
the determining module is further configured to determine a target resource quota value of the target application based on the target parameter and the operation type of the target application.
13. A computing device comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, wherein the processor implements operations performed by the resource quota determination method of any one of claims 1 to 11 when the program is executed by the processor.
14. A computer-readable storage medium having stored thereon a program that is executed by a processor to perform the operations performed by the resource quota determination method of any one of claims 1 to 11.
CN202210883725.4A 2022-07-26 2022-07-26 Resource quota determination method, device, computing equipment and medium Pending CN117519956A (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN202210883725.4A CN117519956A (en) 2022-07-26 2022-07-26 Resource quota determination method, device, computing equipment and medium
JP2022160735A JP7214287B1 (en) 2022-07-26 2022-10-05 Resource allocation determination method, device, computing device and computer program

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210883725.4A CN117519956A (en) 2022-07-26 2022-07-26 Resource quota determination method, device, computing equipment and medium

Publications (1)

Publication Number Publication Date
CN117519956A true CN117519956A (en) 2024-02-06

Family

ID=85078904

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210883725.4A Pending CN117519956A (en) 2022-07-26 2022-07-26 Resource quota determination method, device, computing equipment and medium

Country Status (2)

Country Link
JP (1) JP7214287B1 (en)
CN (1) CN117519956A (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN116382924B (en) * 2023-06-02 2023-08-15 建信金融科技有限责任公司 Recommendation method and device for resource allocation, electronic equipment and storage medium

Family Cites Families (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP4935626B2 (en) * 2007-10-30 2012-05-23 富士通株式会社 Control program and method, and computer
JP2013225204A (en) * 2012-04-20 2013-10-31 Fujitsu Frontech Ltd Load distribution method and device which automatically optimize number of operation servers based on traffic volume prediction
US11113612B2 (en) * 2016-12-26 2021-09-07 Morgan Stanley Services Group Inc. Predictive asset optimization for computer resources
JP6940761B2 (en) * 2017-09-01 2021-09-29 富士通株式会社 Information processing equipment, virtual machine monitoring programs, and information processing systems
JP2020181292A (en) * 2019-04-24 2020-11-05 アズビル株式会社 Arithmetic processing device and scaling condition calculation method

Also Published As

Publication number Publication date
JP7214287B1 (en) 2023-01-30
JP2024016782A (en) 2024-02-07

Similar Documents

Publication Publication Date Title
EP3419247B1 (en) Method and device for storage resource allocation for video cloud storage
CN109936511B (en) Token obtaining method, device, server, terminal equipment and medium
US9552230B2 (en) Apparatus and method for allocating a task based on measured and estimated core usage
CN108173698B (en) Network service management method, device, server and storage medium
CN109451002B (en) CDN node selection method and equipment
CN111367651B (en) Service current limiting system, method and device and electronic equipment
CN110858843B (en) Service request processing method and device and computer readable storage medium
CN106713028B (en) Service degradation method and device and distributed task scheduling system
US20140040895A1 (en) Electronic device and method for allocating resources for virtual machines
CN111447577B (en) Quota management method and device
CN111490947A (en) Data packet transmitting method, data packet receiving method, system, device and medium
CN110636388A (en) Service request distribution method, system, electronic equipment and storage medium
CN117519956A (en) Resource quota determination method, device, computing equipment and medium
CN111562884B (en) Data storage method and device and electronic equipment
US9946640B2 (en) Method and apparatus for securing sufficient memory in a device
CN114143327A (en) Cluster resource quota allocation method and device and electronic equipment
CN106850822B (en) Load balancing method, equipment and distributed system
CN111359205B (en) Operation method and device of cloud game, computer equipment and storage medium
CN110837421B (en) Task allocation method and device
CN112669091B (en) Data processing method, device and storage medium
CN114490374A (en) Applied pressure test method, electronic device, storage medium, and program product
CN111181875A (en) Bandwidth adjusting method and device
KR101719724B1 (en) Resource management system and method, and method for deciding resource price by the same system
CN112181577A (en) Display control system, method and device
CN108257077B (en) GPU-based clustering data processing method and system and computing device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination