An autoscaling method for cloud platforms based on a fixed-length service queuing model
By adopting a fixed-length service queuing model on the Kubernetes container cloud orchestration platform, and combining the data acquisition and prediction functions of the Prometheus cloud monitoring platform, real-time container number adjustment is achieved, solving the lag and resource waste problems of traditional automatic scaling strategies, and improving the Service quality and resource utilization efficiency.
Patent Information
- Application Number
- CN202210084836.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-01-25
- Publication Date
- 2025-02-14
- Estimated Expiration
- 2042-01-25
AI Technical Summary
The traditional responsive automatic scaling strategy of the Kubernetes container cloud orchestration platform has lag, resulting in a decline in service quality or wasted resources.
The automatic scaling method of cloud platform based on the fixed-length service queuing model is adopted. By building a Kubernetes container orchestration platform and a Prometheus cloud monitoring platform, historical CPU load data are collected periodically, future load is predicted, and fixed-length service M/D/1 model is constructed. Optimize the number of containers for real-time scaling.
It realizes the prediction of load based on CPU historical data at any time, and the number of containers is adjusted in real time, avoiding the lag and resource waste of traditional automatic scaling strategies, and improving service quality and resource utilization efficiency.
Smart Images

Figure CN114528098B_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of cloud computing resources and task scheduling, and in particular to a cloud platform automatic scaling method based on a fixed-length service queuing model. Background Art
[0002] With the rapid development of computer technology, the traditional monolithic architecture has gradually evolved into a distributed cluster architecture, and the system scale and load have gradually increased, which has greatly increased the difficulty of maintenance and R&D for operation and maintenance developers. With the rapid development of cloud computing, more and more services are deployed to the cloud. Virtualization technology enables cross-host hardware resource sharing. By pooling the underlying hardware resources, the cloud platform can provide endless computing resources for application services. As a lightweight virtualization technology, Docker has gradually become the standard of modern cloud platforms due to its advantages such as good isolation and agile deployment.
[0003] Nowadays, more and more microservice Docker containers have brought tremendous pressure to management and operation and maintenance, so Kubernetes, a container orchestration tool for automated operation and maintenance management, was designed. The container cloud orchestration platform based on Kubernetes is gradually becoming a common model and is widely used. However, in the process of container orchestration, Kubernetes' traditional automatic scaling strategy is responsive horizontal scaling. Since Kubernetes's default sampling period for container resource load is 30 seconds, it is easy to cause problems such as service quality degradation or resource waste due to untimely expansion and contraction. At the same time, Kubernetes' automatic scaling strategy has a freezing period of 3 minutes and 5 minutes in the case of expansion and contraction, respectively, and cannot achieve real-time expansion and contraction. In recent years, estimating the optimal number of containers based on the predicted load of the container, thereby scaling the number of cluster containers to the optimal number, has gradually become a hot topic in cloud computing automatic scaling research. Summary of the invention
[0004] In order to overcome the service quality degradation or resource waste caused by the lag of the traditional responsive automatic scaling strategy of the container cloud platform based on Kubernetes in the prior art, the present invention provides a cloud platform automatic scaling method which can predict the future load according to the historical complex data of the CPU at any time and is based on a fixed-length service queuing model.
[0005] The present invention adopts the following technical solution:
[0006] A cloud platform automatic scaling method based on a fixed-length service queuing model further includes:
[0007] Build the Kubernetes container orchestration platform and Prometheus cloud monitoring platform, periodically collect historical CPU load data of cloud platform application services, and predict the CPU load value of cloud platform application services in the next cycle;
[0008] Based on the task similarity of a single application service and the predicted value of the CPU load, the number of tasks arriving in the next sampling period, the maximum task delay of the application service, and the threshold for the number of system containers are obtained;
[0009] Taking the sampling period as the unit time interval, a fixed-length service M / D / 1 model is constructed, and the system busy period duration is calculated according to the service intensity of the M / D / 1 model;
[0010] The traversal method is used to search for the optimal solution of the optimization objective of the fixed-length service M / D / 1 model as the optimal number of containers for the next sampling period of the system.
[0011] Furthermore, the construction of the Kubernetes container orchestration platform and the Prometheus cloud monitoring platform is as follows:
[0012] Build a Kubernetes cluster, which includes a master node and N node nodes. Set the master node name to k8s-master, and the node name to k8s-node(i) according to the node sequence number, where i = 1, 2, ..., N. The nodes use the same host configuration;
[0013] Release Prometheus as a Docker container, and use Kubernetes to manage the orchestration and scheduling of Prometheus containers to obtain the Kubernetes container orchestration platform.
[0014] Use Prometheus and Node-Exporter components to build a cloud monitoring platform to monitor the status of cluster nodes.
[0015] Furthermore, by periodically collecting historical CPU load data of cloud platform application services, the CPU load value of cloud platform application services in the next period is predicted, specifically:
[0016] Collect CPU load data to form a training sample set;
[0017] Preprocess and extract features of the training samples, and perform weighted summation of the training samples and the peak attention vector of the periodic attention vector machine to obtain the final training samples;
[0018] Specifically:
[0019] The feature extraction includes exploring data periodicity through autocorrelation coefficients to generate a periodic attention vector for guiding the model to focus on periodic features, and exploring peak data through first-order differences to generate a peak attention vector for guiding the model to focus on peak features;
[0020] Construct and train a time series convolutional neural network, and use the final training sample as the input signal;
[0021] The collected periodic CPU load data is input into the trained time series convolutional neural network to obtain the predicted value of the CPU load value.
[0022] Further, the number of tasks arriving in the next sampling period is obtained according to the task similarity of a single application service and the predicted value of the CPU load, specifically:
[0023] The sampling period is Δt, and the average execution time of a single application service task is The CPU load is defined as the ratio of the sum of the user state time and the kernel state time to the total time during the sampling period:
[0024]
[0025] Among them, utime is the user state consumption time at this time, stime is the kernel state consumption time at this time, lastutime is the user state consumption time Δt ago, and laststime is the kernel state consumption time Δt ago;
[0026] Suppose the predicted value of the CPU load in the next cycle is Then the number of tasks arriving in the next sampling period is:
[0027]
[0028] Assume that the maximum delay of the task served by the application is delay max The system container quantity threshold is set to an upper threshold and a lower threshold, the upper threshold is the maximum number of system containers pod-max, and the lower threshold is the minimum number of system containers pod-min.
[0029] Furthermore, considering the service availability, the minimum number of system containers, pod-min, is 1; the maximum number of system containers, pod-max, is limited by the cluster CPU resources R cap And single container CPU resource usage R req The decision should satisfy the following formula:
[0030]
[0031] Furthermore, the fixed-length service M / D / 1 model is constructed with the sampling period as the unit time interval, and the system busy period duration is calculated according to the service intensity of the M / D / 1 model, specifically:
[0032] Assuming the sampling period is Δt, the service capacity of the fixed-length service M / D / 1 queue model is:
[0033]
[0034] in, is the average task execution time;
[0035] The task arrival rate of the fixed-length service M / D / 1 queue model is:
[0036]
[0037] Among them, x v is the number of tasks arriving in the next sampling period, n v is the number of containers for the next sampling period;
[0038] The service intensity of the fixed-length service M / D / 1 queue model is:
[0039] ρ=λ / μ
[0040] The busy period duration of the fixed-length service M / D / 1 queue model is:
[0041] Δt busy =ρ*Δt;
[0042] Therefore, the optimization objectives and constraints of the fixed-length service M / D / 1 model are determined as follows:
[0043] Minimize(n v ),
[0044] STΔt busy <delay max And ρ<1
[0045] Among them, n v is the number of containers in the next sampling period, Δt busy is the length of the busy period, delay max is the maximum task delay, and ρ is the service intensity.
[0046] Furthermore, the traversal method is used to search for the optimal solution of the optimization target of the fixed-length service M / D / 1 model as the optimal number of containers for the next sampling period of the system, specifically:
[0047] The traversal method is used to traverse the number of containers from the lower container threshold to the upper container threshold. If the service intensity is less than 1 and the busy period duration is less than the maximum task delay, the loop is exited and the number of containers at this time is taken as the optimal number of containers for the next sampling period.
[0048] Furthermore, the temporal convolutional neural network includes an input layer, a convolutional layer and an output layer. The input layer uses a residual block with a 1×3 convolution kernel, the hidden layer uses three residual blocks of hollow convolutions with expansion coefficients of 2, 4, and 8 respectively, and the output layer is a fully connected layer.
[0049] Furthermore, the peak attention vector is specifically:
[0050] For input L M Time series data of length data points, intercept the first L M -1 data point to calculate the peak value and get the normalized peak attention vector atten peak for
[0051]
[0052] Among them, when t = 1 and t = L M When peak Supplemented by 0 value, S is the normalization operation
[0053] Furthermore, the periodic attention vector is specifically:
[0054] For input L M Time series data of length data points, intercept the first L M -1 data point is processed, the autocorrelation vector of the time series data is calculated by the autocorrelation coefficient formula, the subscript of the maximum autocorrelation value with a non-0 subscript is taken as the period T of the time series data, and the periodic attention vector atten is generated. season ;
[0055]
[0056] Where t is an integer, t0 is the Lth M data points, The length of the highlighted interval of the control cycle attention vector is 8% of the total length, σ 2 is the discreteness of the periodic attention vector distribution. Considering the 3σ principle of normal distribution, At least greater than 3σ length, so as to ensure that the attention vector The interval includes enough possible values of attention value, t′=t0-n*T, n=0,1,2….
[0057] Beneficial effects of the present invention:
[0058] The present invention breaks through the key technologies of time series prediction and analysis, M / D / 1 queuing model to solve the optimal number of containers and pre-scaling, and forms a predictive automatic scaling method with pre-scaling, support for scaling at any time, and no freezing period. It has a good effect in solving the problems of lag, insufficient resource allocation and waste of resource in the responsive automatic scaling of the Kubernetes cloud platform, and has wide application value in the automatic orchestration platform of large-scale microservice systems. BRIEF DESCRIPTION OF THE DRAWINGS
[0059] Figure 1 It is a work flow chart of the present invention;
[0060] Figure 2 This is the Kubernetes cloud platform and prometheus cloud monitoring architecture diagram of the present invention;
[0061] Figure 3 It is a schematic diagram of the structure of the temporal convolutional neural network of the present invention;
[0062] Figure 4 is a structural diagram of the residual block 1 of the present invention;
[0063] Figure 5 It is a structural diagram of the residual block 2 of the present invention. DETAILED DESCRIPTION
[0064] The present invention will be further described in detail below in conjunction with embodiments and drawings, but the embodiments of the present invention are not limited thereto.
[0065] Example
[0066] like Figure 1-Figure 5 As shown, a cloud platform automatic scaling method based on a fixed-length service queuing model includes:
[0067] S1 builds the Kubernetes container orchestration platform and the Prometheus cloud monitoring platform, builds a time series convolutional neural network and initializes the neural network with trained parameters, collects historical CPU load data of a certain length of cloud platform application services at a certain sampling period, and predicts the CPU load value of cloud platform application services.
[0068] Furthermore, the construction of the Kubernetes container orchestration platform and the Prometheus cloud monitoring platform is specifically as follows:
[0069] Build a Kubernetes cluster, which includes a master node and N node nodes. Set the master node name to k8s-master, and the node name to k8s-node(i) according to the node sequence number, where i = 1, 2, ..., N. The nodes use the same host configuration.
[0070] The host configuration can be uBuntu20.04 operating system, 16GB memory, Intel core i7-4790@3.6GHz CPU, and Kubernetes 1.15.0.
[0071] Release Prometheus as a Docker container and manage the scheduling of Prometheus containers through Kubernetes. Use Prometheus and Node-Exporter components to build a cloud monitoring platform to monitor the status of cluster nodes.
[0072] Going a step further, we can monitor the status of cluster nodes. The specific process is as follows:
[0073] Declarative updates to the Prometheus container are provided through the Kubernetes Deployment resource.
[0074] Provide declarative updates to the node-exporter container via the Daemonset resource.
[0075] The role-based access control mechanism RBAC is used to grant default users access to cluster resources. At the same time, Prometheus uses a pull mode with a certain sampling period Δt prom Actively collect node resource information from node-exporter, with a certain sampling period Δt prom is 20s.
[0076] Specifically, the Deployment resource of Kubernetes provides a declarative update for the Prometheus container. The specific operations are:
[0077] Write the Kubernetes configuration file for Prometheus, define the Deployment resource object, set spec.replicas to 1, and set spec.template.spec.nodeName to k8s-master. At the same time, define the Service resource object, set the Service type to nodePort, and open 30003 as the port for accessing the Prometheus service outside the Kubernetes cluster.
[0078] Specifically, the node-exporter container is updated declaratively through the Daemonset resource. The specific operations are:
[0079] Write the Kubernetes configuration file of node-exporter, define Daemonset resources, set the container taint configuration to: node-role.kubernetes.io / master:NoSchedule, set hostPort = 9100, and map the container port 9100 to the host port 9100. At the same time, define the Service resource object and open the port 9100 of node-exporter in the Kubernetes cluster.
[0080] Specifically, the role-based access control mechanism RBAC is used to grant default users access to cluster resources. The operation method is as follows:
[0081] The cluster creates a Prometheus role, grants the role read-only permissions to nodes, pods, endpoints, services, and nodes / proxy resources, and binds the cluster default user to the Prometheus role, so that the default user can be granted permissions to access cluster resources.
[0082] Furthermore, by periodically collecting historical CPU load data of cloud platform application services and predicting the CPU load value of cloud platform application services in the next period, the following steps are included:
[0083] A time series convolutional neural network is constructed, and the time series convolutional neural network includes an input layer, a hidden layer, and an output layer. The input layer uses a residual block 1 with a 1×3 convolution kernel, and the hidden layer uses three residual blocks 2 with dilation coefficients of 2, 4, and 8, respectively. The output layer is a fully connected layer, and the residual block is connected in series by two groups of identical structures, each group of which is a convolution, weight normalization, linear correction unit, and a dropout layer with a dropout rate of 0.2. The trained model parameters are imported into the time series convolutional neural network.
[0084] The sampling period of the acquisition signal is set to Δt, where Δt is the time difference between the sampling moments before and after the CPU load value is calculated, that is, the sampling period of the CPU load. Generally, the commonly used sampling periods of the CPU load of mainstream cloud platforms are 1min, 5min, and 15min. Without loss of generality, the sampling period Δt of the present invention is set to one of the commonly used sampling periods. The training samples and test samples are collected at a sampling period of Δt, specifically:
[0085] Preprocess the signal and extract features, specifically:
[0086] The preprocessing process is as follows: Assume that the sequence length of the input time series convolutional neural network is L M , due to the L M data points are predicted values, so the certain length is L M -1, considering the regularity of user requests in actual scenarios, so L M The value of should be such that the test sample time span can cover one day under the Δt sampling period, that is:
[0087]
[0088] Where ΔD is the time of a day, which has the same unit as Δt, which is 1440 minutes.
[0089] The specific processing of training samples is as follows: The CPU load time range of the collection application service is T M , in order to ensure that there are enough training samples, T M It is approximately the longest storage time of CPU load time series data in a general cloud platform under the sampling period of Δt. The CPU load of application services collected by sliding window scanning is intercepted each time L M The data points of length are taken as training samples. After the interception is completed, the sliding window is shifted backward by Δs points, and training samples are continuously intercepted to form a training sample set for training. M is 3 months and Δs is 5.
[0090] The specific processing of the test sample is as follows: the CPU load value of each Δt time interval before the current time is obtained with a Δt sampling period as the test sample, and the test sample length is L M -1, by using 0 value to supplement the end, the test sample length is expanded to L M .
[0091] The feature extraction process is:
[0092] Generate cycle attention vector atten season :For input L M Time series data of length data points, intercept the first L M -1 data point is processed, the autocorrelation vector of the time series data is calculated by the autocorrelation coefficient formula, the subscript of the maximum autocorrelation value with a non-0 subscript is taken as the period T of the time series data, and the periodic attention vector atten is generated. season .
[0093] And t≠t0;
[0094] Where t is an integer, t0 is the Lth M data points, The length of the highlighted interval of the control cycle attention vector is 8% of the total length, σ2 is the discreteness of the periodic attention vector distribution. Considering the 3σ principle of normal distribution, At least greater than 3σ length, so as to ensure that the attention vector The interval includes enough possible values of attention value, t′=t0-n*T, n=0,1,2…,.
[0095] Peak attention vector atten peak :For input L M Time series data of length data points, intercept the first L M -1 data point to calculate the peak value and get the normalized peak attention vector atten peak for
[0096]
[0097] Among them, when t = 1 and t = L M When peak It is supplemented by 0 value, S is a normalization operation, the purpose is to avoid the peak vector value being too high or too low:
[0098]
[0099] The original training sample, the periodic attention vector and the peak attention vector are weighted and summed to obtain the final input signal, which is used as the input of the temporal neural network. M The points are taken as label values to train the time series neural network.
[0100] The original test sample, periodic attention vector and peak attention vector are weightedly summed to obtain the final input signal, which is used as the input of the trained timing neural network and outputs the predicted value of the next sampling period.
[0101] S2 obtains the number of tasks arriving in the next sampling period, the maximum task delay of the application service, and sets a threshold for the number of system containers based on the task similarity of a single application service and the predicted value of the CPU load;
[0102] The task similarity of the single application service specifically refers to the similarity of the processing flow and processing time of the single task.
[0103] Furthermore, the sampling period in S2.1 is Δt, and the average execution time of a single application service task is The CPU load is defined as the ratio of the sum of the user state time and the kernel state time to the total time during the sampling period:
[0104]
[0105] Among them, utime is the user state consumption time at this time, stime is the kernel state consumption time at this time, lastutime is the user state consumption time Δt ago, and laststime is the kernel state consumption time Δt ago.
[0106] According to the above definition, let the predicted CPU load in the next sampling period be Then the number of tasks that arrive is:
[0107]
[0108] In S2-2, the maximum delay of the task of the application service is delay max The system container quantity threshold is set as an upper and lower threshold, the upper threshold is the maximum number of system containers pod-max, and the lower threshold is the minimum number of system containers pod-min.
[0109] In step S2-2, considering the service availability, the minimum number of system containers pod-min should be 1 to avoid service failure due to lack of containers to provide services when tasks arrive. The maximum number of system containers pod-max is limited by the cluster CPU resources R cap And single container CPU resource usage R req The decision should satisfy the following formula:
[0110]
[0111] In this embodiment, the maximum delay of the task of the application service is 120s, and the cluster CPU resource R cap The CPU resource usage of a single container is R req is 3, pod-min is 1, pod-max is 8, and the Δt is 5min. is 4.0s.
[0112] S3 constructs a fixed-length service M / D / 1 model with the sampling period as the unit time interval, and calculates the system busy period duration according to the service intensity of the M / D / 1 model; the optimization goal of the fixed-length service queuing model is to minimize the number of containers, and at the same time, meet the constraints that the system busy period duration is less than the maximum task delay, and the queuing system can tend to a stable state. The specific process is as follows:
[0113] S3-1, the certain sampling period is Δt, and the service capacity of the fixed-length service M / D / 1 queue model is:
[0114]
[0115] in, is the average task execution time.
[0116] The task arrival rate of the fixed-length service M / D / 1 queue model is:
[0117]
[0118] Among them, x v is the number of tasks arriving in the next sampling period, n v is the number of containers for the next sampling period.
[0119] The service intensity of the fixed-length service M / D / 1 queue model is:
[0120] ρ=λ / μ
[0121] The busy period duration of the fixed-length service M / D / 1 queue model is:
[0122] Δt busy =ρ*Δt
[0123] S3-2, the optimization objectives and constraints are:
[0124] Minimize(n v ),
[0125] STΔt busy <delay max And ρ<1
[0126] Among them, n v is the number of containers in the next sampling period, Δt busy is the busy period duration of step S3-1, delay max is the maximum task delay, and ρ is the service intensity.
[0127] In this embodiment, in step S3-1, Δt is 5 min. is 4.0s.
[0128] In this embodiment, in step S3-2, delay max is 120s.
[0129] S4 uses the traversal method to search for the optimal solution of the optimization target of the fixed-length service M / D / 1 model as the optimal number of containers for the next sampling period of the system. It scales the number of containers of the application service to the optimal number by calling the Kubernetes shell command for scaling the containers through the program.
[0130] The specific process includes:
[0131] The S4-1 traversal method is to traverse the number of containers from the lower container threshold to the upper container threshold. If the service intensity is less than 1 and the busy period duration is less than the maximum task delay, the loop is exited and the number of containers at this time is taken as the optimal number of containers for the next sampling period.
[0132] The implementation process is as follows:
[0133] Input: CPU load value of the next sampling period; average task execution time Maximum delay of the task max , the upper threshold of the number of containers is pod-max, and the lower threshold of the number of containers is pod-min.
[0134] 1) Initialization:
[0135] Set single task execution time Service capabilities The sampling period is set to Δt.
[0136] 2) Decision-making process:
[0137] n v Set to pod-min and execute:
[0138] a) Calculate the number of tasks x based on the CPU load definition and the average task execution time v , according to the number of containers n v Calculate the task arrival rate Calculating service intensity and busy period duration Δt busy =ρ*Δt.
[0139] If ρ<1 and Δt busy <delay max ,implement:
[0140] pod-optimal=n v (t)
[0141] Jump to 2.b.
[0142] Otherwise, execute:
[0143] If n v ==pod-max, execute:
[0144] pod-optimal=n v
[0145] Jump to 2.b.
[0146] Otherwise, execute:
[0147] n v =n v +1,
[0148] Repeat 2.a.
[0149] b) Output: pod-optimal.
[0150] S4-2, the method of scaling the number of containers of the application service to the optimal number by calling the Kubernetes shell command for scaling the containers through a program is to execute the Kubernetes shell command for scaling the containers by creating a process by calling a process library through a high-level programming language.
[0151] In this embodiment, a Kubernetes shell command for scaling containers is executed by creating a process through a process library using a high-level programming language.
[0152] The above embodiments are preferred implementation modes of the present invention, but the implementation modes of the present invention are not limited to the embodiments. Any other changes, modifications, substitutions, combinations, and simplifications that do not deviate from the spirit and principles of the present invention should be equivalent replacement methods and are included in the protection scope of the present invention.
Claims
1. A cloud platform automatic scaling method based on a fixed-length service queuing model, characterized in that: include: Build the Kubernetes container orchestration platform and Prometheus cloud monitoring platform, periodically collect historical CPU load data of cloud platform application services, and predict the CPU load value of cloud platform application services in the next cycle; Based on the task similarity of a single application service and the predicted value of the CPU load, the number of tasks arriving in the next sampling period, the maximum task delay of the application service, and the threshold for the number of system containers are obtained; Taking the sampling period as the unit time interval, a fixed-length service M / D / 1 model is constructed, and the system busy period duration is calculated according to the service intensity of the M / D / 1 model; The traversal method is used to search for the optimal solution of the optimization objective of the fixed-length service M / D / 1 model as the optimal number of containers for the next sampling period of the system; According to the task similarity of a single application service and the predicted value of the CPU load, the number of tasks arriving in the next sampling period is obtained, specifically: The sampling period is Δt, and the average execution time of a single application service task is The CPU load is defined as the ratio of the sum of the user state time and the kernel state time to the total time during the sampling period: Among them, utime is the user state consumption time at this time, stime is the kernel state consumption time at this time, lastutime is the user state consumption time Δt ago, and laststime is the kernel state consumption time Δt ago; Suppose the predicted value of the CPU load in the next cycle is Then the number of tasks arriving in the next sampling period is: Assume that the maximum delay of the task served by the application is delay max , the system container quantity threshold is set to an upper threshold and a lower threshold, the upper threshold is the maximum number of system containers pod-max, and the lower threshold is the minimum number of system containers pod-min; The fixed-length service M / D / 1 model is constructed with the sampling period as the unit time interval, and the system busy period duration is calculated according to the service intensity of the M / D / 1 model, specifically: Assuming the sampling period is Δt, the service capacity of the fixed-length service M / D / 1 queue model is: in, is the average task execution time; The task arrival rate of the fixed-length service M / D / 1 queue model is: Among them, x v is the number of tasks arriving in the next sampling period, n v is the number of containers for the next sampling period; The service intensity of the fixed-length service M / D / 1 queue model is: ρ=λ / μ The busy period duration of the fixed-length service M / D / 1 queue model is: Δt busy =ρ*Δt; Therefore, the optimization objectives and constraints of the fixed-length service M / D / 1 model are determined as follows: Minimize(n v ), S.T.Δt busy <delay max and ρ < 1 Among them, n v is the number of containers in the next sampling period, Δt busy is the length of the busy period, delay max is the maximum task delay, and ρ is the service intensity.
2. The cloud platform automatic scaling method according to claim 1, characterized in that: The construction of the Kubernetes container orchestration platform and the Prometheus cloud monitoring platform is as follows: Build a Kubernetes cluster, which includes a master node and N node nodes. Set the master node name to k8s-master, and the node name to k8s-node(i) according to the node sequence number, where i = 1, 2, ..., N. The nodes use the same host configuration; Release Prometheus as a Docker container, and use Kubernetes to manage the orchestration and scheduling of Prometheus containers to obtain the Kubernetes container orchestration platform. Use Prometheus and Node-Exporter components to build a cloud monitoring platform to monitor the status of cluster nodes.
3. The cloud platform automatic scaling method according to claim 1, characterized in that: By periodically collecting historical CPU load data of cloud platform application services, the CPU load value of cloud platform application services in the next period is predicted, specifically: Collect CPU load data to form a training sample set; Preprocess and extract features of the training samples, and perform weighted summation of the training samples and the peak attention vector of the periodic attention vector machine to obtain the final training samples; Specifically: The feature extraction includes exploring data periodicity through autocorrelation coefficients to generate a periodic attention vector for guiding the model to focus on periodic features, and exploring peak data through first-order differences to generate a peak attention vector for guiding the model to focus on peak features; Construct and train a time series convolutional neural network, and use the final training sample as the input signal; The collected periodic CPU load data is input into the trained time series convolutional neural network to obtain the predicted value of the CPU load value.
4. The cloud platform automatic scaling method according to claim 1, characterized in that: Considering the service availability, the minimum number of system containers, pod-min, is 1; the maximum number of system containers, pod-max, is limited by the cluster CPU resources R cap And single container CPU resource usage R req The decision should satisfy the following formula:
5. The cloud platform automatic scaling method according to claim 1, characterized in that: The traversal method is used to search for the optimal solution of the optimization target of the fixed-length service M / D / 1 model as the optimal number of containers for the next sampling period of the system, specifically: The traversal method is used to traverse the number of containers from the lower container threshold to the upper container threshold. If the service intensity is less than 1 and the busy period duration is less than the maximum task delay, the loop is exited and the number of containers at this time is taken as the optimal number of containers for the next sampling period.
6. The cloud platform automatic scaling method according to claim 3, characterized in that: The temporal convolutional neural network includes an input layer, a convolution layer and an output layer. The input layer uses a residual block with a 1×3 convolution kernel, the hidden layer uses three residual blocks of hollow convolution with expansion coefficients of 2, 4, and 8 respectively, and the output layer is a fully connected layer.
7. The cloud platform automatic scaling method according to claim 3, characterized in that: The peak attention vector is specifically: For input L M Time series data of length data points, intercept the first L M -1 data point to calculate the peak value and get the normalized peak attention vector atten peak for Among them, when t = 1 and t = L M When peak It is supplemented by 0 value, S is the normalization operation, 8. The cloud platform automatic scaling method according to claim 3, characterized in that: The cycle attention vector is specifically: For input L M Time series data of length data points, intercept the first L M -1 data point is processed, the autocorrelation vector of the time series data is calculated by the autocorrelation coefficient formula, the subscript of the maximum autocorrelation value with a non-0 subscript is taken as the period T of the time series data, and the periodic attention vector atten is generated. season ; Where t is an integer, t0 is the Lth M data points, The length of the highlighted interval of the control cycle attention vector is 8% of the total length, σ 2 is the discreteness of the periodic attention vector distribution. Considering the 3σ principle of normal distribution, At least greater than 3σ length, so as to ensure that the attention vector The interval includes enough possible values of attention value, t′=t0-n*T, n=0,1,2….
Citation Information
Patent Citations
Container cloud platform resource quota prediction method based on historical data analysis
CN110990159A
Task scheduling method and device
CN111198754A