Cluster shared traffic threshold-based rate limiting method and apparatus
Through the combination of cluster manager, node controller, bandwidth allocation scheduler and token bucket manager, the speed limit threshold of nodes and queues is dynamically adjusted, which solves the problem that traditional QOS methods are difficult to achieve flexible traffic speed limit in multi-node, multi-queue, and multi-core environments, and realizes fair allocation of traffic in the cluster and efficient utilization of resources.
Patent Information
- Application Number
- PCT/CN2024/136673
- Authority / Receiving Office
- WO · WO
- Patent Type
- Applications
- Current Assignee / Owner
- Priority Date
- 2023-12-14
- Filing Date
- 2024-12-04
- Publication Date
- 2025-08-21
AI Technical Summary
In a multi-node, multi-queue, and multi-core computer network cluster environment, traditional QOS methods are difficult to achieve flexible and efficient traffic speed limits, resulting in network congestion, performance degradation and resource waste, and it is impossible to effectively manage traffic resource allocation in the cluster.
The combination scheme of cluster manager, node controller, bandwidth allocation scheduler and token bucket manager is adopted, and traffic information is shared through multicast mechanism, the speed limit threshold of nodes and queues is dynamically adjusted, and the token bucket algorithm is used for real-time speed limit to ensure fair allocation and utilization of bandwidth resources.
Dynamic adjustment of traffic management and allocation within the cluster is realized, avoiding excessive traffic resource utilization of nodes or queues, improving network performance and resource utilization efficiency, and ensuring fair distribution of traffic within the cluster.
Smart Images

