Method for optimizing CPU resource utilization rate of vpp high-availability main and standby cluster

By converting the standby node from poll to interrupt mode and back during master-slave switches, the method optimizes CPU resource utilization in VPP high-availability clusters, ensuring efficient data forwarding and reducing idle CPU usage.

CN119166302APending Publication Date: 2024-12-20CHINA ELECTRONICS CLOUD DIGITAL INTELLIGENCE TECH CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202411215879.1
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-09-02
Publication Date
2024-12-20

AI Technical Summary

Technical Problem

In VPP high-availability clusters, the standby node is idle in poll mode, leading to a waste of CPU resources due to full occupation despite not handling user traffic, while the active node continues to process user-related traffic.

Method used

Convert the standby node from poll mode to interrupt mode under normal conditions and switch back to poll mode during a master-slave switch, optimizing CPU resource utilization by enabling efficient data forwarding.

Benefits of technology

Ensures efficient user traffic forwarding and significantly optimizes CPU utilization by allowing the standby node to take over user data forwarding during mode transitions, reducing idle CPU usage.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119166302A_ABST
    Figure CN119166302A_ABST
Patent Text Reader

Abstract

The invention relates to a method for optimizing the utilization rate of vpp high-availability main and standby cluster cpu resources. In the method, a main node of the vpp high-availability cluster runs in a poll mode, a standby node is converted from a normal poll mode to an interrupt mode, the session data of the main node is synchronized through the interrupt mode, and after the main node and the standby node are switched, the standby node is switched back to the poll mode from the interrupt mode and replaces the main node to forward user data. And the main node is switched from the poll mode to the interrupt mode. By adjusting the operation mode of the standby node in the vpp cluster, efficient forwarding of user flow data can be guaranteed, and the CPU resource utilization rate of the whole vpp high-availability main and standby clusters is remarkably optimized.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the technical field of CPU resource optimization and utilization methods, and in particular to a method and system for optimizing CPU resource utilization of a VPP high-availability active-standby cluster. Background Art

[0002] All nodes in the vpp cluster, including the master and backup nodes, run in poll mode (the so-called poll mode means that a specific CPU keeps actively doing something, and the CPU usage rate is fully occupied during this process).

[0003] like Figure 1 As shown, the master node is responsible for processing user-related traffic, while the slave node is responsible for synchronizing user-related session information from the master node. When the master-slave switch occurs, the slave node switches to the master node. Since the relevant session information has been synchronized before, the standby node (slave node) can ensure that the current user connection continues without interruption.

[0004] The disadvantage of the above solution is that under normal circumstances, the standby node does not undertake the task of forwarding user traffic and is only responsible for synchronizing session data. Therefore, it is idle in most cases. However, due to the poll mode, it is still fully occupied, resulting in a waste of CPU resources. Summary of the invention

[0005] In order to solve the above problems existing in the use of CPU resources in the existing VPP cluster, the present invention proposes a new method for optimizing the CPU resource utilization rate of the VPP high-availability active-standby cluster. The method optimizes the CPU resource utilization rate of the entire active-standby cluster by adjusting the operating mode of the standby node in the VPP cluster.

[0006] In this method, the standby node of the vpp high-availability cluster is converted from the poll mode in normal conditions to the interrupt mode, and then switches back to the poll mode after the active-standby switch occurs. Figure 2 As shown in the figure, the master node is still running in poll mode, but the standby node is running in interrupt mode. This ensures that the standby node can synchronize the master node session information normally and that the CPU does not run idle when in idle state. Figure 3 As shown in FIG. 1 , the standby node switches from the original interrupt mode to the poll mode to take over the primary node to efficiently forward user data, while the primary node switches from the poll mode to the interrupt mode.

[0007] Specifically, the present invention provides a method for optimizing the CPU resource utilization rate of a VPP high-availability master-slave cluster. In this method, the master node of the VPP high-availability cluster runs in poll mode, the standby node is converted from the poll mode under normal circumstances to the interrupt mode, and the master node session data is synchronized through the interrupt mode. When the master-slave switching occurs, the standby node switches from the interrupt mode back to the poll mode, takes over the master node to forward user data, and the master node switches from the poll mode to the interrupt mode.

[0008] like Figure 6 As shown, the method comprises the following steps:

[0009] S1. Node A and Node B form a vpp high-availability cluster through the VRRP protocol. The service address provided by the cluster is VIP. In the initial state, Node A is the master node and Node B is the slave node (standby node);

