Container management method and device and computing equipment

文档序号:7299 发布日期:2021-09-17 浏览:42次 中文

1. A method of container management, comprising:

acquiring historical performance data of a cluster at historical preset time;

determining the performance data of the marker post according to the historical performance data, and determining the number of marker post containers corresponding to the performance data of the marker post;

acquiring current performance data of the cluster at the current time and the current container number corresponding to the current performance data;

determining whether to expand the cluster according to the benchmark performance data, the benchmark container number, the current performance data and the current container number;

if the cluster is determined to be expanded, calculating the number of expansion containers according to the benchmark performance data and the current performance data;

calculating the survival time of the expansion container according to the benchmark performance data and the current performance data;

and according to the number of the expansion containers and the survival time of the expansion containers, expanding the cluster.

2. The method according to claim 1, wherein the historical performance data comprises historical processing request number, historical success rate and historical response time of each unit time in the historical preset time, and the benchmarking performance data comprises total benchmarking request number, benchmarking success rate and benchmarking response time;

the determining of the performance data of the marker post according to the historical performance data specifically comprises:

respectively calculating the total number of the unit requests of each unit time according to the historical processing request number, the historical success rate and the historical response time of each unit time;

determining the maximum unit request total number in the unit request total numbers as the benchmark request total number;

determining the historical success rate corresponding to the maximum unit request total number as the benchmark success rate;

and determining the historical response time corresponding to the maximum unit request total number as the benchmark response time.

3. The method of claim 2, wherein the current performance data includes a current total number of requests, a current success rate, a current response time;

determining whether to expand the cluster according to the benchmark performance data, the benchmark container number, the current performance data and the current container number, specifically including:

calculating the average number of the requests of the benchmarks of the cluster according to the total number of the requests of the benchmarks and the number of the benchmarks containers;

calculating the current average request number of the cluster according to the current request total number and the current container number;

and if the benchmark average request number is larger than the current average request number, and the benchmark response time is larger than the current response time or the benchmark success rate is smaller than the current success rate, determining to expand the cluster.

4. The method according to claim 2, wherein the calculating the number of expansion containers according to the historical performance data and the current performance data specifically includes:

acquiring the minimum container number and the maximum container number of the cluster;

calculating the planned capacity expansion quantity according to the minimum container quantity, the current container quantity, the benchmark success rate, the current success rate, the benchmark response time and the current response time;

calculating the number of the residual expandable containers according to the maximum container number and the current container number;

if the planned capacity expansion quantity is smaller than or equal to the number of the residual capacity expanders, determining the planned capacity expansion quantity as the number of the capacity expansion containers;

if the planned capacity expansion amount is larger than the remaining capacity expansion amount, determining the remaining capacity expansion amount as the amount of the capacity expansion containers.

5. The method according to claim 4, wherein the calculating a planned capacity expansion number according to the minimum container number, the current container number, the benchmarking success rate, the current success rate, the benchmarking response time, and the current response time includes:

calculating the planned capacity expansion amount according to the following formula:

wherein M is the planned capacity expansion number, F is the minimum container number, N ' is the current container number, S is the benchmarking success rate, S ' is the current success rate, T is the benchmarking response time, T ' is the current response time, and gamma is a constant.

6. The method according to claim 2, wherein calculating a lifetime of the flash tank according to the benchmarking performance data and the current performance data specifically includes:

acquiring the minimum survival time of the expansion container;

and calculating the survival time of the expansion container according to the marker post success rate, the current success rate, the marker post response time, the current response time and the minimum survival time.

7. The method according to any one of claims 1-6, further comprising:

according to a preset time interval, the historical performance data is obtained again;

and updating the benchmark performance data and the quantity of the benchmark containers according to the retrieved historical performance data.

8. A container management apparatus, comprising:

the data acquisition module is used for acquiring historical performance data of a cluster at historical preset time, and acquiring current performance data of the cluster at current time and the current container number corresponding to the current performance data;

the benchmark management module is used for determining benchmark performance data according to the historical performance data, determining the quantity of benchmark containers corresponding to the benchmark performance data, and determining whether to expand the cluster according to the benchmark performance data, the quantity of the benchmark containers, the current performance data and the current container quantity;

the capacity control module is used for calculating the number of the expansion containers according to the benchmark performance data and the current performance data and calculating the survival time of the expansion containers according to the benchmark performance data and the current performance data if the cluster is determined to be expanded;

and the scheduling module is used for expanding the cluster according to the number of the expansion containers and the survival time of the expansion containers.

9. A computing device, comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus;

the memory is configured to store at least one executable instruction that causes the processor to perform the operations of the container management method according to any one of claims 1-7.

10. A computer-readable storage medium having stored therein at least one executable instruction that, when executed on a content delivery network device, causes a computing device to perform operations of a container management method according to any one of claims 1-7.

