Minimum scheduling unit migration method, apparatus and device, and readable storage medium
By monitoring the container to collect performance data and performance calculations, selecting the appropriate node and adjusting the configuration, the problem of insufficient resources after the migration of Pods in the kubernetes cluster is solved, ensuring the normal operation of the Pods on the new node.
Patent Information
- Application Number
- CN202411345542.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-25
- Publication Date
- 2024-12-13
AI Technical Summary
In a cloud-based multi-core scenario, when the working node fails in a kubernetes cluster, the pod may not run normally after migrating to other nodes. The reason is that the node CPU, memory and other specifications are inconsistent, resulting in the migration strategy that cannot meet the basic operation needs of the pod.
The performance data of the Pod to be migrated is collected by the monitoring container, and the specification computing power and the remaining available specification computing power of the migration node are determined by the performance calculation method. The node with the maximum residual specification computing power is selected as the target node, and the Pod is adjusted based on the relative application computing power. Configuration information to make it run normally on the new node.
Ensure that the Pod can meet the CPU, memory and other resource requirements after migration, ensure its normal operation, and solve the problem of insufficient resources after migration.
Smart Images

Figure CN119127508A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of computer technology, and in particular to a minimum scheduling unit migration method, device, equipment and readable storage medium. Background Art
[0002] In a kubernetes (open source container orchestration platform) cluster, when a working node (host) fails, the Pod (Pod is the smallest scheduling unit in Kubernetes) running on the node will first be expelled from the node by the controller of the kubernetes cluster, and other runnable nodes will be selected for reconstruction, thus completing the entire process of Pod failure migration. In the one-cloud-multiple-core scenario, due to the inconsistency of CPU, memory and other specifications of each node, when a failure occurs and migration is required, the original k8s failure migration strategy will not work properly due to the architecture limitations of the one-cloud-multiple-core cluster, because the one-cloud-multiple-core cluster is composed of multi-architecture nodes. When the Pod is migrated to other nodes,
[0003] It can be seen that the technical problem of how to ensure that the migrated Pod can still maintain normal operation on any node is a problem that technical personnel in this field need to solve. Summary of the invention
[0004] In view of this, the purpose of the present invention is to provide a minimum scheduling unit migration method, device, equipment and readable storage medium, which solves the technical problem in the prior art that it is impossible to ensure that the Pod can remain in normal operation after being migrated to other nodes.
[0005] In order to solve the above technical problems, the present invention provides a minimum scheduling unit migration method, comprising:
[0006] Using the performance data of the minimum schedulable unit to be migrated as the first performance data, and using the performance data of the migration node as the second performance data;
[0007] Determine the standard computing power and the remaining available standard computing power of the migration node based on the second performance data using a performance measurement method; wherein the standard computing power is a parameter characterizing the performance of the node;
[0008] Selecting a node from the migration nodes as a target migration node according to the remaining available computing capacity;
[0009] Determine the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node; wherein the relative application computing power refers to the application computing power value determined based on the specification computing power and performance data of the minimum schedulable unit with the same configuration at different nodes;
[0010] The configuration information of the minimum schedulable unit to be migrated is determined based on the relative application computing power, the minimum schedulable unit to be migrated is migrated to the target migration node, and the minimum schedulable unit to be migrated is configured based on the configuration information.
[0011] On the one hand, the step of using the performance data of the smallest schedulable unit to be migrated as the first performance data includes:
[0012] Receive the performance data of the working container corresponding to the minimum schedulable unit to be migrated reported by the monitoring container; wherein the performance data of the working container includes the size of the central processing unit of the working container, the utilization rate of the central processing unit of the working container, the memory size, the memory utilization rate and the query rate per second of the working container;
[0013] The performance data of the working container is used as the first performance data.
[0014] On the one hand, determining the specification computing power and the remaining available specification computing power of the migration node based on the second performance data using a performance measurement method includes:
[0015] Determine the specification computing power of the migration node using a system performance testing tool based on the second performance data;
[0016] determining a ratio of the second performance data to the corresponding remaining performance data;
[0017] The remaining available standard computing power is determined based on the ratio, the second performance data and the standard computing power.
[0018] On the one hand, selecting a node from the migration nodes as a target migration node according to the remaining available specification computing power includes:
[0019] Sort the nodes according to the remaining available computing power, and determine the node with the largest remaining available computing power;
[0020] The node with the largest remaining available computing power is used as the target migration node.
[0021] On the one hand, determining the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node includes:
[0022] The relative application computing power is determined based on the first performance data and the specification computing power of the target migration node using the relative application computing power calculation method; wherein the relative application computing power calculation method is (working container QPS*(corresponding node specification computing power)) / ((working container CPU size*CPU usage)*(memory size*memory usage)).
[0023] On the one hand, determining configuration information of a minimum schedulable unit to be migrated based on the relative application computing power includes:
[0024] Determine the relative application computing power of the pre-migration node corresponding to the minimum schedulable unit to be migrated;
[0025] A relative applied computing power ratio based on the relative applied computing power of the target migration node and the relative applied computing power of the node before migration;
[0026] The configuration information of the minimum schedulable unit to be migrated is determined based on the relative application computing power ratio and the configuration information of the working container before migration.
[0027] On the one hand, determining the specification computing power and the remaining available specification computing power of the migration node based on the second performance data using a performance measurement method includes:
[0028] Obtaining performance measurement tools corresponding to different performance data in the second performance data; wherein the performance measurement tools include at least two of a network performance measurement tool, a memory performance measurement tool, a central processing unit performance measurement tool, and a disk performance measurement tool;
[0029] Run the network performance measurement tool to measure the computing power of the network under the virtual machine corresponding to each node;
[0030] Run the memory performance measurement tool to measure the memory capacity of each node corresponding to the virtual machine.
[0031] Run the CPU performance measurement tool to measure the CPU performance of each node in the virtual machine.
[0032] Run the disk performance calculation tool to calculate the specification computing power of the hard disk under the virtual machine corresponding to each node;
[0033] The specification computing power of the network, the specification computing power of the memory, the specification computing power of the central processing unit and the specification computing power of the hard disk corresponding to each node are added together to obtain the specification computing power of each migration node.
[0034] The present invention also provides a minimum schedulable unit migration device, comprising:
[0035] A performance data determination module, configured to use the performance data of the minimum schedulable unit to be migrated as the first performance data, and use the performance data of the migration node as the second performance data;
[0036] A specification computing power determination module, configured to determine the specification computing power and the remaining available specification computing power of the migration node based on the second performance data using a performance measurement method; wherein the specification computing power is a parameter characterizing the performance of the node;
[0037] A target migration node determination module, configured to select a node from the migration nodes as a target migration node according to the remaining available specification computing power;
[0038] A relative application computing power determination module, used to determine the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node; wherein the relative application computing power refers to the application computing power value determined based on the specification computing power and performance data of the same configured minimum schedulable unit at different nodes;
[0039] The minimum schedulable unit migration module is used to determine the configuration information of the minimum schedulable unit to be migrated based on the relative application computing power, migrate the minimum schedulable unit to be migrated to the target migration node, and configure the minimum schedulable unit to be migrated based on the configuration information.
[0040] The present invention also provides a minimum schedulable unit migration device, comprising:
[0041] Memory for storing computer programs;
[0042] A processor is used to execute the computer program to implement the steps of the minimum schedulable unit migration method as described above.
[0043] The present invention also provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the minimum schedulable unit migration method as described above are implemented.
[0044] The present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the above minimum schedulable unit migration method when executed by a processor.
[0045] The purpose of the embodiment of the present invention is to provide a minimum scheduling unit migration method, which can solve the technical problem that the minimum scheduling unit cannot operate normally after migrating to a new node.
[0046] To solve the above technical problems, an embodiment of the present invention provides a minimum scheduling unit migration method, which may include: taking the performance data of the minimum schedulable unit to be migrated as the first performance data, and taking the performance data of the migration node as the second performance data; determining the specification computing power and the remaining available specification computing power of the migration node based on the second performance data using a performance measurement method; wherein the specification computing power is a parameter characterizing the performance of the node; selecting a node from the migration nodes as the target migration node according to the remaining available specification computing power; determining the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node; wherein the relative application computing power refers to the application computing power value determined based on the specification computing power and performance data of the same configured minimum schedulable unit at different nodes; determining the configuration information of the minimum schedulable unit to be migrated based on the relative application computing power, migrating the minimum schedulable unit to be migrated to the target migration node, and configuring the minimum schedulable unit to be migrated based on the configuration information.
[0047] It can be seen from the above technical scheme that the beneficial effect of the present invention is that compared with the current direct migration of the Pod from the faulty node to the non-faulty node, the CPU (central processing unit), memory, etc. required by the Pod may not be able to meet the basic operation of the Pod itself in the new node. The present invention selects a node from the migration node as the target migration node according to the remaining available specification computing power of the non-faulty node, and when performing the migration, determines the configuration information of the minimum schedulable unit to be migrated based on the relative application computing power, so that the new node can meet the operating computing power requirements of the Pod. BRIEF DESCRIPTION OF THE DRAWINGS
[0048] In order to more clearly illustrate the embodiments of the present invention, the following briefly introduces the drawings required for use in the embodiments. Obviously, the drawings described below are only some embodiments of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0049] Figure 1 A flowchart of a minimum schedulable unit migration method provided by an embodiment of the present invention;
[0050] Figure 2 An example flow chart of a minimum schedulable unit migration method provided in an embodiment of the present invention;
[0051] Figure 3 An overall architecture diagram of a minimum schedulable unit migration provided by an embodiment of the present invention;
[0052] Figure 4 A schematic diagram of a monitoring container operation provided by an embodiment of the present invention;
[0053] Figure 5A schematic diagram of determining an optimal scheduling node provided by an embodiment of the present invention;
[0054] Figure 6 A schematic diagram of configuration information modification provided by an embodiment of the present invention;
[0055] Figure 7 A schematic diagram of the structure of a minimum schedulable unit migration device provided by an embodiment of the present invention;
[0056] Figure 8 A schematic diagram of the structure of a minimum schedulable unit migration device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0057] The following will be combined with the drawings in the embodiments of the present invention to clearly and completely describe the technical solutions in the embodiments of the present invention. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0058] The terms "including" and "having" in the specification of the present invention and the above-mentioned drawings, as well as any variations thereof, are intended to cover non-exclusive inclusions. For example, a process, method, system, product or device including a series of steps or units is not limited to the listed steps or units, but may include steps or units that are not listed.
[0059] Some of the terms that appear in the description of the embodiments of the present invention may be interpreted as follows:
[0060] One cloud, multiple cores: refers to using a cloud platform to manage computing resources of different chip architectures, achieving unified management and scheduling of heterogeneous resources, and shielding the underlying architecture differences through the cloud platform to provide users with cloud computing services with consistent experience. In this article, it mainly refers to the presence of host nodes with multiple chip architectures in the same k8s cluster.
[0061] Container: In Linux, container is a lightweight, portable, self-contained software running technology that allows developers to package applications and their dependencies into a deployable unit and ensure that the application runs in a consistent manner in different environments.
[0062] Pod: Pod is the smallest resource management component in kubernetes. Pod is also the resource object that minimizes the running of containerized applications. A Pod represents a process running in the cluster. Most other components in kubernetes support and extend the Pod function around Pod, for example, controller objects such as StatefulSet and Deployment used to manage Pod operation.
[0063] Kubernetes, or K8s for short, is a scalable containerized application orchestration platform. Through Kubernetes, users can more efficiently deploy and manage large-scale containerized applications and improve resource utilization.
[0064] Sidecar: A common microservice architecture pattern that allows one or more auxiliary containers (Sidecar containers) to be deployed in a Pod. These containers share the same network namespace and storage resources as the main application container. The Sidecar pattern injects containers into the Pod to provide additional functions such as log collection, monitoring, security, etc. without modifying the main application code.
[0065] Mutating Admission Webhook is an important component in Kubernetes and is part of admission control. In Kubernetes, when a resource (such as Pod, Service, etc.) is created, updated, or deleted, these operations are first processed by the API Server. Inside the API Server, there is an admission control chain that performs a series of checks and modifications on requests before the resources are persisted to etcd. MutatingAdmission Webhook is a special type of controller in this admission control chain that allows users to modify request objects through a custom HTTP callback service before the resources are persisted.
[0066] Kubelet: A component running on each k8s node, responsible for creating Pods, maintaining the Pod lifecycle, and managing and maintaining the container runtime environment on the node.
[0067] In the scenario of one cloud and multiple cores, due to the inconsistency of CPU, memory and other specifications of each node, when a failure occurs and migration is performed, the original k8s fault migration strategy 1. Since the one cloud and multiple core cluster is composed of multi-architecture nodes, when the Pod is migrated to other nodes, the Pod may not run normally due to architectural limitations. Due to the different CPU performance of each node in the one cloud and multiple core cluster, when the Pod is migrated, the CPU and memory required by the original Pod may not meet the basic operation of the Pod itself in the new node.
[0068] In order to enable those skilled in the art to better understand the solution of the present invention, the present invention is further described in detail below in conjunction with the accompanying drawings and specific implementation methods.
[0069] Next, a flowchart of a minimum schedulable unit migration method provided by an embodiment of the present invention is described in detail. Figure 1 A minimum schedulable unit migration method provided in an embodiment of the present invention may include:
[0070] S101, taking the performance data of the smallest schedulable unit to be migrated as first performance data, and taking the performance data of the migration node as second performance data.
[0071] The execution subject of this embodiment is an electronic device, and this embodiment does not limit the specific electronic device. For example, the electronic device in this embodiment can be a computer, a mobile phone, a node in a cluster, etc. The application scenario of this embodiment is one cloud and multiple cores. In this embodiment, the minimum schedulable unit to be migrated is the Pod to be migrated. It can be understood that when a certain working node (host) fails, the Pod running on the node will first be expelled from the node by the controller of the kubernetes cluster, and the Pod is the minimum schedulable unit to be migrated. This embodiment does not limit the specific first performance data. For example, the first performance data can be general indicator information, such as the CPU (central processing unit) and memory usage of the working container. QPS is the query rate per second, which indicates the number of query requests that the system can process per second. The performance data of the migration node in this embodiment is other nodes except the failed node. This embodiment does not limit the specific second performance data. For example, the second performance data can be the computing power of the CPU, or the second performance data in this embodiment can also be CPU and memory data.
[0072] It should be further explained that, in order to improve the efficiency of determining the first performance data, the above-mentioned use of the performance data of the minimum schedulable unit to be migrated as the first performance data may include: receiving the performance data of the working container corresponding to the minimum schedulable unit to be migrated reported by the monitoring container; wherein the performance data of the working container includes the size of the working container's central processing unit, the working container's central processing unit usage rate, the memory size, the memory usage rate and the query rate per second of the working container; and using the performance data of the working container as the first performance data. This embodiment monitors the operating indicators of the Pod's working container through a monitoring container (for example, a listening container), and can obtain key performance indicators such as the container's CPU usage rate and memory usage rate. These tools can provide real-time data streams to help operation and maintenance personnel understand the operating status of the container.
[0073] S102, using a performance measurement method based on the second performance data, determine the standard computing power and the remaining available standard computing power of the migration node; wherein the standard computing power is a parameter that characterizes the performance of the node.
[0074] This embodiment does not limit the specific performance measurement method, as long as the measurement algorithm can determine the specification computing power of the migration node according to the second performance data. For example, this embodiment can use the unixbench tool (an open source tool for testing the basic performance of the server), and the specification computing power value of each node can be calculated through the tool. To determine the remaining available specification computing power of the node, this embodiment can use the total specification computing power of the node and then subtract the currently used computing power. In a computer system, especially in a cloud computing and data center environment, a node usually refers to an instance of a server or computing resource. Specification computing power refers to the maximum processing power of a node, including CPU, memory, storage, and network. To accurately calculate the remaining available specification computing power, the following steps are required: Collect total specification data: Obtain detailed specification information of the node, including the number of CPU cores, clock frequency, memory size, storage capacity, and network bandwidth. This data can usually be obtained in the technical documentation of the node or through system command queries. Monitor current usage: Use system monitoring tools to track the current resource usage of the node. This includes CPU usage, memory usage, disk I / O activity, and network traffic. Ensure that the monitoring tool can provide real-time data to accurately reflect the load status of the node. Calculate the used computing power: Based on the monitoring data, calculate the computing power currently being used by the node. For example, if the CPU utilization rate is 50%, it means that half of the CPU computing power is being used. A similar method can be used to calculate the usage ratio for memory, storage, and network resources. Consider concurrency requirements: When calculating the remaining computing power, you also need to consider possible concurrency requirements. If multiple tasks are expected to run simultaneously, sufficient resources should be reserved to avoid overload. Future load changes can be estimated through historical data analysis or predictive models.
[0075] It should be further explained that in order to improve the accuracy of determining the remaining available specification computing power, the above-mentioned determination of the specification computing power and the remaining available specification computing power of the migration node based on the second performance data using the performance measurement method may include: determining the specification computing power of the migration node based on the second performance data using the system performance testing tool; determining the ratio of the second performance data to the corresponding remaining performance data; determining the remaining available specification computing power based on the ratio, the second performance data and the specification computing power. It can be understood that a ratio can be obtained by comparing the second performance data with the corresponding remaining performance data. This ratio reflects the gap between the current performance data and the maximum performance of the system. For example, if the maximum CPU performance of the system is 100GHz and the current CPU utilization is 50GHz, then the ratio is 0.5.
[0076] Based on the above ratio, the second performance data and the standard computing power, the remaining available standard computing power can be calculated. Continuing with the above example, if the total CPU performance of the system is 100GHz and the current CPU usage is 50GHz, then the remaining available CPU performance is 50GHz. This means that without adding additional resources, the system can also handle an additional 50GHz of load.
[0077] It should be further explained that, in order to improve the accuracy of determining the standard computing power, the above-mentioned determination of the standard computing power and the remaining available standard computing power of the migration node by using the performance measurement method based on the second performance data may include:
[0078] Obtaining performance measurement tools corresponding to different performance data in the second performance data; wherein the performance measurement tools include at least two of a network performance measurement tool, a memory performance measurement tool, a central processing unit performance measurement tool, and a disk performance measurement tool;
[0079] Run the network performance measurement tool to measure the network computing power of each node corresponding to the virtual machine;
[0080] Run the memory performance measurement tool to measure the memory capacity of each node corresponding to the virtual machine;
[0081] Run the CPU performance measurement tool to measure the CPU performance of each node corresponding to the virtual machine.
[0082] Run the disk performance measurement tool to measure the computing power of the hard disk specifications of each node corresponding to the virtual machine;
[0083] The computing power of the network, memory, CPU, and hard disk corresponding to each node are added together to obtain the computing power of each migration node.
[0084] This embodiment takes into account various aspects of the specification computing power of each migration node, and adds them up, thereby improving the accuracy of determining the specification computing power of each migration node.
[0085] It should be further explained that, in order to improve the accuracy of determining the specification computing power, the above-mentioned determination of the specification computing power of the migration node based on the second performance data using the system performance test tool can include: using multiple system performance test tools to determine multiple specification computing powers of the migration node, and determining the specification computing power that appears the most times among the multiple specification computing powers as the final specification computing power, or taking the average of the multiple specification computing powers as the final specification computing power. Since when determining the specification computing power, not only the specification computing power determined by one system performance test tool is considered, but the final specification computing power is determined by comprehensively considering multiple specification computing powers, the accuracy of determining the specification computing power can be improved.
[0086] S103: Select a node from the migration nodes as a target migration node according to the remaining available computing power.
[0087] When selecting a node as a target migration node from the migration nodes according to the remaining available specification computing power, this embodiment may determine the node with the largest remaining available specification computing power as the target migration node. Alternatively, this embodiment may also select a node as a target migration node from the migration nodes according to the remaining available specification computing power and the current actual running load.
[0088] It should be further explained that the above-mentioned selecting a node from the migration nodes as the target migration node according to the remaining available specification computing power may include: sorting the nodes according to the remaining available specification computing power, determining the node with the largest remaining available specification computing power; and using the node with the largest remaining available specification computing power as the target migration node. This embodiment directly uses the node with the largest remaining available specification computing power as the target migration node, thereby improving the accuracy of determining the target migration node.
[0089] S104, determining the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node; wherein the relative application computing power refers to the application computing power value determined based on the specification computing power and performance data of the same configured minimum schedulable unit at different nodes.
[0090] The relative application computing power in this embodiment refers to the application computing power value calculated based on the specification computing power and various computing power indicators of the same configured working containers at different nodes. The higher the relative application computing power, the higher the working container performance indicator. This embodiment is not limited to determining the target migration node based on the first performance data and the specification computing power of the target migration node. For example, it can be (working container QPS*(corresponding node specification computing power)) / ((working container CPU size*CPU usage)*(memory size*memory usage)). When there are other performance parameters, other parameters can be added to the denominator. The parameters used in this embodiment are the specification computing power of the target migration node. The first performance data includes the working container QPS, the working container CPU size, and the working container memory size. The working container in this embodiment is the working container corresponding to the Pod.
[0091] It should be further explained that, in order to improve the accuracy of determining the relative application computing power, the above-mentioned determination of the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node may include: determining the relative application computing power based on the first performance data and the specification computing power of the target migration node using the relative application computing power calculation method; wherein the relative application computing power calculation method is (working container QPS*(corresponding node specification computing power)) / ((working container CPU size*CPU usage)*(memory size*memory usage)). This embodiment provides a specific calculation formula for the relative application computing power calculation method.
[0092] S105, determining configuration information of the minimum schedulable unit to be migrated based on the relative application computing power, migrating the minimum schedulable unit to be migrated to the target migration node, and configuring the minimum schedulable unit to be migrated based on the configuration information.
[0093] After determining the relative application computing power, this embodiment can determine the relative application computing power of the historical fault node, and based on the ratio of the relative application computing power of the historical fault node and the relative application computing power of the target migration node, determine the configuration information of the minimum schedulable unit to be migrated corresponding to the configuration information of the historical fault node.
[0094] It should be further explained that the above-mentioned determination of the configuration information of the minimum schedulable unit to be migrated based on the relative application computing power may include: determining the relative application computing power of the node before migration corresponding to the minimum schedulable unit to be migrated; the relative application computing power ratio based on the relative application computing power of the target migration node and the relative application computing power of the node before migration; determining the configuration information of the minimum schedulable unit to be migrated based on the relative application computing power ratio and the configuration information of the working container before migration. This embodiment can calculate the CPU and memory size that the Pod should be configured with after being scheduled to the new node based on the calculated specification computing power of each node and the relative application computing power of the working container. The accuracy of the configuration information determination is improved.
[0095] A minimum schedulable unit migration method provided by an embodiment of the present invention may include: S101, using the performance data of the minimum schedulable unit to be migrated as the first performance data, and using the performance data of the migration node as the second performance data; S102, using the performance measurement method based on the second performance data to determine the specification computing power and the remaining available specification computing power of the migration node; wherein the specification computing power is a parameter characterizing the performance of the node; S103, selecting a node from the migration nodes as the target migration node according to the remaining available specification computing power; S104, determining the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node; wherein the relative application computing power refers to the application computing power value determined based on the specification computing power and performance data of the same configured minimum schedulable unit at different nodes; S105, determining the configuration information of the minimum schedulable unit to be migrated based on the relative application computing power, migrating the minimum schedulable unit to be migrated to the target migration node, and configuring the minimum schedulable unit to be migrated based on the configuration information. Compared with the current method of directly migrating the Pod from the faulty node to the non-faulty node, the CPU and memory required by the Pod may not be able to meet the basic operation of the Pod itself in the new node. In the present invention, a node is selected from the migration nodes as the target migration node according to the remaining available specification computing power of the non-faulty node, and when performing the migration, the configuration information of the minimum schedulable unit to be migrated is determined based on the relative application computing power, so that the new node can meet the operation computing power requirements of the Pod.
[0096] In order to make the present invention easier to understand, please refer to Figure 2 , Figure 2 An example flow chart of a minimum schedulable unit migration method provided in an embodiment of the present invention may specifically include:
[0097] S201, through the sidecar (microservice architecture mode) mode, a listening container is injected into the one-cloud-multi-core application Pod, and the listening container collects the performance indicator information of the working container; the performance indicator information includes the CPU, memory usage and QPS of the working container.
[0098] For easier understanding, please refer to Figure 3 , Figure 3An overall architecture diagram of the minimum schedulable unit migration provided for an embodiment of the present invention. Among them, node represents a node, and amd64 represents a 64-bit computing standard based on the x86 architecture. In this embodiment, each Pod corresponds to a node. In this embodiment, a monitoring container is injected into the working container running on each node. The main functions implemented by the monitoring container are: first: collecting the operating indicators of the working container and reporting the operating indicators of the working container. The performance data of the Pod can be determined; second: monitoring the status of the current working container, and continuing the life cycle management of the Pod (for example, destruction and reconstruction, etc.). When the working container fails, the Pod is destroyed and rebuilt. After the Pod is running, the monitoring container periodically collects the indicator information of the working container and reports it to the controller at the control level.
[0099] When a Pod is created, the monitoring container is injected into the working container by injecting the monitoring container, such as based on the Mutating AdmissionWebhook mode in k8s (a mechanism used to intercept and modify resource requests in Kubernetes, which can verify and modify resources before they are stored in the API server). This allows the working container to be associated with the monitoring container. The entire process is as follows: Figure 4 As shown, Figure 4 A schematic diagram of a monitoring container operation provided for an embodiment of the present invention, wherein apiVersion indicates that the receiving server of the request is apps / v1; kind indicates a description file corresponding to Pod; metasdata indicates metadata; name indicates a noun abc; Selector generally refers to a mode or condition for selecting or filtering data; Template generally refers to a predefined format or structure; webhook indicates the image used, and etcd is a distributed key-value storage system for sharing configuration data and service discovery.
[0100] S202, defining a controller, wherein the controller receives performance indicator information reported by the monitoring container, as well as basic information and indicators of each node.
[0101] The controller establishes a heartbeat connection with each node, and obtains the resource information of the node in real time, including basic information, indicators (such as CPU, memory model, CPU, memory indicators, CPU, total memory, available amount, total amount) and status information. The functions of the controller in this embodiment are mainly: first, receiving the performance indicator information of the working container reported by the monitoring container; second, collecting the basic information of each node (CPU information, memory information, architecture, main frequency, etc.), and calculating the specification computing power of each node; third, determining the relative application computing power based on the performance indicator line of the working container and the specification computing power of the node. This embodiment does not limit the specific basic information and indicators of each node. As long as the basic information and indicators can determine the specification computing power of the node, the basic information and indicators can be determined based on the information required by the specification computing power tool.
[0102] S203, calculating the specification computing power of each node and the remaining available specification computing power based on the basic information and indicators of the node.
[0103] The standard computing power of this embodiment can be calculated by using the unixbench tool (an open source tool for testing the basic performance of a server) to calculate the standard computing power value of each node.
[0104] S204, based on the performance indicator information of the Pod and the specification computing power of the node, calculate the related application computing power.
[0105] Relative application computing power: the application computing power value calculated based on the specification computing power and various computing power indicators of the same configuration of working containers on different nodes. The higher the relative application computing power, the higher the performance indicator of the working container. The calculation method is: (working container QPS*(corresponding node specification computing power)) / ((container CPU size*CPU usage)*(memory size*memory usage)).
[0106] S205, determining a schedulable node according to the remaining available specification computing power, and adjusting the configuration of the Pod based on the relevant application computing power when the Pod is rescheduled.
[0107] When the Pod is rescheduled in this embodiment, the schedulable nodes are first selected according to the remaining computing power of each node, and the optimal scheduling node is selected according to the remaining computing power. For easier understanding, please refer to Figure 5 , Figure 5 A schematic diagram of determining an optimal scheduling node provided by an embodiment of the present invention, wherein the optimal scheduling node corresponds to the target migration described above, Figure 5The Scheduler in is a system software component used to manage and allocate computing resources. The controller maliciously filters nodes based on the remaining computing power of each node, and returns the optimal scheduling node based on the size of the remaining computing power. When the optimal scheduling node is selected, the k8s controller re-initiates the Pod creation request, and at the same time intercepts the corresponding creation request based on the webhook mode, and modifies the cpu and memory configuration in the Pod based on the corresponding running computing power of the node. Complete the creation process. The corresponding process is as follows Figure 6 As shown, Figure 6 A schematic diagram of configuration information modification provided by an embodiment of the present invention, from Figure 6 It can be seen that by sending a Pod binding node request to modify the CPU and memory indicators, the controller request is sent to the kubelet of each node to realize the creation and configuration of the Pod on the information node.
[0108] The embodiment of the present invention designs a migration device for computing power such as working containers after a node failure in a one-cloud multi-core container cluster, and obtains operating indicators by injecting a listener into the working container. The controller calculates the operating computing power of the working container relative to the node based on the node status and the operating indicators of the working container. When the Pod fails to migrate, the scheduler selects the optimal scheduling node for the Pod and configures the resource specifications of the corresponding working container based on the node information. Through this solution, when the node where the working container is located fails, the Pod can be migrated to other architecture nodes for normal operation and the computing power is kept unchanged, providing users with a consistent experience under multiple architectures.
[0109] The following is an introduction to a minimum schedulable unit migration device provided in an embodiment of the present invention. The minimum schedulable unit migration device described below and the minimum schedulable unit migration method described above can be referred to each other.
[0110] Figure 7 A structural schematic diagram of a minimum schedulable unit migration device provided in an embodiment of the present invention may include:
[0111] A performance data determination module 100, configured to use the performance data of the minimum schedulable unit to be migrated as the first performance data, and use the performance data of the migration node as the second performance data;
[0112] A specification computing power determination module 200 is used to determine the specification computing power and the remaining available specification computing power of the migration node based on the second performance data using a performance measurement method; wherein the specification computing power is a parameter characterizing the performance of the node;
[0113] A target migration node determination module 300, configured to select a node from the migration nodes as a target migration node according to the remaining available specification computing power;
[0114] A relative application computing power determination module 400 is used to determine the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node; wherein the relative application computing power refers to the application computing power value determined based on the specification computing power and performance data of the same configured minimum schedulable unit at different nodes;
[0115] The minimum schedulable unit migration module 500 is used to determine the configuration information of the minimum schedulable unit to be migrated based on the relative application computing power, migrate the minimum schedulable unit to be migrated to the target migration node, and configure the minimum schedulable unit to be migrated based on the configuration information.
[0116] Further, based on the above embodiment, the performance data determination module 100 may include:
[0117] A working container performance data determination unit, used to receive the performance data of the working container corresponding to the minimum schedulable unit to be migrated reported by the monitoring container; wherein the performance data of the working container includes the size of the working container CPU, the CPU usage rate of the working container, the memory size, the memory usage rate and the query rate per second of the working container;
[0118] The first performance data determining unit is used to use the performance data of the working container as the first performance data.
[0119] Further, based on any of the above embodiments, the above specification computing power determination module 200 may include:
[0120] a standard computing power determining unit, configured to determine the standard computing power of the migration node using a system performance testing tool based on the second performance data;
[0121] a ratio determination unit, configured to determine a ratio of the second performance data to the corresponding remaining performance data;
[0122] The remaining available standard computing power determining unit is used to determine the remaining available standard computing power based on the ratio, the second performance data and the standard computing power.
[0123] Further, based on the above embodiment, the above target migration node determination module 300 may include:
[0124] A unit for determining a node with the largest remaining available computing power, used to sort the nodes according to the remaining available computing power and determine the node with the largest remaining available computing power;
[0125] The target migration node determination unit is used to select the node with the largest remaining available computing power as the target migration node.
[0126] Further, based on the above embodiment, the above relative application computing power determination module 400 may include:
[0127] The relative application computing power determination unit is used to determine the relative application computing power based on the first performance data and the specification computing power of the target migration node using the relative application computing power calculation method; wherein the relative application computing power calculation method is (working container QPS*(corresponding node specification computing power)) / ((working container CPU size*CPU usage)*(memory size*memory usage)).
[0128] Further, based on any of the above embodiments, the minimum schedulable unit migration module 500 may include:
[0129] A relative application computing power determination unit, used to determine the relative application computing power of the pre-migration node corresponding to the minimum schedulable unit to be migrated;
[0130] A relative application computing power ratio determination unit, configured to determine a relative application computing power ratio based on a relative application computing power of the target migration node and a relative application computing power of the node before migration;
[0131] A configuration information determination unit is used to determine the configuration information of the minimum schedulable unit to be migrated based on the relative application computing power ratio and the configuration information of the working container before migration.
[0132] Further, based on any of the above embodiments, the above specification computing power determination module 200 may include:
[0133] A performance measurement tool acquisition unit, used to acquire performance measurement tools corresponding to different performance data in the second performance data; wherein the performance measurement tools include at least two of a network performance measurement tool, a memory performance measurement tool, a central processing unit performance measurement tool and a disk performance measurement tool;
[0134] A first specification computing power determination unit is used to run the network performance measurement tool to measure the specification computing power of the network under the virtual machine corresponding to each node;
[0135] The second specification computing power determination unit is used to run the memory performance measurement tool to measure the specification computing power of the memory under the virtual machine corresponding to each node;
[0136] A third specification computing power determination unit is used to run the central processing unit performance measurement tool to measure the specification computing power of the central processing unit under the virtual machine corresponding to each node;
[0137] The fourth specification computing power determination unit is used to run the disk performance calculation tool to calculate the specification computing power of the hard disk under the virtual machine corresponding to each node;
[0138] The final specification computing power determination unit is used to add the specification computing power of the network, the specification computing power of the memory, the specification computing power of the central processing unit and the specification computing power of the hard disk corresponding to each node to obtain the specification computing power of each migration node.
[0139] It should be noted that the order of the modules and units in the above minimum schedulable unit migration device can be changed without affecting the logic.
[0140] Figure 7 The description of the features in the corresponding embodiments can be found in Figure 7 The relevant descriptions of the corresponding embodiments will not be repeated here one by one.
[0141] The minimum schedulable unit migration device provided in an embodiment of the present invention may include: a performance data determination module 100, which is used to use the performance data of the minimum schedulable unit to be migrated as the first performance data, and the performance data of the migration node as the second performance data; a specification computing power determination module 200, which is used to determine the specification computing power and the remaining available specification computing power of the migration node based on the second performance data using a performance measurement method; wherein the specification computing power is a parameter characterizing the performance of the node; a target migration node determination module 300, which is used to select a node from the migration nodes as the target migration node according to the remaining available specification computing power; a relative application computing power determination module 400, which is used to determine the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node; wherein the relative application computing power refers to the application computing power value determined based on the specification computing power and performance data of the same configured minimum schedulable unit at different nodes; a minimum schedulable unit migration module 500, which is used to determine the configuration information of the minimum schedulable unit to be migrated based on the relative application computing power, migrate the minimum schedulable unit to be migrated to the target migration node, and configure the minimum schedulable unit to be migrated based on the configuration information. Compared with the current method of directly migrating the Pod from the faulty node to the non-faulty node, the CPU and memory required by the Pod may not be able to meet the basic operation of the Pod itself in the new node. In the present invention, a node is selected from the migration nodes as the target migration node according to the remaining available specification computing power of the non-faulty node, and when performing the migration, the configuration information of the minimum schedulable unit to be migrated is determined based on the relative application computing power, so that the new node can meet the operation computing power requirements of the Pod.
[0142] A minimum schedulable unit migration device provided by an embodiment of the present invention is introduced below. The minimum schedulable unit migration device described below and the minimum schedulable unit migration method described above can be referred to each other.
[0143] Figure 8A structural diagram of a minimum schedulable unit migration device provided by an embodiment of the present invention, such as Figure 8 As shown, the minimum schedulable unit migration device may include: a memory 60 for storing a computer program;
[0144] The processor 61 is used to implement the steps of the minimum schedulable unit migration method in the above embodiment when executing a computer program.
[0145] The minimum schedulable unit migration device provided in this embodiment may include but is not limited to a smart phone, a tablet computer, a laptop computer, or a desktop computer.
[0146] Among them, the processor 61 may include one or more processing cores, such as a 4-core processor, an 8-core processor, etc. The processor 61 can be implemented in at least one hardware form of digital signal processing (DSP), field-programmable gate array (FPGA), and programmable logic array (PLA). The processor 61 may also include a main processor and a coprocessor. The main processor is a processor for processing data in the awake state, also known as a central processing unit (CPU); the coprocessor is a low-power processor for processing data in the standby state. In some embodiments, the processor 61 may be integrated with a graphics processing unit (GPU), and the GPU is responsible for rendering and drawing the content to be displayed on the display screen. In some embodiments, the processor 61 may also include an artificial intelligence (AI) processor, which is used to process computing operations related to machine learning.
[0147] The memory 60 may include one or more readable storage media, which may be non-transitory. The memory 60 may also include a high-speed random access memory, and a non-volatile memory, such as one or more disk storage devices, flash memory storage devices. In this embodiment, the memory 60 is at least used to store the following computer program 601, wherein, after the computer program is loaded and executed by the processor 61, the relevant steps of the minimum schedulable unit migration method disclosed in any of the aforementioned embodiments can be implemented. In addition, the resources stored in the memory 60 may also include an operating system 602 and data 603, etc., and the storage method may be temporary storage or permanent storage. Among them, the operating system 602 may include Windows, Unix, Linux, etc. Data 603 may include but is not limited to data required for the migration of the minimum schedulable unit, etc.
[0148] In some embodiments, the minimum dispatchable unit migration device may further include a display screen 62 , an input and output interface 63 , a communication interface 64 , a power supply 65 , and a communication bus 66 .
[0149] Those skilled in the art will understand that Figure 8 The structure shown in the figure does not constitute a limitation on the minimum dispatchable unit migration device, and may include more or fewer components than shown in the figure.
[0150] It is understandable that if the minimum schedulable unit migration method in the above embodiment is implemented in the form of a software functional unit and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the current technology or all or part of the technical solution can be embodied in the form of a software product. The computer software product is stored in a storage medium and executes all or part of the steps of the methods of each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM), random access memory (RAM), electrically erasable programmable ROM, register, hard disk, removable disk, CD-ROM, magnetic disk or optical disk and other media that can store program code.
[0151] Based on this, an embodiment of the present invention further provides a readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the minimum schedulable unit migration method as described above are implemented.
[0152] The above is a detailed introduction to a minimum schedulable unit migration device provided by an embodiment of the present invention. The various embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same and similar parts between the various embodiments can be referred to each other. For the device disclosed in the embodiment, since it corresponds to the method disclosed in the embodiment, the description is relatively simple, and the relevant parts can be referred to the method part description.
[0153] Professionals may further appreciate that the units and algorithm steps of each example described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of the two. In order to clearly illustrate the interchangeability of hardware and software, the composition and steps of each example have been generally described in the above description according to function. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the technical solution. Professionals and technicians may use different methods to implement the described functions for each specific application, but such implementation should not be considered to be beyond the scope of the present invention.
[0154] The present invention also provides a computer program product, including a computer program / instruction, which implements the steps of the above minimum schedulable unit migration method when executed by a processor.
[0155] The above is a detailed introduction to a minimum scheduling unit migration method, device, equipment and readable storage medium provided by the present invention. Specific examples are used in this article to illustrate the principles and implementation methods of the present invention. The description of the above embodiments is only used to help understand the method of the present invention and its core idea. It should be pointed out that for ordinary technicians in this technical field, without departing from the principles of the present invention, several improvements and modifications can be made to the present invention, and these improvements and modifications also fall within the scope of protection of the claims of the present invention.
Claims
1. A minimum schedulable unit migration method, characterized in that: include: Using the performance data of the minimum schedulable unit to be migrated as the first performance data, and using the performance data of the migration node as the second performance data; Determine the standard computing power and the remaining available standard computing power of the migration node based on the second performance data using a performance measurement method; wherein the standard computing power is a parameter characterizing the performance of the node; Selecting a node from the migration nodes as a target migration node according to the remaining available computing capacity; Determine the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node; wherein the relative application computing power refers to the application computing power value determined based on the specification computing power and performance data of the minimum schedulable unit with the same configuration at different nodes; The configuration information of the minimum schedulable unit to be migrated is determined based on the relative application computing power, the minimum schedulable unit to be migrated is migrated to the target migration node, and the minimum schedulable unit to be migrated is configured based on the configuration information.
2. The minimum schedulable unit migration method according to claim 1, characterized in that: The step of using the performance data of the smallest schedulable unit to be migrated as the first performance data includes: Receive the performance data of the working container corresponding to the minimum schedulable unit to be migrated reported by the monitoring container; wherein the performance data of the working container includes the size of the central processing unit of the working container, the utilization rate of the central processing unit of the working container, the memory size, the memory utilization rate and the query rate per second of the working container; The performance data of the working container is used as the first performance data.
3. The minimum schedulable unit migration method according to claim 1, characterized in that: Determining the specification computing power and the remaining available specification computing power of the migration node based on the second performance data using a performance measurement method includes: Determine the specification computing power of the migration node using a system performance testing tool based on the second performance data; determining a ratio of the second performance data to the corresponding remaining performance data; The remaining available standard computing power is determined based on the ratio, the second performance data and the standard computing power.
4. The minimum schedulable unit migration method according to claim 1, characterized in that: Selecting a node from the migration nodes as a target migration node according to the remaining available specification computing power includes: Sort the nodes according to the remaining available computing power, and determine the node with the largest remaining available computing power; The node with the largest remaining available computing power is used as the target migration node.
5. The minimum schedulable unit migration method according to any one of claims 1 to 4, characterized in that: Determining the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node includes: The relative application computing power is determined based on the first performance data and the specification computing power of the target migration node using the relative application computing power calculation method; wherein the relative application computing power calculation method is (working container QPS*(corresponding node specification computing power)) / ((working container CPU size*CPU usage)*(memory size*memory usage)).
6. The minimum schedulable unit migration method according to claim 1, characterized in that: Determining configuration information of a minimum schedulable unit to be migrated based on the relative application computing power includes: Determine the relative application computing power of the pre-migration node corresponding to the minimum schedulable unit to be migrated; A relative applied computing power ratio based on the relative applied computing power of the target migration node and the relative applied computing power of the node before migration; The configuration information of the minimum schedulable unit to be migrated is determined based on the relative application computing power ratio and the configuration information of the working container before migration.
7. The minimum schedulable unit migration method according to claim 1, characterized in that: Determining the specification computing power and the remaining available specification computing power of the migration node based on the second performance data using a performance measurement method includes: Obtaining performance measurement tools corresponding to different performance data in the second performance data; wherein the performance measurement tools include at least two of a network performance measurement tool, a memory performance measurement tool, a central processing unit performance measurement tool, and a disk performance measurement tool; Run the network performance measurement tool to measure the computing power of the network under the virtual machine corresponding to each node; Run the memory performance measurement tool to measure the memory capacity of each node corresponding to the virtual machine. Run the CPU performance measurement tool to measure the CPU performance of each node in the virtual machine. Run the disk performance calculation tool to calculate the specification computing power of the hard disk under the virtual machine corresponding to each node; The specification computing power of the network, the specification computing power of the memory, the specification computing power of the central processing unit and the specification computing power of the hard disk corresponding to each node are added together to obtain the specification computing power of each migration node.
8. A minimum schedulable unit migration device, characterized in that: include: a performance data determination module, configured to use the performance data of the minimum schedulable unit to be migrated as the first performance data, and use the performance data of the migration node as the second performance data; A specification computing power determination module, configured to determine the specification computing power and the remaining available specification computing power of the migration node based on the second performance data using a performance measurement method; wherein the specification computing power is a parameter characterizing the performance of the node; A target migration node determination module, configured to select a node from the migration nodes as a target migration node according to the remaining available specification computing power; A relative application computing power determination module, used to determine the relative application computing power of the target migration node based on the first performance data and the specification computing power of the target migration node; wherein the relative application computing power refers to the application computing power value determined based on the specification computing power and performance data of the minimum schedulable unit with the same configuration at different nodes; The minimum schedulable unit migration module is used to determine the configuration information of the minimum schedulable unit to be migrated based on the relative application computing power, migrate the minimum schedulable unit to be migrated to the target migration node, and configure the minimum schedulable unit to be migrated based on the configuration information.
9. A minimum schedulable unit migration device, characterized in that: include: Memory for storing computer programs; A processor, configured to execute the computer program to implement the steps of the minimum schedulable unit migration method as claimed in any one of claims 1 to 7.
10. A readable storage medium, characterized in that: The readable storage medium stores a computer program, and when the computer program is executed by a processor, the steps of the minimum schedulable unit migration method according to any one of claims 1 to 7 are implemented.