Figure CN2024136673_21082025_PF_FP_ABST
Abstract
Description
Cluster shared traffic threshold speed limiting method and device
[0001] Related applications
[0002] This application claims priority to Chinese patent application number 202311721740.X, filed on December 14, 2023, entitled “A method and device for limiting speed of cluster shared traffic thresholds,” the entire text of which is hereby incorporated by reference. Technical Field
[0003] The present application relates to the field of network technology, and in particular to a method and device for limiting the speed of a cluster shared traffic threshold. Background Art
[0004] In modern computer networks, cluster systems typically consist of multiple nodes. Each node processes packets using multiple queues, each bound to multiple CPU cores, independently and lock-free to improve packet processing performance. In this distributed environment, effectively implementing certain traffic rate limits within a cluster while ensuring network traffic quality and efficient resource utilization becomes a key challenge. Traditional QoS approaches struggle to provide flexible and efficient traffic rate limits in this multi-node, multi-queue, multi-core environment, leading to network congestion, performance degradation, and resource waste. Bandwidth limits cannot be set for the entire cluster. Summary of the Invention
[0005] Given the shortcomings of the above existing technologies, this application aims to propose a technology based on cluster-shared traffic rate limit thresholds to achieve effective traffic management across every node, queue, and CPU core in the cluster. The technical solution of this application can dynamically allocate traffic rate limit resources in a distributed environment to ensure that each node and queue can operate within a reasonable rate limit. At the same time, this technology can achieve fair distribution of traffic within the cluster, preventing a single node or queue from occupying too many traffic resources.
[0006] In a first aspect of the present application, a method for limiting the rate of a cluster shared traffic threshold is proposed, the method comprising:
[0007] S1: The cluster manager sends the cluster rate limit threshold of a specified data flow to each node in the network cluster and adds the forwarding process of each node to the multicast to share traffic information between nodes. The forwarding process in the node obtains the cluster rate limit threshold;
[0008] In step S2, the node controller counts and marks the traffic of the specified data flow flowing into the network card per second. It then sends the node's unique identifier and the network card traffic received per second via multicast to share with other nodes in the cluster. It then calculates the node speed limit quota threshold for the node based on the multicast messages received from the cluster.
[0009] S3: The bandwidth allocation scheduler allocates the core speed limit quota threshold for each node based on the bandwidth ratio of each processing queue traffic in the node forwarding process to the total node traffic;
[0010] In S4, the token bucket manager uses the token bucket algorithm to periodically and dynamically adjust the real-time data based on the ratio of traffic processed by each queue in the node to the total bandwidth of the node. It obtains the ratio of each queue in the cluster's speed-limited bandwidth and limits the traffic passing through the queue.
[0011] In some embodiments, when a node receives a multicast message sent by other nodes, the node unique identifier in the multicast message is compared with the node unique identifier of the node itself. If the comparison result is equal, the multicast message is ignored. If the comparison result is not equal, the multicast message is recorded and the node speed limit quota threshold of the node is calculated.
[0012] In some embodiments, the calculation formula of the node speed limit quota threshold is as follows: speed node i =speed cluster *traffic node i / ∑traffic node i
[0013] Among them, speed cluster Specifies the cluster rate limit threshold for data flow. node i The traffic volume of the specified data flow flowing into the node network card of node i within this second. i is the node number, ranging from 1 to N, and N is the number of cluster nodes.
[0014] In some embodiments, in step S3, the core speed limit quota threshold is calculated as follows: speednode(i)_lcore(n)=speed node(i) *trafficnode(i)_lcore(n) / ∑trafficnode(i)_lcore(n)
[0015] speednode(i)_lcore(n) is the traffic volume of the specified data flow flowing from node i to service core n within this second. i is the node number, ranging from 1 to N, where N is the maximum number of nodes in the cluster. n is the service core number, ranging from 1 to M, where M is the maximum number of service cores.
[0016] In a second aspect of the present application, a rate limiting device for a cluster-shared traffic threshold is proposed, which is used to implement the above method. The device includes a cluster manager and multiple nodes located in the same network cluster;
[0017] The cluster manager is connected to multiple nodes respectively, and is used to coordinate and manage the entire multi-node cluster, and set, adjust and issue cluster speed limit thresholds according to speed limit requirements;
[0018] A node controller is provided on each of the plurality of nodes and serves as a control main thread of the node forwarding process, and is used to monitor local bandwidth utilization and traffic;
[0019] The bandwidth allocation scheduler is set in the business core of the service process of each node to ensure fair allocation and efficient utilization of bandwidth resources;
[0020] The token bucket manager is set on the thread bound to each queue served by each node. It is used to limit the traffic passing through the queue using the token bucket algorithm to achieve speed limit for the entire cluster.
[0021] In some embodiments, the node controller counts local traffic data flowing into the network card every second and shares the local traffic data via multicast.
[0022] In some embodiments, sharing the local traffic data includes: the node controller sends the local traffic data to each node in the cluster via multicast, the node receives traffic data from other nodes in the cluster, and after excluding its own traffic data, calculates the node's own node speed limit quota threshold based on the traffic ratio.
[0023] In some embodiments, ensuring fair allocation and efficient utilization of bandwidth resources specifically includes: the bandwidth allocation scheduler determines the node speed limit quota threshold based on the traffic bandwidth ratio of the nodes in the cluster, and allocates the core speed limit quota threshold of each node based on the bandwidth ratio of the business core of each processing queue traffic in the node forwarding process to the total traffic of the node.
[0024] In some embodiments, the use of a token bucket algorithm to limit the speed of traffic passing through a queue specifically includes: the token bucket manager periodically and dynamically adjusts the real-time data of the ratio of traffic processed by each queue in the node to the total bandwidth of the node to obtain the ratio of each queue in the cluster speed-limited bandwidth.
[0025] In a third aspect of the present application, an electronic device is proposed, comprising: a memory unit and a processor unit, wherein a computer program is stored in the memory unit, and the processor unit implements the above method when executing the program.
[0026] The beneficial effects of this application are as follows: In the prior art, the traffic speed limit of a cluster is often only limited by the node, without dynamic adjustment according to the traffic, and it is often difficult to achieve accurate speed limit for the entire cluster. This application monitors the traffic bandwidth ratio in real time, effectively and quickly adjusts the speed limit quota between different cores (threads) of the same node process service, and between different nodes of the same cluster, determines the token bucket generation rate of each node and each queue to effectively limit the speed, regards the entire cluster as a logical token bucket, and implements it in a way that each core of each node has an independent token bucket, so as to achieve lock-free speed limit for the cluster without affecting the performance of the cause traffic processing. BRIEF DESCRIPTION OF THE DRAWINGS
[0027] The accompanying drawings are only for the purpose of illustrating specific embodiments and are not to be considered as limiting the present application. Throughout the drawings, the same reference numerals represent the same components. Obviously, the drawings described below are only some of the embodiments described in the present application. Those skilled in the art can also obtain other drawings based on these drawings.
[0028] FIG1 is a schematic structural diagram of a cluster controller according to an embodiment of the present application.
[0029] FIG2 is a schematic structural diagram of a node controller according to an embodiment of the present application.
[0030] FIG3 is a schematic diagram of a processing flow of a bandwidth allocation scheduler and a token bucket manager according to an embodiment of the present application. DETAILED DESCRIPTION
[0031] In order to enable those skilled in the art to better understand the technical solutions in the embodiments of the present application, the technical solutions of the present application will be clearly and completely described below in conjunction with the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present application, rather than all of the embodiments. It should be understood that these descriptions are merely exemplary and are not intended to limit the scope of the present application. Based on the embodiments of the present application, all other embodiments obtained by those of ordinary skill in the art without making creative work should fall within the scope of protection of this application.
[0032] Furthermore, in the following description, descriptions of well-known structures and technologies are omitted to avoid unnecessarily obscuring the concepts disclosed in this application.
[0033] In the description of this application, it should be noted that, unless otherwise expressly specified and limited, the terms "center", "up", "down", "left", "right", "vertical", "horizontal", "inside", "outside" and the like indicate orientations or positional relationships based on the orientations or positional relationships shown in the accompanying drawings, and are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on this application. In addition, the terms "first", "second" and "third" are used for descriptive purposes only and cannot be understood as indicating or implying relative importance. The terms "installed", "connected" and "connected" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or an indirect connection through an intermediate medium, or it can be a communication between the internal parts of two elements. For those of ordinary skill in the art, the specific meanings of the above terms in this application can be understood according to specific circumstances.
[0034] Exemplary embodiments will be described in detail herein, with examples illustrated in the accompanying drawings. In the following description, when referring to the drawings, identical numerals in different figures represent identical or similar elements, unless otherwise indicated. The embodiments described in the following exemplary embodiments are not intended to represent all embodiments consistent with the present application. Rather, they are merely examples of methods and systems consistent with certain aspects of the present application, as detailed in the appended claims.
[0035] The following first explains the meaning of the technical terms cited in the technical solution:
[0036] Cluster: refers to an architecture that connects multiple computers (also called nodes or servers) together to complete computing tasks together.
[0037] Node: A server node in a cluster refers to each independent computer or server in the cluster. Each node is an independent entity.
[0038] Quality of Service (QoS) refers to a network's ability to use various basic technologies to provide better service for specified network communications. It is a network security mechanism and a technology used to solve problems such as network delays and congestion.
[0039] Forwarding process: refers to the main service process running in the cluster node, which is responsible for forwarding data packets from one network node to another network node. Here, it is the host process implemented by the speed limiting method of this application.
[0040] In a first aspect, the present application proposes a rate limiting device for a cluster shared traffic threshold based on a token bucket algorithm, as shown in FIG1 , which includes a cluster manager and multiple nodes located in the same network cluster;
[0041] The cluster manager is connected to multiple nodes respectively, and is used to coordinate and manage the entire multi-node cluster, and set, adjust and issue cluster speed limit thresholds according to speed limit requirements;
[0042] A node controller is provided on each of the plurality of nodes and serves as a control main thread of the node forwarding process, and is used to monitor local bandwidth utilization and traffic;
[0043] The bandwidth allocation scheduler is set in the business core of the service process of each node to ensure fair allocation and efficient utilization of bandwidth resources;
[0044] The token bucket manager is set on the thread bound to each queue served by each node. It is used to limit the traffic passing through the queue using the token bucket algorithm, thereby achieving speed limit for the entire cluster.
[0045] The node controller counts the local traffic data flowing into the network card every second and shares the local traffic data through multicast;
[0046] Sharing the local traffic data includes: the node controller sending the local traffic data to each node in the cluster via multicast; the node receiving the traffic data from other nodes in the cluster, excluding its own traffic data, and calculating the node speed limit quota threshold of the node according to the traffic ratio;
[0047] Ensuring fair allocation and efficient utilization of bandwidth resources specifically includes: the bandwidth allocation scheduler determines the node speed limit quota threshold based on the traffic bandwidth ratio of the nodes in the cluster, and allocates the core speed limit quota threshold of each node based on the bandwidth ratio of the service core of each processing queue traffic in the node forwarding process to the total traffic of the node;
[0048] The token bucket algorithm is used to limit the speed of traffic passing through the queue, specifically including: the token bucket manager periodically and dynamically adjusts the proportion of traffic processed by each queue in the node to the total bandwidth of the node according to real-time data, to obtain the proportion of each queue in the cluster speed limit bandwidth;
[0049] In a second aspect, the present application proposes, in one embodiment, a method for cluster shared traffic thresholds based on a token bucket algorithm, the method comprising the following steps S1 to S4.
[0050] S1: The cluster manager sends the cluster rate limit threshold of the specified data flow to each node in the network cluster, and adds the forwarding process of each node to the multicast to share traffic information between nodes. The forwarding process in the node obtains the cluster rate limit threshold.
[0051] In the above steps, the cluster manager issues a certain traffic speed limit threshold, such as the traffic speed limit threshold of UDP, TCP-SYN, TCP-ACK, ICMP, etc. Here, the traffic threshold of the speed limit cluster TCP-SYN is the speed cluster (unit: bit / s) as an example, the forwarding process running on N nodes in the cluster obtains the cluster TCP-SYN traffic speed limit speed cluster , as shown in Figure 1.
[0052] In the above steps, this is achieved by adding the node's forwarding process to the multicast address, such as the multicast address 224.0.1.100.
[0053] S2: The node controller counts and marks the traffic of the specified data flow flowing into the network card per second, sends the node unique identifier and the network card traffic received per second through multicast to share with other nodes in the cluster, and calculates the node speed limit quota threshold of the node based on the multicast messages received from the cluster.
[0054] In the above steps, the node rate limit quota threshold is calculated based on the multicast packets received from the cluster. Specifically, the calculation includes:
[0055] When a node receives a multicast message from another node, it compares the node unique identifier in the multicast message with its own node unique identifier. If the comparison result is equal, the multicast message is ignored. If the comparison result is not equal, the multicast message is recorded and the node speed limit quota threshold of the node is calculated. The calculation formula is as follows: speed node i =speed cluster *traffic node i / ∑traffic node i
[0056] Among them, speed cluster Specifies the cluster rate limit threshold for data flow. node i The traffic volume of the specified data flow flowing into the node network card of node i within this second. i is the node number, ranging from 1 to N, and N is the number of cluster nodes.
[0057] Continuing with the example in the previous steps, the node forwarding process counts the TCP-SYN traffic flowing into the network card every second (by parsing all the network card queue traffic packets, judging that the transport layer protocol number in the IP packet is 6, which is TCP protocol traffic, and judging that the SYN bit of the Flag field in the TCP layer header is 1 and the other fields of the Flag are all 0, then the TCP-SYN traffic that meets the statistics is marked as traffic) node1 、traffic node2 、......traffic nodeN and uniquely identify the node ID nodeN And receive network card traffic per second nodeN It is sent out through multicast to share with other nodes in the cluster. When a node receives the multicast message received by other nodes, it will receive the unique node ID in the multicast message. nodeN Unique ID of this node nodeN If the comparison is equal, the multicast message is ignored and the ID is excluded from being sent by the node. The others are recorded and the traffic ratio of the node is calculated as the incremental TCP-SYN traffic flowing into the node network card within this second. nodei Divide by the sum of the incremental TCP-SYN traffic flowing into the network cards of all nodes in the cluster within this second ∑traffic nodei (i is the node number, ranging from 1 to N, where N is the number of cluster nodes), and the speed limit quota threshold for this node is calculated as speed node i =speed cluster *traffic node i / ∑traffic node i .
[0058] S3: The bandwidth allocation scheduler allocates the core speed limit quota threshold for each node based on the bandwidth ratio of each processing queue traffic in the node forwarding process to the total traffic of the node.
[0059] The calculation formula of the core speed limit quota threshold is as follows: speednode(i)_lcore(n)=speed node(i) *trafficnode(i)_lcore(n) / ∑trafficnode(i)_lcore(n)
[0060] speednode(i)_lcore(n) is the traffic volume of the specified data flow flowing from node i to service core n within this second. i is the node number, ranging from 1 to N, where N is the maximum number of nodes in the cluster. n is the service core number, ranging from 1 to M, where M is the maximum number of service cores.
[0061] In the above steps, continue to use the examples in the previous steps for explanation. Get the speed limit quota of TCP-SYN identified traffic flowing into each queue of each node network card: each network card queue n (n is the network card queue number, taking Intel network card 82599 as an example, the network card has 16 queues, and n ranges from 0 to 15) of the node forwarding process is independently assigned a business core thread to process lcore(n) and bound to CPU(n) for exclusive processing. The lcore(n) business core thread counts the corresponding TCP-SYN traffic flowing into the bound network card queue n every second (by parsing the queue n traffic message, judging that the transport layer protocol number in the IP message is 6 for TCP protocol traffic, judging that the SYN bit of the Flag field in the TCP layer header is 1 and the other fields of the Flag are all 0, then the TCP-SYN traffic that meets the statistics) is identified as trafficnode1_lcore1, trafficnode1_lcore2, trafficnode1_lcoreM, and the speed limit quota threshold of a business core traffic of each node can be calculated as speednode(i)_lcore(n)=speed node(i) *trafficnode(i)_lcore(n) / ∑trafficnode(i)_lcore(n).
[0062] S4: The token bucket manager uses a token bucket algorithm to periodically and dynamically adjust the traffic flow of each queue in the node based on the real-time data of the ratio of the traffic processed by each queue in the node to the total bandwidth of the node. It obtains the proportion of each queue in the cluster's speed-limited bandwidth and limits the traffic passing through the queue.
[0063] Among them, the bucket depth size of the token bucket lcore(i) =speednode(i)_lcore(n), token generation rate of the token bucket lcore(i) =speednode(i)_lcore(n), initialize the token number token in the token bucket lcore(i) =speednode(i)_lcore(n).
[0064] In the above steps, continue to use the examples in the previous steps for explanation. The lcore(n) thread creates or adjusts the token bucket for the traffic identified by TCP-SYN every second. The depth of the bucket is size lcore(i) =speednode(i)_lcore(n), bucket token generation rate lcore(i) =speednode(i)_lcore(n), initialize the token bucket token number token lcore(i) =speednode(i)_lcore(n), according to the token bucket algorithm, the length of each TCP-SYN message passing through the bucket pkt, the number of tokens generated per second rate lcore(i) , the bucket depth does not exceed size lcore(i) If the length of the token in the bucket is greater than length pkt Then pass and token = token-length pkt , length pkt If the length of the packet is greater than the token length, the packet will be discarded. The lcore(n) thread can limit the flow rate of the queue according to the dynamically adjusted speed limit quota every second, so that the TCP-SYN traffic configured by the cluster reaches the cluster speed limit, as shown in Figure 3. Every time a packet length is passed, the number of tokens in the bucket minus the message length is the total length of the remaining message that can pass. The token represents the current number of tokens in the bucket, which is a dynamic variable. lcore(i) Indicates the initial value of the token bucket when it is initialized.
[0065] When a node service exits abnormally or a new node is added, the node controller in the forwarding process can still make dynamic adjustments based on the multicast messages received within the periodic time.
[0066] In summary, this application uses a token bucket algorithm for flow control, combined with the communication and coordination mechanisms within the cluster. Through data exchange between the cluster manager and the node controller, this technology can monitor the flow of each node and queue in real time, and dynamically generate and allocate tokens based on the shared flow rate limit threshold within the cluster. At the same time, this application can also adaptively adjust the flow rate limit strategy based on the status of the nodes and queues within the cluster to adapt to different load conditions and demand changes.
[0067] In a third aspect, the present application proposes, in one embodiment, an electronic device comprising: a memory and one or more processors.
[0068] One or more application programs are stored in the memory, and the one or more application programs are suitable for being executed by the one or more processors to implement the method described in the first aspect.
[0069] The electronic device includes a processor and a memory, wherein the processor and the memory are connected, for example, via a bus.
[0070] The structure of the electronic device does not constitute a limitation to the embodiments of the present application.
[0071] A processor can be a CPU, a general-purpose processor, a DSP, an ASIC, an FPGA, or other programmable logic device, a transistor logic device, a hardware component, or any combination thereof. It can implement or execute the various exemplary logic blocks, modules, and circuits described in conjunction with the disclosure of this application. A processor can also be a combination that implements computing functions, such as a combination of one or more microprocessors, a combination of a DSP and a microprocessor, and the like.
[0072] A bus may include a path for transmitting information between the above components. A bus may be a PCI bus or an EISA bus, etc. A bus may be divided into an address bus, a data bus, a control bus, etc.
[0073] The memory may be a ROM or other type of static storage device that can store static information and instructions, a RAM or other type of dynamic storage device that can store information and instructions, or an EEPROM, CD-ROM or other optical disk storage, optical disc storage (including compact disc, laser disc, optical disc, digital versatile disc, Blu-ray disc, etc.), magnetic disk storage medium or other magnetic storage device, or any other medium that can be used to carry or store desired program code in the form of instructions or data structures and can be accessed by a computer, but is not limited to these.
[0074] In a fourth aspect, the present application proposes a computer-readable storage medium having a computer program stored thereon, which can be loaded by a processor and executed in accordance with the method described in the first aspect.
[0075] Those skilled in the art will appreciate that all or part of the processes in the above-mentioned embodiment methods can be implemented by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to memory, storage, database or other media used in the embodiments provided in this application may include at least one of non-volatile and volatile memory. Non-volatile memory may include read-only memory (ROM), magnetic tape, floppy disk, flash memory or optical memory, etc. Volatile memory may include random access memory (RAM) or external cache memory. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM).
[0076] The technical features of the above embodiments can be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0077] The above-described embodiments merely represent several implementation methods of the present application. While the descriptions are relatively specific and detailed, they should not be construed as limiting the scope of the present invention. It should be noted that a person skilled in the art could make various modifications and improvements without departing from the spirit of the present application, all of which fall within the scope of protection of the present application. Therefore, the scope of protection of the present patent application shall be determined by the appended claims.
Claims
1. A method for limiting the rate of a cluster shared traffic threshold, comprising: S1: The cluster manager sends the cluster rate limit threshold of a specified data flow to each node in the network cluster and adds the forwarding process of each node to the multicast to share traffic information between nodes. The forwarding process in the node obtains the cluster rate limit threshold; In step S2, the node controller counts and marks the traffic of the specified data flow flowing into the network card per second. It then sends the node's unique identifier and the network card traffic received per second via multicast to share with other nodes in the cluster. It then calculates the node speed limit quota threshold for the node based on the multicast messages received from the cluster. S3: The bandwidth allocation scheduler allocates the core speed limit quota threshold for each node based on the bandwidth ratio of each processing queue traffic in the node forwarding process to the total node traffic; In S4, the token bucket manager uses the token bucket algorithm to periodically and dynamically adjust the real-time data based on the ratio of traffic processed by each queue in the node to the total bandwidth of the node. It obtains the ratio of each queue in the cluster's speed-limited bandwidth and limits the traffic passing through the queue.
2. The method according to claim 1, wherein in step S2, calculating the node rate limit quota threshold of the node based on the multicast message received from the cluster comprises: When a node receives a multicast message from another node, it compares the node unique identifier in the multicast message with its own node unique identifier. If the comparison result is equal, the node ignores the multicast message. If the comparison result is unequal, the node records the multicast message and calculates the node rate limit quota threshold for the node.
3. The method according to claim 2, wherein the calculation formula of the node speed limit quota threshold is as follows: speed nodei =speed cluster *traffic nodei / ∑traffic nodei in, speed cluster Specifies the cluster rate limit threshold for data flow. nodei The traffic volume of the specified data flow flowing into the node network card of node i within this second. i is the node number, ranging from 1 to N, and N is the number of cluster nodes.
4. The method according to claim 1, wherein in step S3, the calculation formula of the core speed limit quota threshold is as follows: speednode(i)_lcore(n)=speed node(i) *trafficnode(i)_lcore(n) / ∑trafficnode(i)_lcore(n) in, speednode(i)_lcore(n) is the traffic volume of the specified data flow flowing from node i to service core n within this second. i is the node number, ranging from 1 to N, where N is the maximum number of nodes in the cluster. n is the service core number, ranging from 1 to M, where M is the maximum number of service cores.
5. A rate limiting device for a cluster-shared traffic threshold, the device comprising a cluster manager and multiple nodes located in the same network cluster; The cluster manager is connected to multiple nodes respectively, and is used to coordinate and manage the entire multi-node cluster, and set, adjust and issue cluster speed limit thresholds according to speed limit requirements; A node controller is provided on each of the plurality of nodes and serves as a control main thread of the node forwarding process, and is used to monitor local bandwidth utilization and traffic; The bandwidth allocation scheduler is set in the business core of the service process of each node to ensure fair allocation and efficient utilization of bandwidth resources; The token bucket manager is set on the thread bound to each queue served by each node. It is used to limit the traffic passing through the queue using the token bucket algorithm to achieve speed limit for the entire cluster.
6. The device according to claim 5, wherein the node controller counts local traffic data flowing into the network card every second and shares the local traffic data through multicast.
7. The apparatus of claim 6, wherein sharing the local traffic data comprises: The node controller sends the local traffic data to each node in the cluster via multicast. The node receives traffic data from other nodes in the cluster and calculates its own node speed limit quota threshold based on the traffic ratio after excluding its own traffic data.
8. The method according to claim 5, wherein ensuring fair allocation and efficient utilization of bandwidth resources comprises: The bandwidth allocation scheduler determines the node speed limit quota threshold according to the traffic bandwidth ratio of the nodes in the cluster, and allocates the core speed limit quota threshold of each node according to the bandwidth ratio of the service core of each processing queue traffic to the total node traffic in the node forwarding process.
9. The method according to claim 5, wherein the use of a token bucket algorithm to limit the rate of traffic passing through the queue specifically comprises: The token bucket manager periodically and dynamically adjusts according to the real-time data of the proportion of traffic processed by each queue in the node to the total bandwidth of the node to obtain the proportion of each queue in the cluster speed limit bandwidth.
10. An electronic device comprising: A memory unit and a processor unit, wherein the memory unit stores a computer program, and the processor unit implements the method according to any one of claims 1 to 4 when executing the program.