Background

With the development of cloud technology, containers can be rapidly expanded and shrunk due to good expandability, and are widely applied to various large systems. However, the maturity of the capacity expansion method directly affects the container management efficiency.

In the current capacity expansion method, a memory usage rate container management threshold and a request rate container management threshold are preset, and when it is monitored that the memory usage rate of a cluster exceeds the memory usage rate container management threshold and the request rate of the cluster exceeds the request rate container management threshold, a container management action is triggered. The threshold value of the capacity expansion method is pre-specified, and is difficult to adapt to the real-time change of the system, so that the capacity expansion accuracy is low.

Disclosure of Invention

In view of the foregoing problems, embodiments of the present invention provide a container management method, an apparatus, and a computing device, which can improve capacity expansion accuracy.

According to a first aspect of embodiments of the present invention, there is provided a container management method, including: acquiring historical performance data of a cluster at historical preset time; determining the performance data of the marker post according to the historical performance data, and determining the number of marker post containers corresponding to the performance data of the marker post; acquiring current performance data of the cluster at the current time and the current container number corresponding to the current performance data; determining whether to expand the cluster according to the benchmark performance data, the benchmark container number, the current performance data and the current container number; if the cluster is determined to be expanded, calculating the number of expansion containers according to the benchmark performance data and the current performance data; calculating the survival time of the expansion container according to the benchmark performance data and the current performance data; and according to the number of the expansion containers and the survival time of the expansion containers, expanding the cluster.

In an optional manner, the historical performance data includes historical processing request number, historical success rate, and historical response time of each unit time within the historical preset time, and the benchmarking performance data includes total benchmarking request number, benchmarking success rate, and benchmarking response time;

the determining of the performance data of the marker post according to the historical performance data specifically comprises: respectively calculating the total number of the unit requests of each unit time according to the historical processing request number, the historical success rate and the historical response time of each unit time; determining the maximum unit request total number in the unit request total numbers as the benchmark request total number; determining the historical success rate corresponding to the maximum unit request total number as the benchmark success rate; and determining the historical response time corresponding to the maximum unit request total number as the benchmark response time.

In an optional manner, the current performance data includes a current request total, a current success rate, and a current response time;

determining whether to expand the cluster according to the benchmark performance data, the benchmark container number, the current performance data and the current container number, specifically including: calculating the average number of the requests of the benchmarks of the cluster according to the total number of the requests of the benchmarks and the number of the benchmarks containers; calculating the current average request number of the cluster according to the current request total number and the current container number; and if the benchmark average request number is larger than the current average request number, and the benchmark response time is larger than the current response time or the benchmark success rate is smaller than the current success rate, determining to expand the cluster.

In an optional manner, the calculating, according to the historical performance data and the current performance data, the number of the expansion containers specifically includes: acquiring the minimum container number and the maximum container number of the cluster; calculating the planned capacity expansion quantity according to the minimum container quantity, the current container quantity, the benchmark success rate, the current success rate, the benchmark response time and the current response time; calculating the number of the residual expandable containers according to the maximum container number and the current container number; if the planned capacity expansion quantity is smaller than or equal to the number of the residual capacity expanders, determining the planned capacity expansion quantity as the number of the capacity expansion containers; if the planned capacity expansion amount is larger than the remaining capacity expansion amount, determining the remaining capacity expansion amount as the amount of the capacity expansion containers.

In an optional manner, the calculating a planned capacity expansion amount according to the minimum container number, the current container number, the benchmarking success rate, the current success rate, the benchmarking response time, and the current response time specifically includes:

calculating the planned capacity expansion amount according to the following formula:

wherein M is the planned capacity expansion number, F is the minimum container number, N ' is the current container number, S is the benchmarking success rate, S ' is the current success rate, T is the benchmarking response time, T ' is the current response time, and gamma is a constant.

In an optional manner, the calculating a lifetime of the expansion container according to the benchmark performance data and the current performance data specifically includes: acquiring the minimum survival time of the expansion container; and calculating the survival time of the expansion container according to the marker post success rate, the current success rate, the marker post response time, the current response time and the minimum survival time.

In an optional manner, the method further comprises: according to a preset time interval, the historical performance data is obtained again; and updating the benchmark performance data and the quantity of the benchmark containers according to the retrieved historical performance data.

According to a second aspect of embodiments of the present invention, there is provided a container management apparatus including: the data acquisition module is used for acquiring historical performance data of a cluster at historical preset time, and acquiring current performance data of the cluster at current time and the current container number corresponding to the current performance data; the benchmark management module is used for determining benchmark performance data according to the historical performance data, determining the quantity of benchmark containers corresponding to the benchmark performance data, and determining whether to expand the cluster according to the benchmark performance data, the quantity of the benchmark containers, the current performance data and the current container quantity; the capacity control module is used for calculating the number of the expansion containers according to the benchmark performance data and the current performance data and calculating the survival time of the expansion containers according to the benchmark performance data and the current performance data if the cluster is determined to be expanded; and the scheduling module is used for expanding the cluster according to the number of the expansion containers and the survival time of the expansion containers.

