Method for statically balancing system load, computer device, medium and product
By classifying and dynamic task allocation of NUMA nodes of multiple NUMA computing platforms, the task allocation ratio is adjusted according to the node's processing capacity difference, the problem of system load imbalance is solved, and load balancing and overall processing capacity is improved.
Patent Information
- Application Number
- CN202411765001.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-03-25
- Estimated Expiration
- 2044-12-04
AI Technical Summary
In high-performance multi-NUMA computing platform, the traffic or tasks accepted by each NUMA node is different, resulting in unbalanced system load, which may lead to overload and even service interruption of a NUMA node.
By obtaining the maximum processing capacity and maximum input capacity of each NUMA node, the nodes are classified and stored in two linked lists, the node type is determined based on the received data packets, the actual processing capacity difference of the node is calculated, and the preset ratio is determined based on the difference value, and the task allocation is dynamically adjusted to achieve a balanced distribution of loads among different NUMA nodes.
It effectively solves the problem of node overload caused by system load imbalance, avoids business interruptions, improves overall processing capabilities, and ensures that the system maintains efficient operation under various load situations.
Smart Images

Figure CN119697187A_ABST
Abstract
Description
Technical Field
[0001] The present disclosure relates to the field of network security and communication technology, and in particular to a method, computer device, medium, and product for statically balancing system load. Background Art
[0002] In the current industrial control Internet of Things and big data platforms, high-performance multi-NUMA computing platforms are being used more and more widely. They are often used as industrial control core equipment, Internet of Things centers and big data computing platforms. During use, they are usually used to process network traffic or big data tasks. However, since each NUMA node receives different traffic or tasks, the entire system load is unbalanced, resulting in an overload of a NUMA node and even business interruption. Summary of the invention
[0003] In view of this, the embodiments of the present disclosure provide a method, computer device, medium, and product for statically balancing system loads, which can effectively solve the problems existing in the prior art such as unbalanced system loads leading to node overloads and even business interruptions.
[0004] In a first aspect, an embodiment of the present disclosure provides a method for statically balancing system loads, specifically comprising:
[0005] Get the maximum processing capacity and maximum input capacity of all NUMA nodes in a multi-NUMA architecture;
[0006] The NUMA nodes whose maximum processing capacity is greater than the maximum input capacity are stored in the first linked list, and the NUMA nodes whose maximum processing capacity is not greater than the maximum input capacity are stored in the second linked list;
[0007] Based on the received data packet, determining a node type responsible for processing the data packet;
[0008] If the second linked list contains the node type, determine the difference between the maximum processing capacity and the maximum input capacity of the node corresponding to the node type;
[0009] determining a preset ratio based on the difference;
[0010] The data packet processing tasks corresponding to the difference are distributed to the target NUMA nodes in the first linked list according to the preset ratio.
[0011] Optionally, allocating the data packet processing tasks corresponding to the difference to the target NUMA nodes in the first linked list according to the preset ratio includes:
[0012] Determining the difference between the maximum input capacity and the maximum processing capacity of the node responsible for processing the data packet;
[0013] Obtain the difference between the maximum processing capacity and the maximum input capacity of each NUMA node in the first linked list, and record it as a target difference;
[0014] Determine a NUMA node corresponding to the target difference that is greater than the difference and has the smallest difference from the difference, and record it as the target node;
[0015] The target node executes a processing instruction of the data packet processing task corresponding to the difference.
[0016] Optionally, the data packet processing task corresponding to the difference is Q:
[0017] Q = Q1 × K;
[0018] K = T1 / T2;
[0019] Among them, Q1 is the amount of received data packets, K is the preset ratio, T1 is the difference between the maximum processing capacity and the maximum input capacity of the node responsible for processing the data packets, and T2 is the maximum input capacity of the node responsible for processing the data packets.
[0020] Optionally, determining the type of node responsible for processing the data packet based on the received data packet includes:
[0021] Acquire first information of the received data packet, the first information including a destination IP address and a port number;
[0022] Based on the first information and the preset mapping mechanism, the node type responsible for processing is determined.
[0023] Optionally, the method for acquiring the maximum processing capacity includes: when the target multi-NUMA architecture is under no-load conditions, performing a maximum task stress test on each NUMA node in the target multi-NUMA architecture to obtain the maximum processing capacity of the corresponding NUMA node.
[0024] Optionally, after determining the node type, the method further includes:
[0025] Acquire the time interval from the determination time of the node type to the creation time of the first linked list and the second linked list;
[0026] When the time interval is greater than a preset interval threshold, the first linked list and the second linked list are updated.
[0027] Optionally, if the first linked list contains the node type, a corresponding NUMA node in the first linked list is called based on the node type to execute a processing instruction for the data packet.
[0028] In a second aspect, the embodiment of the present disclosure further provides a system for statically balancing system loads, including:
[0029] Capacity acquisition module, used to obtain the maximum processing capacity and maximum input capacity of all NUMA nodes in the multi-NUMA architecture;
[0030] A classification module, configured to store the NUMA nodes whose maximum processing capacity is greater than the maximum input capacity into a first linked list, and store the NUMA nodes whose maximum processing capacity is not greater than the maximum input capacity into a second linked list;
[0031] A node type determination module, configured to determine the type of node responsible for processing the data packet based on the received data packet;
[0032] A difference determination module, configured to include the node type in the second linked list and determine the difference between the maximum processing capacity and the maximum input capacity of the node corresponding to the node type;
[0033] A preset ratio determination module, used to determine the preset ratio based on the difference;
[0034] The distribution module is used to distribute the data packet processing tasks corresponding to the difference to the target NUMA nodes in the first linked list according to the preset ratio.
[0035] In a third aspect, the embodiments of the present disclosure further provide a computer device, which adopts the following technical solution:
[0036] The computer device comprises:
[0037] at least one processor; and,
[0038] a memory communicatively connected to the at least one processor; wherein,
[0039] The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute any of the above-mentioned methods for statically balancing system loads.
[0040] In a fourth aspect, an embodiment of the present disclosure further provides a computer-readable storage medium, which stores computer instructions, and the computer instructions are used to enable a computer to execute any of the above-mentioned methods for statically balancing system loads.
[0041] In a fifth aspect, an embodiment of the present disclosure further provides a computer program product, including a computer program / instruction, which implements the steps of any of the above methods when executed by a processor.
[0042] The method for statically balancing system load disclosed in the present application obtains the maximum processing and input capabilities of each node, ensuring that the system has an accurate understanding of the resource status of each node; by classifying the nodes, the processing capabilities of all nodes can be clarified, providing a clear basis for the subsequent allocation of data packet processing tasks, ensuring that tasks can be preferentially allocated to nodes with sufficient processing capabilities; the type of node responsible for processing is quickly determined according to the source of the data packet, reducing the delay in task allocation; through difference calculation, the actual processing capacity of the node responsible for processing the data packet can be obtained in real time, and the task allocation ratio is dynamically adjusted according to the difference to ensure that the system can flexibly respond to different load conditions; the data packet processing task corresponding to the difference is allocated to the target NUMA node in the first linked list according to the preset ratio, that is, by dynamically adjusting the task allocation, the load is evenly distributed among different NUMA nodes, avoiding overload of some nodes while other nodes are idle, and improving the overall processing capacity by making full use of nodes with excess processing capacity; the method disclosed in the application can flexibly respond to different load conditions, ensuring that the system can maintain efficient operation under various circumstances.
[0043] The above description is only an overview of the technical solution of the present invention. In order to more clearly understand the technical means of the present invention, it can be implemented in accordance with the contents of the specification. In order to make the above and other purposes, features and advantages of the present invention more obvious and easy to understand, the following preferred embodiments are specifically cited and described in detail with reference to the accompanying drawings. BRIEF DESCRIPTION OF THE DRAWINGS
[0044] In order to more clearly illustrate the technical solutions of the embodiments of the present disclosure, the drawings required for use in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present disclosure. For ordinary technicians in this field, other drawings can be obtained based on these drawings without creative work.
[0045] Figure 1 A flowchart of a method for statically balancing system loads provided in an embodiment of the present disclosure.
[0046] Figure 2 A flowchart of a method for determining the type of node responsible for processing a data packet provided in an embodiment of the present disclosure.
[0047] Figure 3 A flowchart of a method for allocating data packet processing tasks corresponding to a difference value to a target NUMA node in a first linked list according to a preset ratio provided in an embodiment of the present disclosure.
[0048] Figure 4 A flowchart of a method for updating and analyzing a first linked list and a second linked list provided in an embodiment of the present disclosure.
[0049] Figure 5 A flowchart of a method for updating a first linked list and a second linked list provided in an embodiment of the present disclosure.
[0050] Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure. DETAILED DESCRIPTION
[0051] The embodiments of the present disclosure are described in detail below with reference to the accompanying drawings.
[0052] It should be clear that the following embodiments of the present disclosure are described by specific specific examples, and those skilled in the art can easily understand other advantages and effects of the present disclosure from the contents disclosed in this specification. Obviously, the described embodiments are only a part of the embodiments of the present disclosure, rather than all of the embodiments. The present disclosure can also be implemented or applied through other different specific embodiments, and 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 disclosure. It should be noted that the following embodiments and features in the embodiments can be combined with each other in the absence of conflict. Based on the embodiments in the present disclosure, all other embodiments obtained by ordinary technicians in the field without making creative work are within the scope of protection of the present disclosure.
[0053] It should be noted that various aspects of the embodiments within the scope of the appended claims are described below. It should be apparent that the aspects described herein may be embodied in a wide variety of forms, and any specific structure and / or function described herein is merely illustrative. Based on the present disclosure, it should be understood by those skilled in the art that an aspect described herein may be implemented independently of any other aspect, and two or more of these aspects may be combined in various ways. For example, any number of aspects described herein may be used to implement the device and / or practice the method. In addition, other structures and / or functionalities other than one or more of the aspects described herein may be used to implement this device and / or practice this method.
[0054] It should also be noted that the illustrations provided in the following embodiments are only schematic illustrations of the basic concept of the present disclosure. The drawings only show components related to the present disclosure rather than being drawn according to the number, shape and size of components in actual implementation. In actual implementation, the type, quantity and proportion of each component may be changed arbitrarily, and the component layout may also be more complicated.
[0055] Additionally, in the following description, specific details are provided to facilitate a thorough understanding of the examples. However, it will be understood by those skilled in the art that the aspects described may be practiced without these specific details.
[0056] Reference Figure 1, the present application discloses a method for statically balancing system load, specifically comprising:
[0057] S100, obtaining the maximum processing capacity and the maximum input capacity of all NUMA nodes in the multi-NUMA architecture.
[0058] The method for obtaining the maximum processing capacity includes: when the target multi-NUMA system architecture is under no-load condition, performing a maximum task stress test on each NUMA node in the target multi-NUMA system architecture to obtain the maximum processing capacity of the corresponding NUMA node.
[0059] Methods for obtaining the maximum input capacity include: calculating the maximum input capacity of each NUMA node by monitoring indicators such as the bandwidth utilization and queue length of the network interface card (NIC); the input capacity upper limit threshold usually refers to the maximum data flow that the node can receive, including network flow and storage I / O flow. Determining this threshold can help the system avoid node overload when processing large amounts of data.
[0060] S200, storing NUMA nodes whose maximum processing capabilities are greater than their maximum input capabilities into a first linked list, and storing NUMA nodes whose maximum processing capabilities are not greater than their maximum input capabilities into a second linked list.
[0061] For example, if the maximum processing capacity of a node is 1000 packets / second and the maximum input capacity is 800 packets / second, the node is stored in the first linked list; if the maximum processing capacity of a node is 700 packets / second and the maximum input capacity is 800 packets / second, the node is stored in the second linked list.
[0062] By classifying the nodes, it is clear which nodes have excess processing capacity (the first linked list) and which nodes have insufficient processing capacity (the second linked list), providing a clear basis for the subsequent allocation of data packet processing tasks and ensuring that tasks can be allocated to nodes with sufficient processing capacity first.
[0063] Specifically, according to the size of the input traffic, NUMA nodes whose input capacity exceeds their maximum processing capacity can be classified into the second linked list, while the nodes that can fully handle the traffic are stored in the first linked list; for each NUMA node, first compare its maximum processing capacity and input capacity, and insert the corresponding linked list according to the result. This process is carried out through pre-set comparison logic and does not require additional computing resources; and the segmentation of the linked lists makes the respective load distribution processes clear and controllable.
[0064] S300, based on the received data packet, determine the type of node responsible for processing the data packet.
[0065] In this step, the type of node responsible for processing is quickly determined based on the source of the data packet, reducing the delay in task allocation.
[0066] Reference Figure 2 , the method for determining the node type responsible for processing the data packet includes:
[0067] S310, obtaining first information of a received data packet, where the first information includes a destination IP address and a port number.
[0068] The data packet is a traffic data packet (such as a network data packet) or an event data packet (such as a log event).
[0069] By obtaining the destination IP address and port number of the data packet, the final target location of the data packet can be accurately located.
[0070] S320: Determine the node type responsible for processing based on the first information and a preset mapping mechanism.
[0071] Specifically, a preset mapping mechanism may be pre-set to map the destination IP address and port number to a specific NUMA node. For example, IP address 192.168.1.1 and port number 8080 are mapped to NUMA node Node 2 one by one.
[0072] Through the preset mapping mechanism, the node type responsible for processing the data packet can be quickly determined, reducing the delay in task allocation; ensuring that each time a data packet with the same destination IP address and port number is processed, it can be mapped to the same node type to maintain processing consistency; providing a clear basis for subsequent task allocation and load balancing, ensuring that the system can efficiently process tasks.
[0073] Among them, the preset mapping mechanism can be adjusted according to specific needs to adapt to different network environments and application scenarios, and has good flexibility.
[0074] Furthermore, the processing requirements of the data packet can be determined by the characteristics of the data packet (such as packet size, type, priority, etc.), and the appropriate node type can be determined according to the processing requirements.
[0075] S400: If the second linked list contains a node type, determine the difference between the maximum processing capacity and the maximum input capacity of the node corresponding to the node type.
[0076] By obtaining the difference between the maximum processing capacity and the maximum input capacity of the node responsible for processing the data packet, the actual processing capacity of the node can be obtained.
[0077] S500, determining a preset ratio based on the difference.
[0078] The preset ratio is K: K=T1 / T2; wherein T1 is the difference between the maximum processing capacity and the maximum input capacity of the node responsible for processing the data packet, and T2 is the maximum input capacity of the node responsible for processing the data packet.
[0079] The task allocation ratio is dynamically adjusted according to the difference in nodes to ensure that the system can flexibly respond to different load conditions; by presetting the ratio, the load is evenly distributed among different nodes to avoid overloading some nodes while other nodes are idle.
[0080] S600: Allocate the data packet processing tasks corresponding to the difference value to the target NUMA nodes in the first linked list according to a preset ratio.
[0081] Specifically, for the NUMA nodes with overload in the second linked list, suitable nodes are found in the first linked list for diversion; the system distributes tasks to available nodes in a certain proportion through a preset proportional diversion scheme.
[0082] Specific reference Figure 3 , a method for allocating the data packet processing tasks corresponding to the difference value to the target NUMA node in the first linked list according to a preset ratio, comprising the following steps:
[0083] S610, determining a difference between a maximum input capability and a maximum processing capability of a node responsible for processing a data packet;
[0084] S620, obtaining the difference between the maximum processing capacity and the maximum input capacity of each NUMA node in the first linked list, and recording it as the target difference.
[0085] By calculating the target difference, the remaining processing capacity of nodes with excess processing capacity is evaluated, providing a basis for task reallocation.
[0086] S630, determine a NUMA node corresponding to a target difference that is greater than the difference and has the smallest difference from the difference, and record it as the target node.
[0087] By selecting the node corresponding to the target difference closest to the difference, we can ensure that the task is redistributed to the most suitable node, which can avoid resource waste while not affecting the processing capacity of the selected node itself; the selection is made according to the actual difference of the node to ensure that the system can flexibly respond to different load conditions.
[0088] In the process of traversing the first linked list, tasks are allocated in proportion according to the difference of nodes, and nodes that are closest to the difference and meet the conditions are selected for diversion processing. This step significantly improves the efficiency of linked list traversal and reduces unnecessary diversion and task reallocation.
[0089] For example, in the first linked list, the target difference of NUMA node A is 200 packets / second, the target difference of NUMA node B is 150 packets / second, and the target difference of NUMA node C is 80 packets / second. When the difference between the maximum input capacity and the maximum processing capacity of the node responsible for processing the data packet is determined to be 100 packets / second, NUMA node B is selected as the target node.
[0090] S640, executing a processing instruction of a data packet processing task corresponding to the difference through the target node.
[0091] Among them, the data packet processing task corresponding to the difference is Q, Q=Q1×K, where Q1 is the amount of received data packets (i.e., traffic or number of tasks), and K is the preset ratio; at the same time, the processing task corresponding to the node responsible for processing the data packet is Q1-Q.
[0092] For example, the maximum processing capacity of the NUMA node responsible for processing data packets is 70G / s, and the maximum input capacity is 80G / s (8 10G interfaces), then the difference is 10G, and the corresponding preset ratio is 12.5% (i.e., 10 / 80); if the task corresponding to the received data packet is 10G traffic, the local NUMA node in the second linked list processes 10G*(1-87.5%), and the remaining 10G*(12.5%) is transmitted to the target node in the first linked list through QPI for processing.
[0093] By reallocating tasks to nodes with excess processing power, a balanced distribution of load among different nodes is achieved, thus preventing some nodes from being overloaded while others are idle. By making full use of nodes with excess processing power, system performance bottlenecks caused by insufficient processing power are avoided, thus improving overall processing power. Through resource classification and dynamic allocation, the utilization of system resources is optimized, thus avoiding waste of resources. By dynamically adjusting the task allocation ratio, the system can flexibly respond to different load conditions, thus ensuring that the system can maintain efficient operation in all situations.
[0094] S700: If the first linked list contains a node type, call a corresponding NUMA node in the first linked list based on the node type to execute a processing instruction for the data packet.
[0095] When the node type belongs to the first linked list, the processing instruction is directly executed, which simplifies the task allocation process and reduces the complexity of the system.
[0096] Further, refer to Figure 4 In the method for statically balancing system load disclosed in the present application, after determining the node type, it also includes updating and analyzing the first linked list and the second linked list. The specific method includes:
[0097] A100, obtaining the time interval from the time when the node type is determined to the time when the first linked list and the second linked list are created.
[0098] By analyzing the time interval, the timeliness of the first linked list and the second linked list can be monitored to ensure that the table data used is the latest and avoid inaccurate load distribution caused by time delay. A200, when the time interval is greater than the preset interval threshold, the first linked list and the second linked list are updated.
[0099] The preset interval threshold may be a fixed time (usually 1 second to 1024 seconds) or a dynamically adjusted value.
[0100] By updating the linked list in a timely manner, we can ensure that the information in the linked list is always up to date, avoid task allocation errors caused by outdated information, and ensure that the system can allocate tasks based on the latest node type and processing power information at any time, thereby improving the reliability of the system.
[0101] Through the method disclosed in this embodiment, the content of the linked list can be dynamically adjusted according to actual conditions to ensure efficient operation in different time periods; by timely updating the linked list, unreasonable resource allocation caused by outdated node type and processing capacity information can be avoided, resource utilization can be improved, and at the same time, it can be ensured that the system can timely evaluate the timeliness of the linked list to avoid lagging linked list information due to long time intervals.
[0102] The overall solution obtains time intervals and updates the linked list in a timely manner to ensure that the system can allocate tasks based on the latest node type and processing capacity information, thereby improving the overall data accuracy, reliability, dynamic adaptability and resource utilization of the system.
[0103] Furthermore, if the time interval is not greater than the preset interval threshold, no update is performed to avoid system overhead caused by frequent updates, improve system performance and stability, maintain consistency of table data when the load does not change much, and ensure the continuity and stability of load distribution.
[0104] Reference Figure 5 , the method for updating the first linked list and the second linked list specifically includes:
[0105] A210, obtains the maximum processing power and real-time input capability of each NUMA node.
[0106] The real-time input capacity is the number of data packets or tasks currently input to the node. For example, the real-time input capacity of node A is 800 data packets / second.
[0107] By obtaining the maximum processing capacity and real-time input capacity of each node, the processing capacity and current load of the node can be accurately evaluated, providing a basis for subsequent linked list updates.
[0108] A220, moving the NUMA nodes in the first linked list whose maximum processing capacity is not greater than the real-time input capacity to the second linked list;
[0109] The NUMA nodes in the second linked list whose maximum processing capacity is not less than the real-time input capacity are moved to the first linked list.
[0110] By moving nodes with insufficient processing power from the first linked list to the second linked list, dynamic adjustment of the load between different linked lists is achieved to avoid overloading of some nodes while other nodes are idle, ensuring that nodes with excess processing power will not experience performance degradation due to excessive load, thereby improving overall system performance.
[0111] By moving nodes with excess processing capacity from the second linked list to the first linked list, it is ensured that these nodes can fully utilize their remaining processing capacity to avoid waste of resources; dynamic adjustments are made based on the actual processing capacity and real-time input capacity of the nodes to ensure that the system can flexibly respond to different load conditions.
[0112] By dynamically adjusting the contents of linked lists, the load can be evenly distributed among different linked lists to avoid overloading some nodes while other nodes are idle; it is ensured that the performance of nodes with excess processing capacity will not decline due to excessive load, thereby improving the overall system performance; by moving nodes with excess processing capacity from the second linked list to the first linked list, it is ensured that these nodes can make full use of their remaining processing capacity to avoid waste of resources; dynamic adjustments are made based on the actual processing capacity and real-time input capacity of the nodes to ensure that the system can flexibly respond to different load conditions; by obtaining the maximum processing capacity and real-time input capacity of each node, the processing capacity and current load situation of the node can be accurately evaluated to provide a basis for subsequent linked list updates; it is ensured that the contents of the linked lists always reflect the latest status of the nodes to avoid task allocation errors caused by outdated information.
[0113] The overall solution dynamically adjusts the contents of the first linked list and the second linked list to ensure that the system can flexibly allocate tasks according to the actual processing capabilities and real-time input capabilities of the nodes, achieve load balancing and resource optimization, and improve the overall performance of the system.
[0114] For example, an industrial control core device has 4 NUMA nodes, each NUMA node has n CPUs; the system has 32 slots, each NUMA takes over a different number of slots, NUMA0 takes over 4 slots, NUMA1 takes over 6 slots, NUMA2 takes over 8 slots, NUMA3 takes over 14 slots, and each slot has a 1G, 10G, or 100G interface. The system runs a single task: forwarding.
[0115] Similarly, for example, the number of NUMAs and result slots of the big data platform are the same as above, and the system runs a single task: analyzing event processing.
[0116] After starting the running system, if the traffic is handled by a node in the first linked list, it is directly processed; if it is handled by a node in the second linked list, the difference between the maximum processing capacity and the maximum input capacity of the NUMA node responsible for processing the data packet is obtained, and the closest NUMA node that is greater than the difference is found in the first linked list, and the NUMA node information is recorded in the node information of the second linked list.
[0117] The NUMA nodes in the first linked list process the incoming traffic or tasks locally. The traffic or tasks received by the NUMA nodes in the second linked list are processed by the local NUMA and sent to the NUMA nodes recorded in the node information through QPI according to the ratio (maximum processing capacity / maximum input capacity).
[0118] The method for statically balancing system load disclosed in the present application obtains the maximum processing and input capabilities of each node, ensuring that the system has an accurate understanding of the resource status of each node; by classifying the nodes, the processing capabilities of all nodes can be clarified, providing a clear basis for the subsequent allocation of data packet processing tasks, ensuring that tasks can be preferentially allocated to nodes with sufficient processing capabilities; the type of node responsible for processing is quickly determined according to the source of the data packet, reducing the delay in task allocation; through difference calculation, the actual processing capacity of the node responsible for processing the data packet can be obtained in real time, and the task allocation ratio is dynamically adjusted according to the difference to ensure that the system can flexibly respond to different load conditions; the data packet processing task corresponding to the difference is allocated to the target NUMA node in the first linked list according to the preset ratio, that is, by dynamically adjusting the task allocation, the load is evenly distributed among different NUMA nodes, avoiding overload of some nodes while other nodes are idle, and improving the overall processing capacity by making full use of nodes with excess processing capacity; the method disclosed in the application can flexibly respond to different load conditions, ensuring that the system can maintain efficient operation under various circumstances.
[0119] The method for statically balancing system loads disclosed in the present application is applicable to systems that cannot dynamically adjust resources; the method for statically balancing system loads disclosed in the present application allocates computing resources through preset rules before the system runs, and does not rely on real-time monitoring and adjustment. Compared with dynamic load balancing, the advantage of statically adjusting the load is that the allocation method is set at the beginning of the design, and is applicable to multi-NUMA systems with relatively stable loads.
[0120] In the method of statically balancing system loads disclosed in the present application, this pre-allocation scheme is designed for a static system, which is suitable for environments with high traffic but stable load patterns, but not suitable for scenarios where the load changes frequently. General dynamic load balancing rarely predetermines the ratio during design. This innovation avoids the complexity of real-time load adjustment.
[0121] The static linked list diversion solution achieves stable and efficient load balancing without the need for dynamic system adjustment. It also avoids the need for real-time computing resource allocation in the system. It is very suitable for the static load diversion rules of multi-NUMA architecture NUMA systems with fixed load patterns, and solves the load balancing problem in high-traffic systems at the beginning of the design.
[0122] In a second aspect, the embodiment of the present disclosure further provides a system for statically balancing system loads, including:
[0123] Capacity acquisition module, used to obtain the maximum processing capacity and maximum input capacity of all NUMA nodes in the multi-NUMA architecture;
[0124] A classification module, used for storing NUMA nodes whose maximum processing capacity is greater than the maximum input capacity into a first linked list, and storing NUMA nodes whose maximum processing capacity is not greater than the maximum input capacity into a second linked list;
[0125] A node type determination module, used to determine the type of node responsible for processing the data packet based on the received data packet;
[0126] A difference determination module, used for including the node type in the second linked list, and determining the difference between the maximum processing capacity and the maximum input capacity of the node corresponding to the node type;
[0127] A preset ratio determination module, used to determine the preset ratio based on the difference;
[0128] The traffic distribution module is used to distribute the data packet processing tasks corresponding to the difference value to the target NUMA node in the first linked list according to a preset ratio.
[0129] It should be noted that the method for statically balancing system load disclosed in the first aspect of the present application is applicable to the acquisition of the system solution for statically balancing system load disclosed in the second aspect of the present application, so it will not be repeated here.
[0130] The computer device according to the embodiment of the present disclosure includes a memory and a processor. The memory is used to store non-temporary computer-readable instructions. Specifically, the memory may include one or more computer program products, and the computer program product may include various forms of computer-readable storage media, such as volatile memory and / or non-volatile memory. The volatile memory may, for example, include a random access memory (RAM) and / or a cache memory (cache), etc. The non-volatile memory may, for example, include a read-only memory (ROM), a hard disk, a flash memory, etc.
[0131] The processor may be a central processing unit (CPU) or other forms of processing units with data processing capabilities and / or instruction execution capabilities, and may control other components in the computer device to perform desired functions. In one embodiment of the present disclosure, the processor is used to run the computer-readable instructions stored in the memory, so that the computer device performs all or part of the steps of the method for statically balancing system loads in the aforementioned embodiments of the present disclosure.
[0132] Those skilled in the art should be able to understand that in order to solve the technical problem of how to obtain a good user experience, the present embodiment may also include well-known structures such as a communication bus and an interface, and these well-known structures should also be included in the protection scope of the present disclosure.
[0133] like Figure 6 A schematic diagram of the structure of a computer device provided in an embodiment of the present disclosure is shown, which is a schematic diagram of the structure of a computer device suitable for implementing the embodiment of the present disclosure. Figure 6 The computer device shown is only an example and should not bring any limitation to the functions and scope of use of the embodiments of the present disclosure.
[0134] like Figure 6 As shown, the computer device may include a processor (e.g., a central processing unit, a graphics processing unit, etc.), which can perform various appropriate actions and processes according to a program stored in a read-only memory (ROM) or a program loaded from a storage device into a random access memory (RAM). In the RAM, various programs and data required for the operation of the computer device are also stored. The processor, ROM, and RAM are connected to each other via a bus. An input / output (I / O) interface is also connected to the bus.
[0135] Typically, the following devices can be connected to the I / O interface: input devices such as sensors or visual information acquisition devices; output devices such as display screens; storage devices such as tapes, hard disks, etc.; and communication devices. The communication device can allow the computer device to communicate with other devices (such as edge computing devices) wirelessly or by wire to exchange data. Figure 6 A computer device having various devices is shown, but it should be understood that it is not required to implement or possess all of the devices shown. More or fewer devices may be implemented or possessed instead.
[0136] In particular, according to an embodiment of the present disclosure, the process described above with reference to the flowchart can be implemented as a computer software program. For example, an embodiment of the present disclosure includes a computer program product, which includes a computer program carried on a non-transitory computer-readable medium, and the computer program contains program code for executing the method shown in the flowchart. In such an embodiment, the computer program can be downloaded and installed from a network through a communication device, or installed from a storage device, or installed from a ROM. When the computer program is executed by a processor, all or part of the steps of the method for statically balancing system loads of an embodiment of the present disclosure are executed.
[0137] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0138] According to the computer-readable storage medium of the embodiment of the present disclosure, non-transitory computer-readable instructions are stored thereon. When the non-transitory computer-readable instructions are executed by a processor, all or part of the steps of the method for statically balancing system loads of the above-mentioned embodiments of the present disclosure are executed.
[0139] The above-mentioned computer-readable storage media include, but are not limited to: optical storage media (e.g., CD-ROM and DVD), magneto-optical storage media (e.g., MO), magnetic storage media (e.g., magnetic tape or mobile hard disk), media with built-in rewritable non-volatile memory (e.g., memory card) and media with built-in ROM (e.g., ROM box).
[0140] For detailed description of this embodiment, reference may be made to the corresponding descriptions in the aforementioned embodiments, which will not be repeated here.
[0141] The basic principles of the present disclosure are described above in conjunction with specific embodiments. However, it should be noted that the advantages, strengths, effects, etc. mentioned in the present disclosure are only examples and not limitations, and it cannot be considered that these advantages, strengths, effects, etc. are required by each embodiment of the present disclosure. In addition, the specific details disclosed above are only for the purpose of illustration and ease of understanding, and are not limitations. The above details do not limit the present disclosure to the necessity of adopting the above specific details to be implemented.
[0142] In the present disclosure, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply that there is any such actual relationship or order between these entities or operations. The block diagrams of the devices, devices, equipment, and systems involved in the present disclosure are only illustrative examples and are not intended to require or imply that they must be connected, arranged, and configured in the manner shown in the block diagram. As will be appreciated by those skilled in the art, these devices, devices, equipment, and systems can be connected, arranged, and configured in any manner. Words such as "including", "comprising", "having", etc. are open words, referring to "including but not limited to", and can be used interchangeably with them. The words "or" and "and" used here refer to the words "and / or" and can be used interchangeably with them, unless the context clearly indicates otherwise. The words "such as" used here refer to the phrase "such as but not limited to", and can be used interchangeably with them.
[0143] Additionally, as used herein, "or" used in a list of items beginning with "at least one" indicates a separate list, so that, for example, a list of "at least one of A, B, or C" means A or B or C, or AB or AC or BC, or ABC (i.e., A and B and C). Furthermore, the word "exemplary" does not mean that the example described is preferred or better than other examples.
[0144] It should also be noted that in the system and method of the present disclosure, each component or each step can be decomposed and / or recombined. Such decomposition and / or recombination should be regarded as equivalent solutions of the present disclosure.
[0145] Various changes, substitutions, and modifications of the techniques described herein may be made without departing from the teachings defined by the appended claims. Furthermore, the scope of the claims of the present disclosure is not limited to the specific aspects of the processes, machines, manufactures, compositions of events, means, methods, and actions described above. Currently existing or later to be developed processes, machines, manufactures, compositions of events, means, methods, or actions that perform substantially the same functions or achieve substantially the same results as the corresponding aspects described herein may be utilized. Thus, the appended claims include such processes, machines, manufactures, compositions of events, means, methods, or actions within their scope.
[0146] The above description of the disclosed aspects is provided to enable any person skilled in the art to make or use the present disclosure. Various modifications to these aspects will be readily apparent to those skilled in the art, and the general principles defined herein may be applied to other aspects without departing from the scope of the present disclosure. Therefore, the present disclosure is not intended to be limited to the aspects shown herein, but rather to the widest scope consistent with the principles and novel features disclosed herein.
[0147] The above description has been given for the purpose of illustration and description. In addition, this description is not intended to limit the embodiments of the present disclosure to the forms disclosed herein. Although multiple example aspects and embodiments have been discussed above, those skilled in the art will recognize certain variations, modifications, changes, additions and sub-combinations thereof.
Claims
1. A method for statically balancing system loads, characterized in that: include: Get the maximum processing capacity and maximum input capacity of all NUMA nodes in a multi-NUMA architecture; The NUMA nodes whose maximum processing capacity is greater than the maximum input capacity are stored in the first linked list, and the NUMA nodes whose maximum processing capacity is not greater than the maximum input capacity are stored in the second linked list; Based on the received data packet, determining a node type responsible for processing the data packet; If the second linked list contains the node type, determine the difference between the maximum processing capacity and the maximum input capacity of the node corresponding to the node type; determining a preset ratio based on the difference; The data packet processing tasks corresponding to the difference are distributed to the target NUMA nodes in the first linked list according to the preset ratio.
2. The method for statically balancing system load according to claim 1, characterized in that: The allocating the data packet processing tasks corresponding to the difference value to the target NUMA node in the first linked list according to the preset ratio includes: Determining the difference between the maximum input capacity and the maximum processing capacity of the node responsible for processing the data packet; Obtain the difference between the maximum processing capacity and the maximum input capacity of each NUMA node in the first linked list, and record it as a target difference; Determine a NUMA node corresponding to the target difference that is greater than the difference and has the smallest difference from the difference, and record it as the target node; The target node executes a processing instruction of the data packet processing task corresponding to the difference.
3. The method for statically balancing system load according to claim 2, characterized in that: The data packet processing task corresponding to the difference is Q: Q = Q1 × K; K = T1 / T2; Among them, Q1 is the amount of received data packets, K is the preset ratio, T1 is the difference between the maximum processing capacity and the maximum input capacity of the node responsible for processing the data packets, and T2 is the maximum input capacity of the node responsible for processing the data packets.
4. The method for statically balancing system load according to claim 1, characterized in that: The determining, based on the received data packet, the type of node responsible for processing the data packet comprises: Acquire first information of the received data packet, the first information including a destination IP address and a port number; Based on the first information and the preset mapping mechanism, the node type responsible for processing is determined.
5. The method for statically balancing system load according to claim 1, characterized in that: The method for obtaining the maximum processing capacity includes: when the target multi-NUMA system architecture is under an empty load condition, performing a maximum task stress test on each NUMA node in the target multi-NUMA system architecture to obtain the maximum processing capacity of the corresponding NUMA node.
6. The method for statically balancing system load according to claim 1, characterized in that: After determining the node type, the following steps are also included: Acquire the time interval from the determination time of the node type to the creation time of the first linked list and the second linked list; When the time interval is greater than a preset interval threshold, the first linked list and the second linked list are updated.
7. The method for statically balancing system load according to claim 1, characterized in that: If the first linked list includes the node type, a corresponding NUMA node in the first linked list is called based on the node type to execute a processing instruction for the data packet.
8. A computer device, characterized in that: The computer device comprises: at least one processor; and, a memory communicatively connected to the at least one processor; wherein, The memory stores instructions that can be executed by the at least one processor, and the instructions are executed by the at least one processor so that the at least one processor can execute the method for statically balancing system loads as described in any one of claims 1-7.
9. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the method for statically balancing system loads as described in any one of claims 1-7.
10. A computer program product comprising computer instructions, characterized in that: When the computer instructions are executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Dynamic flow load balancing method based on DPDK
CN107196870A
Base station computing power load balancing method and device and storage medium
CN114867065A
Application service dynamic management method and system, electronic equipment and storage medium
CN116662020A
Capacity evaluation method and device for service cluster, electronic equipment and storage medium
CN117667613A
Internet big data intelligent processing method and device based on edge computing, computer equipment and medium
CN118733256A
Cited By
Network data forwarding method and device, equipment and storage medium
CN120896898A