[0010] S2. In the initial state, the master node A runs in poll mode and the slave node B runs in interrupt mode;

[0011] S3. After the master-slave switch occurs, the slave node B switches its operation mode from interrupt mode to poll mode, and configures the VIP address to its network card. At this time, node B becomes the master node and assumes the task of forwarding business traffic;

[0012] S4. Node A switches from poll mode to interrupt mode and removes the VIP address from its network card.

[0013] Furthermore, step S3 of the method for optimizing the CPU resource utilization rate of the vpp high-availability active-standby cluster of the present invention includes: when the master node A actively sends a master-standby switching message through vrrp or the slave node B fails to receive the vrrp message sent by the master node A for three consecutive times, the node B switches the data receiving mode of the node B network card from the interrupt mode to the poll mode through a library function rte_eth_dev_rx_intr_enable similar to dpdk, and configures the VIP address to its network card at the same time. At this time, the node B becomes the master node and undertakes the task of forwarding business traffic.

[0014] Furthermore, step S4 of the method for optimizing the CPU resource utilization rate of the vpp high-availability active-standby cluster of the present invention includes: node A switches the data receiving mode of the node A network card from the poll mode to the interrupt mode through a library function rte_eth_dev_rx_intr_disable similar to dpdk, and removes the VIP address from its network card.

[0015] On the other hand, the present invention also provides a system for optimizing the CPU resource utilization rate of a VPP high-availability active-standby cluster. When the system is running, the steps of the above-mentioned method for optimizing the CPU resource utilization rate of a VPP high-availability active-standby cluster are implemented.

[0016] In addition, the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the program is executed by a processor, the steps of the above-mentioned method for optimizing the CPU resource utilization rate of a VPP high-availability active-standby cluster are implemented.

[0017] In summary, the method for optimizing the CPU resource utilization rate of the VPP high-availability active-standby cluster of the present invention optimizes the CPU resource utilization rate of the entire active-standby cluster by adjusting the operation mode of the standby node in the VPP cluster. In this method, the standby node of the VPP high-availability cluster is converted from the poll mode under normal circumstances to the interrupt mode, and the session data of the master node is synchronized through the interrupt mode. After the active-standby switching occurs, the standby node switches from the interrupt mode back to the poll mode, and takes over the efficient forwarding of user data from the master node. This method can not only ensure the efficient forwarding of user traffic data, but also significantly optimize the CPU utilization rate of the entire VPP high-availability cluster. BRIEF DESCRIPTION OF THE DRAWINGS

[0018] In order to more clearly illustrate the prior art and the technical solutions of the present invention, the following briefly introduces the drawings required for use in the description of the present invention. Obviously, the following drawings are only some embodiments recorded in the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative work.

[0019] Figure 1 The figure is a schematic diagram of the operation mode of the master and standby nodes in the VPP cluster in the prior art (both the master and standby nodes are running in poll mode).

[0020] Figure 2 The schematic diagram is a schematic diagram of the operation mode of the master and standby nodes in the vpp cluster in the method of the present invention (the master node operates in poll mode and the standby node is in interrupt mode).

[0021] Figure 3 It is a schematic diagram of the operation mode of the master and standby nodes in the vpp cluster after the master-standby switch occurs in the method of the present invention (the standby node switches to the poll mode, and the master node switches to the interrupt mode).

[0022] Figure 4 The figure is a schematic diagram of the operation mode of the master and standby nodes in a vpp cluster according to an embodiment of the present invention (the master node operates in poll mode and the standby node is in interrupt mode).

[0023] Figure 5The diagram is a schematic diagram of the operation mode of the master and standby nodes in the vpp cluster after the master-standby switch occurs according to an embodiment of the present invention (the standby node switches to the poll mode, and the master node switches to the interrupt mode).

[0024] Figure 6 It is a schematic diagram of the implementation process of the method of the present invention. DETAILED DESCRIPTION

[0025] In order to make the purpose, technical solution and advantages of the present invention clearer, the technical solution of the present invention will be clearly and completely described below in conjunction with specific embodiments and corresponding drawings. Obviously, the described embodiments are only part of the embodiments of the present invention, not all of them. The present invention can also be implemented or applied through other different specific implementation methods. The details in this specification can also be modified or changed in various ways based on different viewpoints and applications without departing from the spirit of the present invention.