According to a third aspect of embodiments of the present invention, there is provided a computing device comprising: the system comprises a processor, a memory, a communication interface and a communication bus, wherein the processor, the memory and the communication interface complete mutual communication through the communication bus; the memory is used for storing at least one executable instruction, and the executable instruction enables the processor to execute the operation of the container management method.

According to a fourth aspect of the embodiments of the present invention, there is provided a computer-readable storage medium having at least one executable instruction stored therein, the executable instruction causing a computing device to execute the above-mentioned container management method.

The embodiment of the invention determines the benchmark performance data according to the historical performance data of the cluster at the historical preset time, determines the benchmark performance data according to the historical performance data, determines the quantity of the benchmark containers corresponding to the benchmark performance data, obtains the current performance data of the cluster at the current time and the quantity of the current containers corresponding to the current performance data, determines whether to expand the cluster according to the benchmark performance data, the quantity of the benchmark containers, the current performance data and the quantity of the current containers, if the cluster is determined to be expanded, calculates the quantity of the expansion containers according to the benchmark performance data and the current performance data, calculates the survival time of the expansion containers according to the benchmark performance data and the current performance data, expands the cluster according to the quantity of the expansion containers and the survival time of the expansion containers, can dynamically determine the benchmark performance data along with the environmental change so as to dynamically obtain the optimal processing capacity approximate value of the cluster point, therefore, the capacity expansion accuracy is improved, manual intervention is not needed, and the workload is reduced.

The foregoing description is only an overview of the technical solutions of the embodiments of the present invention, and the embodiments of the present invention can be implemented according to the content of the description in order to make the technical means of the embodiments of the present invention more clearly understood, and the detailed description of the present invention is provided below in order to make the foregoing and other objects, features, and advantages of the embodiments of the present invention more clearly understandable.

Drawings

The drawings are only for purposes of illustrating embodiments and are not to be construed as limiting the invention. Also, like reference numerals are used to refer to like parts throughout the drawings. In the drawings:

FIG. 1 is a flow chart of a container management method according to an embodiment of the present invention;

fig. 2a is a schematic diagram illustrating a relationship between a success rate and a request number of a cluster according to an embodiment of the present invention;

FIG. 2b is a diagram illustrating a relationship between a response time and a request number of a cluster provided by an embodiment of the present invention;

FIG. 3 is a schematic structural diagram of a container management apparatus provided in an embodiment of the present invention;

fig. 4 is a schematic structural diagram of a computing device provided in an embodiment of the present invention.

Detailed Description

Exemplary embodiments of the present invention will be described in more detail below with reference to the accompanying drawings. While exemplary embodiments of the invention are shown in the drawings, it should be understood that the invention can be embodied in various forms and should not be limited to the embodiments set forth herein.

In the current capacity expansion method, a memory usage rate container management threshold and a request rate container management threshold are preset, and when it is monitored that the memory usage rate of a cluster exceeds the memory usage rate container management threshold and the request rate of the cluster exceeds the request rate container management threshold, a container management action is triggered. The memory utilization rate is determined by the service logic complexity and the resource calling complexity, the request rate of the cluster is related to the instantaneous service calling amount, and the pre-specified threshold is used, so that the real-time change of the system is difficult to adapt, the capacity expansion accuracy is low, and the ineffective capacity expansion causes resource waste. Moreover, the architecture, deployment, code, traffic, etc. of the production system are all in dynamic change, the service characteristics of each functional module are different, and the pre-specified threshold needs to be adjusted in time according to the change of the system, so that the maintenance workload is large.

Based on this, the embodiment of the invention provides a container management method, a container management device and computing equipment, so that the capacity expansion accuracy is improved.

Specifically, the embodiments of the present invention will be further explained below with reference to the drawings.

It should be understood that the following examples are provided by way of illustration and are not intended to limit the invention in any way to the particular embodiment disclosed.

Fig. 1 shows a flowchart of a container management method according to an embodiment of the present invention. The method may be applied to a computing device. As shown in fig. 1, the method includes:

and step 110, acquiring historical performance data of the cluster at historical preset time.

Wherein a cluster may be a functional module in a production system. The production system may comprise a plurality of functional modules, i.e. the production system may comprise a plurality of clusters. A cluster may comprise several identical or different containers. Therefore, the container management method can be respectively executed on each cluster to realize the container management of each cluster.

The historical preset time may be a preset time period, for example, the historical preset time may be the previous 24 hours of the current time, or may be the previous day of the current date. The historical preset time may be divided into a number of unit times, for example, the unit time is 1 hour, the historical preset time is the day before the current date, and the historical preset time includes 24 unit times.

