An information processing method, apparatus, device, and storage medium
By using multiple load indicators to determine the load utilization rate and adjust application instances, the method enhances the accuracy of instance management, reducing resource wastage and improving system stability.
Patent Information
- Application Number
- CN202111020858.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2021-09-01
- Publication Date
- 2025-07-15
- Estimated Expiration
- 2041-09-01
AI Technical Summary
In the prior art, the accuracy of the adjustment of the number of application instances is not high based on a single load indicator, resulting in unreasonable resource allocation.
By comprehensively considering at least two load indicators of the target application, determining its load utilization rate, and determining whether the number of instances needs to be adjusted based on the load utilization rate and reference threshold, the ARIMA model is used to predict load utilization rate changes to reduce scaling jitter.
Improve the accuracy of judging the number of application instances, reduce resource waste and scaling jitter, and optimize resource allocation.
Smart Images

Figure CN113687952B_ABST
Abstract
Description
Technical Field
[0001] This application relates to the field of information processing, and relates to, but is not limited to, an information processing method, apparatus, device, and storage medium. Background Art
[0002] In the related art, when determining whether to adjust the number of instances of an application, only one metric of the application, for example, the memory usage rate, is used to determine whether to adjust the number of instances of the application. In this way, the problem of low accuracy in determining whether to adjust the number of instances of the application is caused. Summary of the Invention
[0003] This application provides an information processing method, apparatus, device, and storage medium to solve at least one problem in the related art, and can improve the accuracy of determining whether to adjust the number of instances of an application.
[0004] The technical solution of this application is implemented as follows:
[0005] In a first aspect, an embodiment of this application provides an information processing method, and the method includes:
[0006] Determine the load utilization rate of the target application according to at least two load metrics of the target application;
[0007] Determine a first number of instances of the target application according to the load utilization rate; the first number is the desired number of instances of the target application; the instance is a running copy of the target application;
[0008] Adjust the second number according to a first relationship between the first number and the second number; the second number is the number of instances running the target application.
[0009] In a second aspect, an embodiment of this application provides an information processing apparatus, and the apparatus includes:
[0010] A first determination unit, configured to determine the load utilization rate of the target application according to at least two load metrics of the target application;
[0011] A second determination unit, configured to determine a first number of instances of the target application according to the load utilization rate; the first number is the desired number of instances of the target application; the instance is a running copy of the target application;
[0012] An adjustment unit, configured to adjust the second number according to a first relationship between the first number and the second number; the second number is the number of instances running the target application.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor. When the processor executes the computer program, the above information processing method is implemented.
[0014] In a fourth aspect, an embodiment of the present application provides a storage medium, on which a computer program is stored. When the computer program is executed by a processor, the above information processing method is implemented.
[0015] The present application provides an information processing method, device, equipment, and storage medium. According to at least two load metrics of a target application, the load utilization rate of the target application is determined; according to the load utilization rate, the first quantity of instances of the target application is determined; the first quantity is the desired quantity of instances of the target application; the instance is a running copy of the target application; according to the first relationship between the first quantity and the second quantity, the second quantity is adjusted; the second quantity is the quantity of instances running the target application. In this way, it is possible to determine whether it is necessary to adjust the quantity of instances running the target application according to at least two load metrics of the target application, thereby improving the accuracy of determining whether it is necessary to adjust the quantity of instances running the target application. Description of the Drawings
[0016] Figure 1 It is an optional structural schematic diagram of an information processing system provided by an embodiment of the present application;
[0017] Figure 2 It is an optional flowchart of the information processing method provided by an embodiment of the present application;
[0018] Figure 3 It is an optional flowchart of the information processing method provided by an embodiment of the present application;
[0019] Figure 4 It is an optional flowchart of the information processing method provided by an embodiment of the present application;
[0020] Figure 5 It is an optional flowchart of the information processing method provided by an embodiment of the present application;
[0021] Figure 6 It is an optional structural schematic diagram of the information processing device provided by an embodiment of the present application;
[0022] Figure 7 It is an optional structural schematic diagram of the electronic device provided by an embodiment of the present application. Detailed Embodiments
[0023] To make the objectives, technical solutions, and advantages of the embodiments of this application clearer, the following will further describe the specific technical solutions of the application in detail with reference to the accompanying drawings in the embodiments of this application. The following embodiments are used to illustrate this application but are not intended to limit the scope of this application.
[0024] Unless otherwise defined, all technical and scientific terms used herein have the same meaning as commonly understood by those of ordinary skill in the technical field to which this application belongs. The terms used in the specification of this application are only for the purpose of describing specific embodiments and are not intended to limit this application. The term "and / or" used herein includes any and all combinations of one or more of the related listed items.
[0025] Before further elaborating on this application, the nouns and terms involved in the embodiments of this application are explained. The nouns and terms involved in the embodiments of this application are applicable to the following explanations.
[0026] 1), Load, which is used to characterize computer resources. Computer resources may include: Central Processing Unit (CPU) resources, memory resources, network resources, etc.
[0027] 2), Load metric, which is used to characterize the usage of computer resources when an application is running. For example, when the computer resource is the CPU, the load metric may include: CPU utilization rate and CPU context switch rate; when the computer resource is memory resources, the load metric may include: Memory (MEN) usage rate; when the computer resource is network resources, the load metric may include: Input Output (IO) response time, IO usage rate, IO operation service time, network rate, network throughput, and network bandwidth.
[0028] Here, the CPU utilization rate is used to characterize the usage of CPU resources when an application is running, the CPU context switch rate is used to characterize the rate at which the CPU switches from one task to another, and the memory usage rate is used to characterize the memory resources occupied by the running application.
[0029] 3), Load utilization rate, which is used to characterize the ratio of the computer resources consumed by an application during operation to the corresponding computer resources.
[0030] The information processing method provided by the embodiments of this application can be applied to an information processing system, and the information processing system may include an information processing device.
[0031] In one example, the structure of the information processing device 100 may be as Figure 1As shown, the information processing device 100 may include: a target application 101 and an instance 102. Among them, the instance 102 is used to represent a running copy of the target application 101.
[0032] In the embodiments of the present application, the number of instances may be Figure 1 the three instances shown, or other numbers of instances. The embodiments of the present application do not impose any limitations on the number of instances.
[0033] In the embodiments of the present application, based on Figure 1 the information processing device shown, the information processing device determines the load utilization rate of the target application according to at least two load metrics of the target application; determines a first number of instances of the target application according to the load utilization rate; the first number is the desired number of instances of the target application; the instance is a running copy of the target application; adjusts the second number according to a first relationship between the first number and the second number; the second number is the number of instances on which the target application runs.
[0034] Next, in combination with Figure 1 the schematic diagram of the information processing device 100 shown, each embodiment of the information processing method, device, device, and storage medium provided by the embodiments of the present application will be described.
[0035] Figure 2 Schematically shows a flowchart of an optional information processing method. The information processing method provided by the embodiments of the present application is used to adjust the number of instances of an application; among them, the processing procedures for adjusting the number of instances of each application are similar. Now, taking the target application (any application) as an example, the adjustment of the number of instances of the application will be described in detail.
[0036] The information processing method provided by the embodiments of the present application can be applied to an information processing device, such as Figure 2 shown, and the method may include the following steps:
[0037] S201. Determine the load utilization rate of the target application according to at least two load metrics of the target application.
[0038] Here, the target application includes any one of multiple applications managed by a Pod. Among them, a Pod is the smallest management unit for managing applications in an application management platform, and the application management platform may be an open-source platform, such as the Kubernetes (abbreviated as K8s) platform or the Serverless computing platform.
[0039] In an embodiment of the present application, after determining the target application, the information processing device can determine the usage conditions of at least two computer resources (i.e., at least two load metrics) when the target application is running, and then determine the ratio of the computer resources consumed by the target application during operation to the corresponding computer resources (i.e., the load utilization rate of the target application) according to the at least two load metrics.
[0040] Here, the load metrics may include: CPU utilization rate, memory usage rate, and IO usage rate.
[0041] After determining the target application, the information processing device can determine the CPU utilization rate, memory usage rate, and IO usage rate when the target application is running, and then determine the ratio of the computer resources consumed by the target application during operation to the corresponding computer resources according to the CPU utilization rate, memory usage rate, and IO usage rate.
[0042] Here, for each of the at least two load metrics, the information processing device can determine the average utilization rate of the load metric over a period of time, and determine the load utilization rate of the target application according to the average utilization rate of the load metric over a period of time. The value of the period of time can be 1 hour or other values, and the embodiments of the present application do not limit this.
[0043] In an example, the load metrics include: CPU utilization rate, memory usage rate, and IO usage rate, and the period of time is 1 hour. The information processing device determines that the average utilization rate of the CPU utilization rate within 1 hour is P1, determines that the average utilization rate of the memory usage rate within 1 hour is P2, and determines that the average utilization rate of the IO usage rate within 1 hour is P3. Then, the load utilization rate of the target application can be determined according to P1, P2, and P3.
[0044] S202. Determine a first quantity of instances of the target application according to the load utilization rate.
[0045] Here, an instance is used to represent a running copy of the target application.
[0046] In an example, the target application is an instant messaging software, and the copies of the instant messaging software are the copies corresponding to one or two different accounts of the instant messaging software running on the information processing device.
[0047] The first quantity is the desired number of instances of the target application.
[0048] In an example, if the desired number of instances of the target application is 10, then the first quantity is 10 at this time.
[0049] S203. Adjust the second quantity according to a first relationship between the first quantity and the second quantity.
[0050] Here, the second quantity is the number of instances in which the target application runs.
[0051] In one example, if the number of instances in which the target application runs is 3, then the second quantity is 3 at this time.
[0052] The first relationship between the first quantity and the second quantity may include: the first quantity is greater than the second quantity, or, the first quantity is less than the second quantity, or, the first quantity is equal to the second quantity.
[0053] If the first quantity is greater than the second quantity, it means that the number of instances of the target application expected is greater than the number of instances currently running. Since the number of expected instances is more than the number of running instances, therefore, the number of instances currently running, that is, the second quantity, can be increased, so that the number of instances currently running can be increased to the number of expected instances, that is, the first quantity.
[0054] If the first quantity is less than the second quantity, it means that the number of instances of the target application expected is less than the number of instances currently running. Since the number of expected instances is less than the number of running instances, therefore, the number of instances currently running, that is, the second quantity, can be decreased, so that the number of instances currently running can be decreased to the number of expected instances, that is, the first quantity.
[0055] If the first quantity is equal to the second quantity, it means that the number of instances of the target application expected is equal to the number of instances currently running. Since the number of expected instances is equal to the number of running instances, therefore, the number of instances currently running can be not changed.
[0056] The embodiments of the present application provide an information processing method, which determines the load utilization rate of a target application according to at least two load metrics of the target application; determines a first quantity of instances of the target application according to the load utilization rate; the first quantity is the number of instances of the target application expected; the instance is a running copy of the target application; adjusts the second quantity according to the first relationship between the first quantity and the second quantity; the second quantity is the number of instances in which the target application runs. In this way, it is possible to determine whether it is necessary to adjust the number of instances in which the target application runs according to at least two load metrics of the target application, so as to improve the accuracy of determining whether it is necessary to adjust the number of instances in which the target application runs.
[0057] In the embodiments of the present application, the above S202 may include: determining a first quantity of instances of the target application according to the load utilization rate, the second quantity, and a reference threshold.
[0058] The first quantity of instances of the target application can be determined by the following formula (1).
[0059]
[0060] Where load is the load utilization rate, TU is the reference threshold, CR is the second quantity, and ceil is the ceiling function.
[0061] Here, the reference threshold is a set standard value, and the magnitude relationship between the load utilization rate and the reference threshold can be determined according to the ratio of the load utilization rate load to the reference threshold TU If the ratio of the load utilization rate load to the standard threshold TU is equal to 1, it means that the load utilization rate load is equal to the reference threshold TU, and at this time, there is no need to adjust the number of instances of the target application; if the ratio of the load utilization rate load to the standard threshold TU is greater than 1, it means that the load utilization rate load is greater than the reference threshold TU, and at this time, the number of instances of the target application needs to be increased; if the ratio of the load utilization rate load to the standard threshold TU is less than 1, it means that the load utilization rate load is less than the reference threshold TU, and at this time, the number of instances of the target application needs to be decreased.
[0062] In the embodiments of the present application, the reference threshold can be 5 or other values, and the embodiments of the present application do not make any limitations thereto.
[0063] In the embodiments of the present application, if the determined first quantity is greater than the maximum quantity max of the instances of the target application set, the first quantity is determined as max; if the determined first quantity is less than the minimum quantity min of the instances of the target application set, the first quantity is determined as min.
[0064] In an example, the first quantity is 10, and the maximum quantity max of the instances of the target application set is 8. At this time, since the first quantity 10 is greater than max 8, the first quantity is determined as 8.
[0065] In some embodiments, as Figure 3 shown, the method further includes:
[0066] S301. Determine the target weight corresponding to each of the at least two load metrics.
[0067] Here, each of the at least two load metrics can be determined by the monitoring component MetricsServer in the K8s platform.
[0068] In one example, through the monitoring component MetricsServer, the determined CPU utilization rate is 60%, the memory usage rate is 50%, and the IO usage rate is 40%.
[0069] The information processing device may receive the reference target weight corresponding to each of at least two load metrics input by the user, and determine the received reference target weight as the target weight.
[0070] Here, for the specific value of the reference target weight, the embodiments of the present application do not make any limitation thereto.
[0071] In practical applications, the target weights corresponding to each of the at least two load metrics may be the same or different, and the embodiments of the present application do not make any limitation thereto.
[0072] In the embodiments of the present application, after determining the target weight corresponding to each of the at least two load metrics, S201 above includes:
[0073] S302. Determine the load utilization rate of the target application according to the at least two load metrics and the determined target weights.
[0074] In one example, the at least two load metrics include: CPU utilization rate 60%, memory usage rate 50%, and IO usage rate 40%, and the target weights corresponding to the at least two load metrics include: the target weight corresponding to the CPU utilization rate is 0.5, the target weight corresponding to the memory usage rate is 0.3, and the target weight corresponding to the IO usage rate is 0.2. Then, according to 60 * 0.5 + 50 * 0.4 + 40 * 0.3, the determined load utilization rate of the target application is 62%.
[0075] In some embodiments, the method further includes: determining the type of the target application.
[0076] Here, the type of the target application may include: computing type, memory type, network type, Integrated Development and Learning Environment (Idle) type, and composite type.
[0077] For different types of target applications, each type of target application corresponds to a typical load metric, and the typical load metric is any one of the at least two load metrics, and the typical load metric is the load metric that the target application consumes the most during operation.
[0078] In one example, for a computing application, the typical load metric corresponding to the computing application is the CPU utilization rate.
[0079] In another example, for memory-based applications, the typical load metric corresponding to the memory-based application is the memory usage rate.
[0080] In yet another example, for network-based applications, the typical load metric corresponding to the network-based application is the network throughput.
[0081] In the embodiments of the present application, compared with the weights corresponding to other load metrics, the weight corresponding to the typical load metric may be greater than the weights corresponding to other load metrics, may be smaller than the weights corresponding to other load metrics, or may be equal to the weights corresponding to other load metrics. The embodiments of the present application do not make any limitation in this regard.
[0082] In one example, for a compute-based application, the typical load metric corresponding to the compute-based application is the CPU utilization rate. In the weight set corresponding to the compute-based application, the weight corresponding to the CPU utilization rate is 0.6, which is greater than the weight of 0.3 corresponding to the memory usage rate and the weight of 0.1 corresponding to the IO usage rate.
[0083] In the embodiments of the present application, one type of target application corresponds to one weight set, where the weight set includes: the weights corresponding to each of at least two load metrics.
[0084] In one example, when the at least two load metrics include: CPU utilization rate, memory usage rate, and IO usage rate, for a compute-based application, the weight corresponding to the CPU utilization rate is 0.6, the weight corresponding to the memory usage rate is 0.3, and the weight corresponding to the IO usage rate is 0.1; for a memory-based application, the weight corresponding to the CPU utilization rate is 0.3, the weight corresponding to the memory usage rate is 0.6, and the weight corresponding to the IO usage rate is 0.1.
[0085] In the embodiments of the present application, for the weight sets corresponding to different types, the weights corresponding to the load metrics included in the weight sets may be the same or different. The embodiments of the present application do not make any limitation in this regard.
[0086] In one example, for the weight set corresponding to a compute-based application and the weight set corresponding to a memory-based application, in the case where the load metric includes the IO usage rate, in the two weight sets, the weights corresponding to the IO usage rate may be the same. For example, the IO usage rates of both are 0.1. In the two weight sets, the weights corresponding to the IO usage rate may be different. For example, the IO usage rate of the compute-based application is 0.2, and the IO usage rate of the memory-based application is 0.1.
[0087] After determining the type of the target application, determining the weight corresponding to each of the at least two load metrics includes: according to the type, determining the weight set corresponding to the type in at least one weight set as the target weight set.
[0088] Here, the weight set includes: the weight corresponding to each of the at least two load metrics; the target weight set includes: the target weight corresponding to each of the at least two load metrics.
[0089] In one example, the weight set can be expressed as: [the weight corresponding to CPU utilization rate, the weight corresponding to memory usage rate, the weight corresponding to IO usage rate]; weight set 1: [0.6, 0.3, 0.1], weight set 2: [0.3, 0.6, 0.1], where the type corresponding to weight set 1 is a computing application, and the type corresponding to weight set 2 is a memory application. If the determined type of the target application is a computing application, the information processing device can, according to the computing application, determine the weight set 1 corresponding to the computing application in weight set 1 and weight set 2 as the target weight set.
[0090] In some embodiments, as Figure 4 shown, determining the type of the target application includes:
[0091] S401. Determine the load metric threshold corresponding to each of the at least two load metrics.
[0092] In one example, the at least two load metrics include: CPU utilization rate, memory usage rate, and IO usage rate. Among them, for the CPU utilization rate, the CPU utilization rate threshold corresponding to the CPU utilization rate can be 40%, for the memory usage rate, the memory usage rate threshold corresponding to the memory usage rate can be 60%, and for the IO usage rate, the IO usage rate threshold corresponding to the IO usage rate can be 60%.
[0093] S402. Determine at least two second relationships between the at least two load metrics and the determined load metric thresholds.
[0094] Here, each of the at least two second relationships characterizes the relationship between each of the at least two load metrics and the load metric threshold corresponding to the load metric.
[0095] In one example, when at least two load metrics include: CPU utilization rate of 60%, memory usage rate of 40%, and IO usage rate of 40%, the CPU utilization rate threshold is 40%, the memory usage rate threshold is 60%, and the IO usage rate threshold is 60%. In this way, for the CPU utilization rate, based on the CPU utilization rate of 60% and the CPU utilization rate threshold of 40%, it can be determined that the relationship between the CPU utilization rate and the CPU utilization rate threshold is that the CPU utilization rate is greater than the CPU utilization rate threshold; for the memory usage rate, based on the memory usage rate of 40% and the memory usage rate threshold of 60%, it can be determined that the relationship between the memory usage rate and the memory usage rate threshold is that the memory usage rate is less than the memory usage rate threshold; for the IO usage rate, based on the IO usage rate of 40% and the IO usage rate threshold of 60%, it can be determined that the relationship between the IO usage rate and the IO usage rate threshold is that the IO usage rate is less than the IO usage rate threshold.
[0096] S403. Among the at least two second relationships, determine the second relationship in which the at least two load metrics are greater than the determined load metric thresholds as the target second relationship.
[0097] In one example, the at least two second relationships include: the CPU utilization rate is greater than the CPU utilization rate threshold, the memory usage rate is less than the memory usage rate threshold, and the IO usage rate is less than the IO usage rate threshold. Among them, since the CPU utilization rate is greater than the CPU utilization rate threshold, the second relationship in which the CPU utilization rate is greater than the CPU utilization rate threshold can be determined as the target second relationship.
[0098] S404. Determine the type of the target application according to the load metrics in the target second relationship.
[0099] Here, after determining the load metrics in the target second relationship, the load metrics in the target second relationship can be determined as typical load metrics, and then according to the typical load metrics, determine the type of the target application corresponding to the typical load metrics.
[0100] In one example, if the target second relationship is that the CPU utilization rate is greater than the CPU utilization rate threshold, then it can be determined that the CPU utilization rate is a typical load metric, and then according to the typical load metric, determine that the type of the target application corresponding to the typical load metric is a computing application.
[0101] In the embodiments of the present application, for Idle type applications, since Idle type applications do not correspond to a typical load metric, in the case where the load metrics are all less than the load metric thresholds corresponding to the load metrics, the type of the target application can be determined as the Idle type.
[0102] For a composite application, since a composite application is a combination of a compute application and a memory application, the type of a target application with a CPU utilization rate greater than 40% and a memory usage rate greater than 60% can be determined as a composite type.
[0103] In some embodiments, as Figure 5 shown, the above S202 includes:
[0104] S501. Determine whether the load utilization rate and the load value meet the set conditions.
[0105] Here, the set conditions include: the load utilization rate and the load value are greater than the expansion threshold, or the load utilization rate and the load value are less than the reduction threshold.
[0106] The expansion threshold is used to indicate that the target application can start to be expanded only when both the load utilization rate and the load value are greater than the expansion threshold; the reduction threshold is used to indicate that the target application can start to be reduced only when both the load utilization rate and the load value are less than the reduction threshold.
[0107] Here, expanding the target application means increasing the number of instances of the target application, and reducing the target application means decreasing the number of instances of the target application.
[0108] In the embodiments of the present application, the expansion threshold up can be calculated by the following formula (2).
[0109] up = TU * (1 + tolerance) Formula (2);
[0110] Wherein, TU is a reference threshold, and tolerance is a constant.
[0111] In the embodiments of the present application, tolerance can be 0.1 or other values, and the embodiments of the present application do not make any limitation thereto.
[0112] The reduction threshold down can be calculated by the following formula (3).
[0113] down = TU * (1 - tolerance) Formula (3).
[0114] In the embodiments of the present application, since the expansion threshold indicates that the target application can be expanded only when the expansion threshold is reached, and the reduction threshold indicates that the reduction threshold can be reduced only when the reduction threshold is reached, therefore, in order to make the expansion threshold and the reduction threshold different, when calculating the expansion threshold, multiply by (1 + tolerance) on the basis of the reference threshold TU, and when calculating the reduction threshold, multiply by (1 - tolerance) on the basis of the reference threshold TU.
[0115] S502. If the load utilization rate and the load value meet the set conditions, determine a first quantity of instances of the target application according to the load utilization rate.
[0116] Here, if the set condition is that the load utilization rate and the load value are greater than the expansion threshold, it means that the target application can be expanded. Determine the quantity of instances of the target application expected after expanding the target application according to the load utilization rate.
[0117] In an example, the load utilization rate is 60%, the load value is 70%, and the expansion threshold is 50%. Since both the load utilization rate of 60% and the load value of 70% are greater than the expansion threshold of 50%, therefore, the first quantity of instances of the target application expected after expansion can be determined according to the load utilization rate of 60%.
[0118] If the set condition is that the load utilization rate and the load value are less than the reduction threshold, it means that the target application can be reduced. Determine the quantity of instances of the target application expected after reducing the target application according to the load utilization rate.
[0119] In an example, the load utilization rate is 60%, the load value is 70%, and the reduction threshold is 80%. Since both the load utilization rate of 60% and the load value of 70% are less than the reduction threshold of 80%, therefore, the first quantity of instances of the target application expected after expansion can be determined according to the load utilization rate of 60%.
[0120] In some embodiments, the method further includes: inputting the load utilization rate into a set model to obtain the load value; the set model is used to perform a smoothing process on the load utilization rate.
[0121] Here, the set model may include: an Autoregressive Integrated Moving Average Model (ARIMA).
[0122] In the embodiments of the present application, when the load utilization rate changes suddenly, for example, when the CPU utilization rate increases and then quickly decreases, for the case where the load utilization rate increases, the target application should be expanded at this time. However, for the case where the CPU utilization rate increases and then quickly decreases, the target application should be expanded and then reduced after expansion. In this way, it is easy to cause problems of scaling jitter and resource waste. To avoid the above two problems, the present application inputs the load utilization rate into the set model to adjust the suddenly changed load utilization rate to a stable load utilization rate. In this way, the problems of scaling jitter and resource waste can be avoided.
[0123] With the development of cloud-native technologies, the technical features of Serverless, such as operation and maintenance automation, on-demand loading, elastic scaling, strong isolation, and agile development and deployment, bring core advantages such as reducing labor costs, reducing risks, reducing infrastructure costs, and reducing delivery time. Among these, elastic scaling is a major highlight that has received extensive attention in Serverless. Some even regard the ability to support automatic scaling as the criterion for determining whether an application is Serverless.
[0124] The issues that elastic scaling focuses on are mainly the contradiction between capacity planning and the actual cluster load. When the resources of the existing cluster cannot bear the traffic pressure, if the scale of the cluster or the resource allocation is adjusted to ensure the stability of the system. Similarly, when the cluster load is low, the resource configuration of the cluster is minimized to reduce the cost overhead caused by the waste of idle resources.
[0125] Currently, most open-source components and solutions implement automatic scaling based on the elastic scaling components of Kubernetes. Kubernetes provides a series of standard elastic scaling components, which can be divided into two scaling methods: horizontal scaling and vertical scaling in terms of direction, and scaling by Pod and scaling by node in terms of object.
[0126] When performing elastic scaling on an application using the scaling policy based on a single load metric threshold provided by Kubernetes, users need to set the resource allocation Request of the Pod when defining the Pod of the application, and pre-determine the metric for measuring the load, and set parameters such as the scaling threshold, the maximum number of replicas, and the minimum number of replicas. By default, the workflow of this elastic scaling policy performs a load check every 30s.
[0127] When the Kubernetes automatic scaling policy based on a single load metric threshold obtains the application load, if the load value of the application is temporary and quickly decreases, and if it does not fall below the scaling-down threshold, the increase in Pod resources causes waste of system resources. If it falls below the scaling-down threshold, scaling-down is immediately triggered, resulting in scaling jitter. Frequent scaling consumes the system and imposes a heavy burden on the system.
[0128] This solution proposes an information processing method. When scaling the target application, this method calculates by comprehensively considering different current load metrics of the target application to obtain the type of the application, and then outputs the typical load metrics of this type. To reduce scaling jitter, this method uses ARIMA to predict the change of the load utilization rate of the target application, and finally jointly determines whether to trigger scaling based on the application load utilization rate and the load value. Scaling is either scaling up or scaling down the target application.
[0129] In this application, applications are classified into different types according to different load metrics, including a total of 5 types: computing type, memory type, network type, Idle type, and composite type.
[0130] The specific workflow for determining the type of the target application is as follows:
[0131] Step 1: Extract the computer resources consumed by the application.
[0132] Here, various computer resources consumed by the application can be collected and summarized through the Kubernetes platform monitoring component MetricsServer.
[0133] Step 2: Determine the load metrics corresponding to the hardware resources according to the extracted hardware resources.
[0134] Here, the average utilization rate of the computer resources can be determined as the load metrics corresponding to the hardware resources.
[0135] Step 3: Determine the type of the application according to the load metrics and the load metric thresholds.
[0136] In an example, if the CPU utilization rate of the target application is greater than 40%, it is of the computing type, and if the memory usage rate is greater than 60%, it is of the memory type.
[0137] In the embodiments of this application, the specific steps for determining whether to scale up or scale down the target application are as follows:
[0138] Step 1: Determine the load utilization rate load according to each load metric and the weight corresponding to the load metric.
[0139] Step 2: Input the load utilization rate load into the ARIMA algorithm to calculate the load value pre of the target application.
[0140] Step 3: Calculate the scale-up threshold up and the scale-down threshold down of the target application.
[0141] Step 4: Determine whether both the load utilization rate load and the load value pre are greater than the scale-up threshold up. If both are greater than the scale-up threshold up, go to Step 6; otherwise, go to Step 5.
[0142] Step 5: Determine whether both the load utilization rate load and the load value pre are less than the scale-down threshold down. If both are less than the scale-down threshold down, go to Step 6.
[0143] Step 6: Calculate the first number of instances of the target application.
[0144] Here, for the explanation of Step 6, please specifically refer to the explanation in the above embodiments, which will not be elaborated here.
[0145] Figure 6 An information processing device provided by an embodiment of the present application, as Figure 6 shown, the information processing device 600 includes:
[0146] A first determination unit 601, configured to determine the load utilization rate of the target application according to at least two load metrics of the target application;
[0147] A second determination unit 602, configured to determine a first quantity of instances of the target application according to the load utilization rate; the first quantity is the desired quantity of instances of the target application; the instance is a running copy of the target application;
[0148] An adjustment unit 603, configured to adjust the second quantity according to a first relationship between the first quantity and the second quantity; the second quantity is the quantity of instances on which the target application runs.
[0149] In some embodiments, the device further includes: a third determination unit, configured to determine a target weight corresponding to each of the at least two load metrics;
[0150] The first determination unit 601 is further configured to determine the load utilization rate of the target application according to the at least two load metrics and the determined target weights.
[0151] In some embodiments, the third determination unit is further configured to determine the type of the target application;
[0152] The third determination unit is further configured to:
[0153] According to the type, determine the weight set corresponding to the type in at least one weight set as the target weight set; the weight set includes: the weight corresponding to each of the at least two load metrics; the target weight set includes: the target weight corresponding to each of the at least two load metrics.
[0154] In some embodiments, the third determination unit is further configured to:
[0155] Determine a load metric threshold corresponding to each of the at least two load metrics;
[0156] Determine at least two second relationships between the at least two load metrics and the determined load metric thresholds;
[0157] Determine, among the at least two second relationships, the second relationships in which the at least two load metrics are greater than the determined load metric thresholds as the target second relationships;
[0158] Determine the type of the target application according to the load index in the target second relationship.
[0159] In some embodiments, the second determination unit 602 is further configured to:
[0160] Judge whether the load utilization rate and the load value meet the set conditions; the set conditions include: the load utilization rate and the load value are greater than the expansion threshold, or the load utilization rate and the load value are less than the shrinkage threshold;
[0161] If the load utilization rate and the load value meet the set conditions, determine the first quantity of the instances of the target application according to the load utilization rate.
[0162] In some embodiments, the apparatus further includes: a fourth determination unit, configured to input the load utilization rate into a set model to obtain the load value; the set model is used to perform a smoothing process on the load utilization rate.
[0163] In some embodiments, the adjustment unit 603 is further configured to:
[0164] If the first quantity is greater than the second quantity, increase the second quantity;
[0165] If the first quantity is less than the second quantity, decrease the second quantity.
[0166] An embodiment of the present application further provides an electronic device, including a memory and a processor, where the memory stores a computer program that can run on the processor, and the processor implements the information processing method provided in the above embodiment when executing the program.
[0167] An embodiment of the present application further provides a storage medium, that is, a computer-readable storage medium, on which a computer program is stored, and the computer program implements the information processing method provided in the above embodiment when executed by a processor.
[0168] It should be noted here that: the descriptions of the above storage medium and device embodiments are similar to the descriptions of the above method embodiments, and have beneficial effects similar to those of the method embodiments. For the technical details not disclosed in the storage medium and device embodiments of the present application, please refer to the descriptions of the method embodiments of the present application for understanding.
[0169] It should be noted that Figure 7 is a schematic diagram of a hardware entity of the electronic device according to an embodiment of the present application, as Figure 7As shown, the electronic device includes: a processor 701, at least one communication bus 702, at least one external communication interface 704, and a memory 705. Among them, the communication bus 702 is configured to enable connection communication between these components. In one example, the electronic device 700 further includes: a user interface 703, where the user interface 703 may include a display screen, and the external communication interface 704 may include a standard wired interface and a wireless interface.
[0170] The memory 705 is configured to store instructions and applications executable by the processor 701, and can also cache data to be processed or already processed by the processor 701 and each module in the electronic device (for example, image data, audio data, voice communication data, and video communication data), and can be implemented by flash memory (FLASH) or random access memory (Random Access Memory, RAM).
[0171] It should be understood that the "one embodiment" or "an embodiment" mentioned throughout the specification means that the specific features, structures, or characteristics related to the embodiment are included in at least one embodiment of the present application. Therefore, the "in one embodiment" or "in some embodiments" that appear throughout the specification do not necessarily refer to the same embodiment. In addition, these specific features, structures, or characteristics can be combined in one or more embodiments in any suitable manner. It should be understood that in various embodiments of the present application, the order numbers of the above processes do not mean the order of execution. The execution order of each process should be determined by its function and internal logic, and should not constitute any limitation to the implementation process of the embodiments of the present application. The serial numbers of the embodiments of the present application are only for description and do not represent the advantages or disadvantages of the embodiments.
[0172] It should be noted that in this article, the term "comprising", "including" or any other variant thereof is intended to cover a non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or further includes elements inherent to such process, method, article or device. Without further limitation, the element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0173] In several embodiments provided in this application, it should be understood that the disclosed devices and methods can be implemented in other ways. The device embodiments described above are merely illustrative. For example, the division of the units is only a logical function division. In actual implementation, there may be other division methods. For example, multiple units or components can be combined, or can be integrated into another system, or some features can be ignored or not executed. In addition, the couplings, direct couplings, or communication connections between the components shown or discussed can be through some interfaces. The indirect couplings or communication connections of devices or units can be electrical, mechanical, or other forms.
[0174] The units described above as separate components may or may not be physically separated. The components shown as units may or may not be physical units. They can be located in one place or distributed to multiple network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of this embodiment.
[0175] In addition, each functional unit in the embodiments of this application can be all integrated in a processing unit, or each unit can be separately used as a unit, or two or more units can be integrated in a unit. The above integrated units can be implemented in the form of hardware, or in the form of hardware plus software functional units.
[0176] Those of ordinary skill in the art can understand that all or part of the steps to implement the above method embodiments can be completed by hardware related to program instructions. The foregoing program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above method embodiments. The foregoing storage medium includes various media that can store program codes, such as removable storage devices, read-only memory (ROM), magnetic disks, or optical discs.
[0177] Alternatively, if the above integrated units of this application are implemented in the form of software functional modules and sold or used as independent products, they can also be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the embodiments of this application essentially or the part that contributes to the related technology can be embodied in the form of a software product. The computer software product is stored in a storage medium and includes several instructions to enable a computer device (which can be a personal computer, a server, or a network device, etc.) to execute all or part of the methods described in the embodiments of this application. The foregoing storage medium includes various media that can store program codes, such as removable storage devices, ROM, magnetic disks, or optical discs.
[0178] As described above, it is only the implementation mode of this application, but the protection scope of this application is not limited thereto. Any person skilled in the art within the technical scope disclosed by this application can easily think of changes or substitutions, which should all be covered within the protection scope of this application. Therefore, the protection scope of this application shall be subject to the protection scope of the said claims.
[0179] As mentioned above, it is only the preferred embodiment of the present invention, and is not used to limit the protection scope of the present invention. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the present invention shall all be included within the protection scope of the present invention.
Claims
1. An information processing method, characterized in that, The method includes: Determining the load utilization rate of the target application according to at least two load metrics of the target application; wherein, the at least two load metrics include the central processing unit (CPU) utilization rate, the memory usage rate, and the input / output (IO) usage rate, and the determining the load utilization rate of the target application includes: determining the load utilization rate of the target application according to the CPU utilization rate, the memory usage rate, and the IO usage rate of the target application; Determining a first quantity of instances of the target application according to the load utilization rate; the first quantity is the desired quantity of instances of the target application; the instance is a running copy of the target application; Adjusting the second quantity according to a first relationship between the first quantity and the second quantity; the second quantity is the quantity of instances on which the target application is running; The method further includes: Determining the type of the target application; different types of target applications have different corresponding typical load metrics, and the typical load metric is one of the at least two load metrics.
2. The method according to claim 1, wherein The method further includes: Determining a target weight corresponding to each of the at least two load metrics; The determining the load utilization rate of the target application according to at least two load metrics of the target application includes: Determining the load utilization rate of the target application according to the at least two load metrics and the determined target weights.
3. The method according to claim 2, characterized in that, The method further includes: The determining a target weight corresponding to each of the at least two load metrics includes: Determining, according to the type, the weight set corresponding to the type in at least one weight set as the target weight set; the weight set includes: weights corresponding to each of the at least two load metrics; the target weight set includes: target weights corresponding to each of the at least two load metrics.
4. The method according to claim 3, wherein The determining the type of the target application includes: Determining a load metric threshold corresponding to each of the at least two load metrics; Determining at least two second relationships between the at least two load metrics and the determined load metric thresholds; Determining, among the at least two second relationships, the second relationship in which the at least two load metrics are greater than the determined load metric thresholds as the target second relationship; Determining the type of the target application according to the load metrics in the target second relationship.
5. The method according to claim 1, wherein The determining a first quantity of instances of the target application according to the load utilization rate includes: Judging whether the load utilization rate and the load value meet a set condition; the set condition includes: the load utilization rate and the load value are greater than an expansion threshold, or the load utilization rate and the load value are less than a contraction threshold; If the load utilization rate and the load value meet the set condition, then determining a first quantity of instances of the target application according to the load utilization rate.
6. The method according to claim 5, wherein The method further includes: Inputting the load utilization rate into a set model to obtain the load value; the set model is used for smoothing the load utilization rate.
7. The method according to claim 1, characterized in that, Adjusting the second quantity according to the first relationship between the first quantity and the second quantity includes: If the first quantity is greater than the second quantity, increasing the second quantity; If the first quantity is less than the second quantity, decreasing the second quantity.
8. An information processing apparatus, characterized in that, The device includes: A first determination unit, configured to determine the load utilization rate of the target application according to at least two load metrics of the target application; wherein, the at least two load metrics include the central processing unit (CPU) utilization rate, the memory usage rate, and the input / output (IO) usage rate, and determining the load utilization rate of the target application includes: determining the load utilization rate of the target application according to the CPU utilization rate, the memory usage rate, and the IO usage rate of the target application; A second determination unit, configured to determine a first quantity of instances of the target application according to the load utilization rate; the first quantity is the desired number of instances of the target application; the instance is a running copy of the target application; An adjustment unit, configured to adjust the second quantity according to the first relationship between the first quantity and the second quantity; the second quantity is the number of instances on which the target application runs; A third determination unit, configured to determine the type of the target application; different target application types correspond to different typical load metrics, and the typical load metric is one of the at least two load metrics.
9. An electronic device, comprising a memory, a processor, and a computer program stored on the memory and executable on the processor, characterized in that When the processor executes the computer program, the information processing method according to any one of claims 1 to 7 is implemented.
10. A storage medium stores a computer program, characterized in that, When the computer program is executed by the processor, the information processing method according to any one of claims 1 to 7 is implemented.
Citation Information
Patent Citations
Load balance method and device
CN104702521A
Capacity expansion and / or reduction method and device for Redis cluster
CN110019503A
Method, device, equipment and medium for adjusting instances in industrial internet platform
CN112565391A