[0026] At the same time, it should be understood that the protection scope of the present invention is not limited to the specific embodiments described below; it should also be understood that the terms used in the embodiments of the present invention are for describing specific embodiments rather than for limiting the protection scope of the present invention.

[0027] Embodiment: A method for optimizing CPU resource utilization of a VPP high-availability active-standby cluster

[0028] 1) Node A and Node B form a vpp high-availability cluster through the VRRP protocol. Assume that the service address provided by the cluster is VIP. In the initial state, Node A is the master node and Node B is the slave node.

[0029] 2) If Figure 4 As shown, at this time, the master node A runs in poll mode and the slave node B runs in interrupt mode.

[0030] 3) If Figure 5 As shown in the figure, when the master node A actively sends a master-slave switching message through vrrp or the slave node B fails to receive the vrrp message sent by the master node A for three consecutive times, the node B switches the data receiving mode of the node B network card from the interrupt mode to the poll mode through the library function rte_eth_dev_rx_intr_enable similar to dpdk, and configures the VIP address to its network card. At this time, node B becomes the master node and assumes the task of forwarding business traffic.

[0031] 4) At the same time, node A switches the data receiving mode of node A's network card from poll mode to interrupt mode through a library function similar to dpdk, rte_eth_dev_rx_intr_disable, and removes the VIP address from its network card.

[0032] The above description is only a preferred embodiment of the present invention and does not limit the present invention in any form. Any technician familiar with the profession can make some changes or modifications to the technical contents disclosed above without departing from the scope of the technical solution of the present invention to obtain equivalent embodiments of equivalent changes. However, any simple modification, equivalent changes and modifications made to the above embodiments based on the technical essence of the present invention without departing from the content of the technical solution of the present invention should be included in the scope of protection of the claims of the present invention.

Claims

1. A method for optimizing the CPU resource utilization rate of a VPP high-availability active-standby cluster, characterized in that: In the method, the master node of the vpp high-availability cluster runs in poll mode, the standby node is converted from the normal poll mode to the interrupt mode, and synchronizes the master node session data through the interrupt mode. When the master-standby switch occurs, the standby node switches from the interrupt mode back to the poll mode, takes over the master node to forward user data, and the master node switches from the poll mode to the interrupt mode.

2. The method for optimizing the CPU resource utilization rate of a VPP high-availability active-standby cluster according to claim 1 is characterized in that: The method comprises: S1. Node A and Node B form a vpp high-availability cluster through the VRRP protocol. The service address provided by the cluster is VIP. In the initial state, Node A is the master node and Node B is the slave node. S2. In the initial state, the master node A runs in poll mode and the slave node B runs in interrupt mode; S3. After the master-slave switch occurs, the slave node B switches its operation mode from interrupt mode to poll mode, and configures the VIP address to its network card. At this time, node B becomes the master node and assumes the task of forwarding business traffic; S4. Node A switches from poll mode to interrupt mode and removes the VIP address from its network card.

3. The method for optimizing the CPU resource utilization rate of a VPP high-availability active-standby cluster according to claim 2 is characterized in that: Step S3 includes: when the master node A actively sends a master-slave switching message through vrrp or the slave node B fails to receive the vrrp message sent by the master node A for three consecutive times, the node B switches the data receiving mode of the node B network card from the interrupt mode to the poll mode through the library function rte_eth_dev_rx_intr_enable similar to dpdk, and configures the VIP address to its network card. At this time, the node B becomes the master node and undertakes the task of forwarding business traffic.

4. The method for optimizing the CPU resource utilization rate of a VPP high-availability active-standby cluster according to claim 2 is characterized in that: Step S4 includes: Node A switches the data receiving mode of the network card of Node A from the poll mode to the interrupt mode through a library function rte_eth_dev_rx_intr_disable similar to dpdk, and removes the VIP address from its network card.

5. A system for optimizing the CPU resource utilization rate of a VPP high-availability active-standby cluster, characterized in that: When the system is running, the steps of the method for optimizing the CPU resource utilization rate of the VPP high-availability active-standby cluster described in any one of claims 1-4 are implemented.

6. A computer-readable storage medium having a computer program stored thereon, wherein when the program is executed by a processor, the steps of the method for optimizing CPU resource utilization of a VPP high-availability active-standby cluster as described in any one of claims 1 to 4 are implemented.