The historical performance data may include historical processing request number, historical success rate, and historical response time of each unit time in the historical preset time. For example, n unit times in the historical preset time are counted respectively (n is a positive integer), and the performance data of the ith unit time is recorded as the historical processing request number riHistory success rate siHistory response time tiThen the historical performance data obtained is r1、r2……ri……rn、s1、s2……si……sn、t1、t2……ti……tn

The historical processing request number refers to the total number of requests processed by the cluster in unit time, the historical success rate refers to the success rate of the cluster service in unit time, and the historical response time refers to the response time of the cluster service in unit time.

And step 120, determining the performance data of the benchmarks according to the historical performance data, and determining the number of the benchmarks containers corresponding to the performance data of the benchmarks.

Wherein the benchmarking performance data is used to reflect the best processing power of the cluster. As shown in fig. 2a and 2b, when the capacity of the cluster is abundant, the success rate and response time remain substantially unchanged as the number of requests increases; when the capacity of the cluster is saturated, the success rate and response time are significantly degraded. The best processing capacity, i.e. performance knee, of a cluster is Min (Q)A,QB),QANumber of requests at A Point, QBIs the number of requests at point B. When the container specification, deployment environment, code business logic, and the like used by the cluster do not change, the performance inflection point of the cluster may be considered fixed. However, because the inflection point is constantly changing due to the dynamic change of the production environment, the embodiment determines the performance data of the benchmarking through the historical performance data, so as to dynamically search the maximum value close to the performance inflection point.

Wherein, the method also comprises: according to a preset time interval, acquiring historical performance data again; and updating the benchmark performance data and the quantity of the benchmark containers according to the re-acquired historical performance data. Wherein the preset time interval is a preset time interval for updating the historical performance data. For example, assuming that the preset time interval is 10 hours, the historical preset time is 24 hours before the current time, and the current time is 6 points, the historical performance data of the previous 24 hours is acquired at 6 points, and the historical performance data of the previous 24 hours is acquired again at 16 points. For another example, assuming that the preset time interval is 24 hours, the historical preset time is 24 hours before the current time, and the current time is 0 point, the historical performance data of the previous 24 hours is acquired at the 0 point, and the historical performance data of the previous 24 hours is acquired again at the 24 point (i.e., the 0 point on the next day). And re-determining the benchmark performance data and the quantity of the benchmark containers according to the re-acquired historical performance data, so that the benchmark performance data can change along with the change of the environment, and the most real-time system processing capacity can be reflected.

The benchmark performance data may include a total number R of benchmark requests, a benchmark success rate S, and a benchmark response time T. The number of benchmarking containers N corresponding to the benchmarking performance data refers to the number of containers in the cluster when historical performance data determined to be the benchmarking performance data is collected. The number of containers per unit time may be obtained at the same time when the historical performance data is obtained, and the number of historical containers corresponding to the historical performance data is obtained, so that when the historical performance data per unit time is determined as the benchmarking performance data, the number of containers per unit time is determined as the benchmarking container number.

Specifically, step 120 may include:

step 121, respectively calculating the total number of unit requests of each unit time according to the historical processing request number, the historical success rate and the historical response time of each unit time;

step 122, determining the maximum unit request total number in the unit request total numbers as the total number of the benchmark requests;

step 123, determining the historical success rate corresponding to the maximum unit request total number as the benchmark success rate;

and step 124, determining the historical response time corresponding to the maximum unit request total number as the benchmark response time.

In step 121, the unit request total number may be calculated according to the following formula:

wherein R isiIs the total number of unit requests, r, of the ith unit timeiThe number of history processing requests for the ith unit time, siIs the historical success rate of the ith unit time, tiIs the historical response time of the ith unit time.

In step 122, the total number of unit requests R per unit time is calculated1、R2……Ri……RnThen, R is determined1、R2……Ri……RnThe maximum unit request total number is determined as the total number of benchmarking requests R, i.e., R equals Max (R)1,R2……Ri……Rn). R is the maximum value of the cluster approaching the optimal processing capacity in the statistical period, namely R is approximately equal to Min (Q)A,QB)。

In step 123, assume the total number of unit requests R for the jth unit timejIf the request is the maximum unit request total number, the history success rate s corresponding to the maximum unit request total number is determinedjThe success rate of the marker post is determined as S.

In step 124, assume the total number of unit requests R for the jth unit timejThe maximum unit request total number is obtained, and the historical response time t corresponding to the maximum unit request total number is obtainedjThe benchmarking response time T is determined.

Step 130, obtaining the current performance data of the cluster at the current time and the current container number corresponding to the current performance data.

And if the current time is the time for executing the container management method on the cluster, the current performance data is the performance data acquired by the cluster in real time. The current performance data may include a current total number of requests R ', a current success rate S ', and a current response time T '. For example, the current total number of requests R ' may be the total number of requests of the machine within the last one minute, the current success rate S ' may be the success rate of the cluster at the current time, and the current response time T ' may be the minimum of the response times of the clusters within five consecutive one minutes. The current container number corresponding to the current performance data refers to the container number of the cluster at the current time.

And step 140, determining whether to expand the cluster according to the benchmark performance data, the quantity of the benchmark containers, the current performance data and the current quantity of the containers.

Referring to fig. 2a and 2b, when any one of the following conditions is satisfied, it indicates that the cluster capacity is insufficient and capacity needs to be expanded: the method comprises the following steps that firstly, the request number of a cluster is increased, and the success rate of service is reduced; conditional two, the number of requests of the cluster rises and the average response time of the service increases. Therefore, although the benchmark performance data is only an approximate value close to the optimal processing capacity, whether the current capacity of the cluster is sufficient can be accurately evaluated, so that whether the cluster is expanded or not can be determined according to the benchmark performance data, the quantity of benchmark containers, the current performance data and the quantity of current containers.

Specifically, step 140 may include:

step 141, calculating the average number of requests of the benchmarks of the cluster according to the total number of the benchmarks requests and the number of the benchmarks containers;

142, calculating the current average request number of the cluster according to the current request total number and the current container number;

and 143, if the average number of the benchmarking requests is larger than the current average number of the requests, and the response time of the benchmarking is larger than the current response time or the success rate of the benchmarking is smaller than the current success rate, determining to expand the cluster.

Dividing the total number of the benchmark requests by the number of the benchmark containers to obtain the average number of the benchmark requests; and dividing the total number of the current requests by the number of the current containers to obtain the current average number of the requests. If the statistical unit of the current performance data is minutes and the statistical unit of the benchmark performance data is hours, the benchmark average request number and the current average request number need to be unified into the same unit before being compared. For example, the current average number of requests is calculated according to the following formulaAnd benchmarking average request number

Wherein R 'is the total number of current requests, N' is the number of current containers, λ is a correction parameter (for example, 0.9 may be taken), R is the total number of benchmarking requests, and N is the number of benchmarking containers.

In step 143, whenAnd (T '> T or S' < S), then it is determined to scale the cluster.

And 150, if the cluster is determined to be expanded, calculating the number of the expansion containers according to the benchmark performance data and the current performance data.

In order to avoid the situation of resource waste caused by the expansion of a large number of containers due to instantaneous jitter, the number of the expansion containers is calculated by adopting the harmonic progression so as to perform small-quantity multiple expansion. For example, the number of flash containers may be calculated according to the following formula:

where Y is the number of expansion containers, γ is euler constant (0.5772 may be taken), and x is a factor affecting expansion, such as success rate, response time, and the like.

Specifically, step 150 may include:

step 151, acquiring the minimum container number and the maximum container number of the cluster;

step 152, calculating the planned capacity expansion quantity according to the minimum container quantity, the current container quantity, the benchmark success rate, the current success rate, the benchmark response time and the current response time;

step 153, calculating the number of the remaining expandable containers according to the maximum number of the containers and the current number of the containers;

step 154, if the planned capacity expansion quantity is less than or equal to the remaining capacity expansion container quantity, determining the planned capacity expansion quantity as the quantity of the capacity expansion containers;

step 155, if the planned capacity expansion amount is larger than the remaining capacity expansion amount, determining the remaining capacity expansion amount as the amount of the capacity expansion container.

The minimum container number F is the minimum value of the number of containers accommodated in the cluster, and the maximum container number C is the maximum value of the number of containers accommodated in the cluster. The minimum number of containers F and the maximum number of containers C may be configured at the initial time of the cluster.

The capacity shortage is firstly reflected in the response time, that is, the response time rises first, and when the response time rises to a certain degree, the success rate begins to fall. Thus, the success rate is a more severe signal than the increase in response time, requiring more containers to be expanded. In addition, the effect of container expansion is related to the number of containers currently existing in the cluster, and when the number of existing containers in the cluster is large, more containers need to be expanded to achieve the expected effect. In step 152, the projected capacity expansion amount may be calculated according to the following formula:

wherein M is the planned capacity expansion number, F is the minimum container number, N ' is the current container number, S is the benchmark success rate, S ' is the current success rate, T is the benchmark response time, T ' is the current response time, and gamma is the Euler constant.

In step 153, the maximum container number F is subtracted from the current container number N 'to obtain the remaining expandable container number (F-N'). In steps 154 and 155, if M is less than or equal to (F-N'), the number Y of expansion containers is M; if M > (F-N '), the number Y of expansion vessels is (F-N').

And 160, calculating the survival time of the expansion container according to the benchmark performance data and the current performance data.

Wherein, the survival time of the expansion container is related to the marker post success rate S, the current success rate S ', the marker post response time T, and the current response time T', then step 160 may specifically include:

step 161, obtaining the minimum survival time of the expansion container;

and step 162, calculating the survival time of the expansion container according to the benchmark success rate, the current success rate, the benchmark response time, the current response time and the minimum survival time.

The minimum lifetime t of the expanded container is the shortest time for which the expanded container can survive. The minimum lifetime t may also be configured at cluster initialization. The lifetime t' of the expansion vessel may be calculated according to the following formula:

wherein S is the success rate of the marker post, S 'is the current success rate, T is the response time of the marker post, T' is the current response time, and T is the minimum survival time.

In this embodiment, by setting the survival time of the capacity expansion container, the situation of the fall back of the traffic can be effectively coped with, so that the container is timely recovered, and the resource utilization rate is improved.

And 170, expanding the cluster according to the number of the expansion containers and the survival time of the expansion containers.

After the number of the expansion containers and the survival time of the expansion containers are obtained through calculation, the number of the expansion containers, the survival time of the expansion containers and the cluster identifications can be sent to the scheduling module, so that the scheduling module can expand the clusters corresponding to the cluster identifications according to the number of the expansion containers, the survival time of the expansion containers, the cluster identifications and the scheduling container management platform.

The embodiment of the invention determines the benchmark performance data according to the historical performance data of the cluster at the historical preset time, determines the benchmark performance data according to the historical performance data, determines the quantity of the benchmark containers corresponding to the benchmark performance data, obtains the current performance data of the cluster at the current time and the quantity of the current containers corresponding to the current performance data, determines whether to expand the cluster according to the benchmark performance data, the quantity of the benchmark containers, the current performance data and the quantity of the current containers, if the cluster is determined to be expanded, calculates the quantity of the expansion containers according to the benchmark performance data and the current performance data, calculates the survival time of the expansion containers according to the benchmark performance data and the current performance data, expands the cluster according to the quantity of the expansion containers and the survival time of the expansion containers, can dynamically determine the benchmark performance data along with the environmental change so as to dynamically obtain the optimal processing capacity approximate value of the cluster point, therefore, the capacity expansion accuracy is improved, manual intervention is not needed, the workload is reduced, the capacity expansion quantity is calculated according to the deterioration degree of the current performance of the cluster relative to the performance of the benchmarks and the current container quantity of the cluster, the resource waste caused by instantaneous large-quantity capacity expansion is avoided, in addition, the capacity expansion quantity is planned, the survival time of the capacity expansion container is determined, the capacity expansion can be rapidly realized in the face of sudden instantaneous service peaks, and redundant resources can be rapidly released in the process of service fallback.

Fig. 3 is a schematic structural diagram of a container management device according to an embodiment of the present invention. The apparatus may be applied to a computing device. As shown in fig. 3, the apparatus 200 includes: a data acquisition module 210, a benchmarking module 220, a capacity management module 230, and a scheduling module 240.

The data acquisition module 210 is connected to the production system 400, the benchmarking management module 220 is connected to the data acquisition module 210 and the capacity management and control module 230, the capacity management and control module 230 is connected to the data acquisition module 210, the scheduling module 240 is connected to the capacity management and control module 230, and the container management platform 500 is connected to the scheduling module 240 and the production system 400. Where production system 400 may include at least one cluster, container management platform 500 is used to add or reclaim containers in production system 400.

The data obtaining module 210 is configured to obtain historical performance data of a cluster at a historical preset time, and obtain current performance data of the cluster at a current time and a current container number corresponding to the current performance data; the benchmark management module 220 is configured to determine benchmark performance data according to the historical performance data, determine the quantity of benchmark containers corresponding to the benchmark performance data, and determine whether to expand the cluster according to the benchmark performance data, the quantity of the benchmark containers, the current performance data, and the current container quantity; the capacity management and control module 230 is configured to, if it is determined to expand the cluster, calculate the number of expansion containers according to the benchmark performance data and the current performance data, and calculate the lifetime of the expansion containers according to the benchmark performance data and the current performance data; the scheduling module 240 is configured to perform capacity expansion on the cluster according to the number of the capacity expansion containers and the lifetime of the capacity expansion containers.

In an optional manner, the historical performance data includes historical processing request count, historical success rate, and historical response time of each unit time within the historical preset time, and the benchmarking performance data includes total benchmarking request count, benchmarking success rate, and benchmarking response time. The benchmarking module 220 is specifically configured to: respectively calculating the total number of the unit requests of each unit time according to the historical processing request number, the historical success rate and the historical response time of each unit time; determining the maximum unit request total number in the unit request total numbers as the benchmark request total number; determining the historical success rate corresponding to the maximum unit request total number as the benchmark success rate; and determining the historical response time corresponding to the maximum unit request total number as the benchmark response time.

In an alternative, the current performance data includes a current request total, a current success rate, and a current response time. The benchmarking module 220 is specifically configured to: calculating the average number of the requests of the benchmarks of the cluster according to the total number of the requests of the benchmarks and the number of the benchmarks containers; calculating the current average request number of the cluster according to the current request total number and the current container number; and if the benchmark average request number is larger than the current average request number, and the benchmark response time is larger than the current response time or the benchmark success rate is smaller than the current success rate, determining to expand the cluster.

In an optional manner, the capacity management module 230 is specifically configured to: acquiring the minimum container number and the maximum container number of the cluster; calculating the planned capacity expansion quantity according to the minimum container quantity, the current container quantity, the benchmark success rate, the current success rate, the benchmark response time and the current response time; calculating the number of the residual expandable containers according to the maximum container number and the current container number; if the planned capacity expansion quantity is smaller than or equal to the number of the residual capacity expanders, determining the planned capacity expansion quantity as the number of the capacity expansion containers; if the planned capacity expansion amount is larger than the remaining capacity expansion amount, determining the remaining capacity expansion amount as the amount of the capacity expansion containers.

In an optional manner, the capacity management module 230 is specifically configured to: calculating the planned capacity expansion amount according to the following formula:

wherein M is the planned capacity expansion number, F is the minimum container number, N ' is the current container number, S is the benchmarking success rate, S ' is the current success rate, T is the benchmarking response time, T ' is the current response time, and gamma is a constant.

In an optional manner, the capacity management module 230 is further specifically configured to: acquiring the minimum survival time of the expansion container; and calculating the survival time of the expansion container according to the marker post success rate, the current success rate, the marker post response time, the current response time and the minimum survival time.

In an optional manner, the data obtaining module 210 is further configured to: according to a preset time interval, the historical performance data is obtained again; the benchmarking module 220 is also operable to: and updating the benchmark performance data and the quantity of the benchmark containers according to the retrieved historical performance data.

It should be noted that, the container management apparatus provided in the embodiments of the present invention is an apparatus capable of executing the container management method, and all embodiments of the container management method are applicable to the apparatus and can achieve the same or similar beneficial effects.

The embodiment of the invention determines the benchmark performance data according to the historical performance data of the cluster at the historical preset time, determines the benchmark performance data according to the historical performance data, determines the quantity of the benchmark containers corresponding to the benchmark performance data, obtains the current performance data of the cluster at the current time and the quantity of the current containers corresponding to the current performance data, determines whether to expand the cluster according to the benchmark performance data, the quantity of the benchmark containers, the current performance data and the quantity of the current containers, if the cluster is determined to be expanded, calculates the quantity of the expansion containers according to the benchmark performance data and the current performance data, calculates the survival time of the expansion containers according to the benchmark performance data and the current performance data, expands the cluster according to the quantity of the expansion containers and the survival time of the expansion containers, can dynamically determine the benchmark performance data along with the environmental change so as to dynamically obtain the optimal processing capacity approximate value of the cluster point, therefore, the capacity expansion accuracy is improved, manual intervention is not needed, the workload is reduced, the capacity expansion quantity is calculated according to the deterioration degree of the current performance of the cluster relative to the performance of the benchmarks and the current container quantity of the cluster, the resource waste caused by instantaneous large-quantity capacity expansion is avoided, in addition, the capacity expansion quantity is planned, the survival time of the capacity expansion container is determined, the capacity expansion can be rapidly realized in the face of sudden instantaneous service peaks, and redundant resources can be rapidly released in the process of service fallback.

Fig. 4 is a schematic structural diagram of a computing device according to an embodiment of the present invention, and the specific embodiment of the present invention does not limit the specific implementation of the computing device.

As shown in fig. 4, the computing device may include: a processor (processor)302, a communication Interface 304, a memory 306, and a communication bus 308.

Wherein: the processor 302, communication interface 304, and memory 306 communicate with each other via a communication bus 308. A communication interface 304 for communicating with network elements of other devices, such as clients or other servers. The processor 302 is configured to execute the program 310, and may specifically perform the relevant steps in the embodiment of the container management method described above.

In particular, program 310 may include program code comprising computer-executable instructions.

The processor 302 may be a central processing unit CPU, or an Application Specific Integrated Circuit (ASIC), or one or more Integrated circuits configured to implement an embodiment of the present invention. The content delivery network includes one or more processors, which may be the same type of processor, such as one or more CPUs; or may be different types of processors such as one or more CPUs and one or more ASICs.

And a memory 306 for storing a program 310. Memory 306 may comprise high-speed RAM memory and may also include non-volatile memory (non-volatile memory), such as at least one disk memory.

The program 310 may specifically be invoked by the processor 302 to cause the computing device to perform the operations in the container management method in the above-described embodiments.

The embodiment of the invention determines the benchmark performance data according to the historical performance data of the cluster at the historical preset time, determines the benchmark performance data according to the historical performance data, determines the quantity of the benchmark containers corresponding to the benchmark performance data, obtains the current performance data of the cluster at the current time and the quantity of the current containers corresponding to the current performance data, determines whether to expand the cluster according to the benchmark performance data, the quantity of the benchmark containers, the current performance data and the quantity of the current containers, if the cluster is determined to be expanded, calculates the quantity of the expansion containers according to the benchmark performance data and the current performance data, calculates the survival time of the expansion containers according to the benchmark performance data and the current performance data, expands the cluster according to the quantity of the expansion containers and the survival time of the expansion containers, can dynamically determine the benchmark performance data along with the environmental change so as to dynamically obtain the optimal processing capacity approximate value of the cluster point, therefore, the capacity expansion accuracy is improved, manual intervention is not needed, and the workload is reduced.

An embodiment of the present invention provides a computer-readable storage medium, where the storage medium stores at least one executable instruction, and when the executable instruction runs on a content transmission network device, a container management apparatus/device executes a container management method in any method embodiment described above. The executable instructions may be specifically configured to cause the content delivery network device to perform the operations in the container management method in the foregoing embodiments.

The embodiment of the invention determines the benchmark performance data according to the historical performance data of the cluster at the historical preset time, determines the benchmark performance data according to the historical performance data, determines the quantity of the benchmark containers corresponding to the benchmark performance data, obtains the current performance data of the cluster at the current time and the quantity of the current containers corresponding to the current performance data, determines whether to expand the cluster according to the benchmark performance data, the quantity of the benchmark containers, the current performance data and the quantity of the current containers, if the cluster is determined to be expanded, calculates the quantity of the expansion containers according to the benchmark performance data and the current performance data, calculates the survival time of the expansion containers according to the benchmark performance data and the current performance data, expands the cluster according to the quantity of the expansion containers and the survival time of the expansion containers, can dynamically determine the benchmark performance data along with the environmental change so as to dynamically obtain the optimal processing capacity approximate value of the cluster point, therefore, the capacity expansion accuracy is improved, manual intervention is not needed, and the workload is reduced.

The embodiment of the invention provides a container management device, which is used for executing the container management method.

Embodiments of the present invention provide a computer program that can be invoked by a processor to cause a computing device to execute a container management method in any of the above method embodiments.

Embodiments of the present invention provide a computer program product comprising a computer program stored on a computer-readable storage medium, the computer program comprising program instructions that, when run on a computer, cause the computer to perform a method of container management in any of the above-described method embodiments.

The algorithms or displays presented herein are not inherently related to any particular computer, virtual system, or other apparatus. Various general purpose systems may also be used with the teachings herein. The required structure for constructing such a system will be apparent from the description above. In addition, embodiments of the present invention are not directed to any particular programming language. It is appreciated that a variety of programming languages may be used to implement the teachings of the present invention as described herein, and any descriptions of specific languages are provided above to disclose the best mode of the invention.

In the description provided herein, numerous specific details are set forth. It is understood, however, that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure an understanding of this description.

Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, various features of the embodiments of the invention are sometimes grouped together in a single embodiment, figure, or description thereof for the purpose of streamlining the invention and aiding in the understanding of one or more of the various inventive aspects. However, the disclosed method should not be interpreted as reflecting an intention that: that the invention as claimed requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the detailed description are hereby expressly incorporated into this detailed description, with each claim standing on its own as a separate embodiment of this invention.

Those skilled in the art will appreciate that the modules in the device in an embodiment may be adaptively changed and disposed in one or more devices different from the embodiment. The modules or units or components of the embodiments may be combined into one module or unit or component, and furthermore they may be divided into a plurality of sub-modules or sub-units or sub-components. All of the features disclosed in this specification (including any accompanying claims, abstract and drawings), and all of the processes or elements of any method or apparatus so disclosed, may be combined in any combination, except combinations where at least some of such features and/or processes or elements are mutually exclusive. Each feature disclosed in this specification (including any accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.

Furthermore, those skilled in the art will appreciate that while some embodiments herein include some features included in other embodiments, rather than other features, combinations of features of different embodiments are meant to be within the scope of the invention and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.

It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention may be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In the unit claims enumerating several means, several of these means may be embodied by one and the same item of hardware. The usage of the words first, second and third, etcetera do not indicate any ordering. These words may be interpreted as names. The steps in the above embodiments should not be construed as limiting the order of execution unless specified otherwise.

完整详细技术资料下载
上一篇:石墨接头机器人自动装卡簧、装栓机
下一篇:实现消息信号中断的方法、装置和设备

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!