A network traffic management method, device and equipment of a cloud platform and a storage medium
By monitoring packet traffic data on virtual switch bridges and dynamically adjusting the number of polling CPUs in the DPDK network, the energy consumption problem when network traffic is low is solved. This reduces energy consumption without affecting performance, improves user experience, and maintains efficient forwarding during traffic surges.
Patent Information
- Application Number
- CN202411034545.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-30
- Publication Date
- 2026-02-27
- Estimated Expiration
- 2044-07-30
AI Technical Summary
When network traffic is low, DPDK still attempts to read packets while running on an isolated CPU, causing the CPU to idle and increasing power consumption. On the other hand, sending packets via interrupts will reduce network forwarding performance.
By monitoring packet traffic data on virtual switch bridges, the number of polling CPUs in the DPDK network is dynamically adjusted. The number of polling CPUs is calculated using traffic data within a preset time period, and CPUs are increased or decreased as needed to reduce idling power consumption and maintain network forwarding performance.
Without affecting network forwarding performance, it reduces the energy consumption of packet forwarding on the cloud platform, improves user experience, and enhances forwarding performance during sudden surges in network traffic.
Smart Images

Figure CN118842773B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing, and particularly relates to a network traffic management method and device of a cloud platform, equipment and a storage medium. BACKGROUND
[0002] DPDK (Data Plane Development Kit) is a user mode fast packet sending and receiving development tool, which, in combination with an OVS (OpenVSwitch, an open source virtual switch) of a cloud platform, forms an OVS-DPDK network to improve the performance of the virtual network of the cloud platform.
[0003] The DPDK will always attempt to read a message when running on an isolated CPU to improve network traffic forwarding performance. However, when the network traffic is small, the DPDK will still attempt to read a message when running on an isolated CPU, and will always read even if there is no message at the moment, which will cause the CPU to idle, thereby causing the OVS-DPDK network to have high energy consumption. Although the DPDK can use an interrupt mode to send a message when the network traffic pressure is not large to prevent the CPU from idling, using the interrupt mode to send a message will significantly degrade the network forwarding performance. Therefore, how to reduce the message forwarding energy consumption of the cloud platform when the network traffic is small without affecting the network forwarding performance as much as possible to improve the user experience is a problem that needs to be solved urgently. SUMMARY
[0004] The present application aims to provide a network traffic management method and device of a cloud platform, and equipment and a storage medium to reduce the message forwarding energy consumption of the cloud platform when the network traffic is small without affecting the network forwarding performance as much as possible.
[0005] To solve the above technical problems, the present application provides a network traffic management method of a cloud platform, comprising:
[0006] monitoring message traffic data on a virtual switch bridge by using a virtual switch in the cloud platform; wherein the message traffic data comprises the number of sent messages and / or the number of received messages;
[0007] determining the number of polling central processors according to the message traffic data in a preset time period; wherein the number of polling central processors is greater than a preset redundant processor number and less than or equal to a preset maximum processor number;
[0008] adjusting the number of polling central processors in a data plane development kit network of the virtual switch according to the number of polling central processors, so as to use the number of polling central processors in the data plane development kit network to process the messages on the virtual switch bridge.
[0009] In another aspect, the monitoring message flow data on the virtual switch bridge by using the virtual switch in the cloud platform comprises:
[0010] The counting sampling function of the network flow monitoring agent integrated by using the virtual switch is used to monitor the number of messages received and sent on the virtual switch bridge according to preset configuration parameters to obtain the message flow data; wherein the preset configuration parameters include sending source port information, counting sampling reporting period and sending destination port information.
[0011] Correspondingly, the determining the number of polling central processing units according to the message flow data in the preset time period comprises:
[0012] The network flow monitoring collector using the central processing unit dynamic adjustment process is used to perform message analysis on the received message flow data to obtain reporting flow information reported by the virtual switch each time; wherein the network flow monitoring collector binds the address of the sending destination port information, and the reporting flow information includes the number of sent messages, the number of received messages and reporting time.
[0013] The central processing unit dynamic adjustment process is used to determine the number of polling central processing units according to the reporting flow information in the preset time period.
[0014] In another aspect, the adjusting the number of polling central processing units in the data plane development kit network of the virtual switch according to the number of polling central processing units comprises:
[0015] The polling adjustment mode is determined according to the number of polling central processing units and the current polling number; wherein the polling adjustment mode includes an increase polling adjustment mode and a decrease polling adjustment mode, and the current polling number is the number of currently polling central processing units in the data plane development kit network.
[0016] If the polling adjustment mode is the increase polling adjustment mode, a first processor of a first target number is searched, and the first processor is added to the polling central processing units in the data plane development kit network; wherein the first target number is the difference between the number of polling central processing units and the current polling number, and the first processor is a central processing unit other than the polling central processing units in the data plane development kit network.
[0017] If the polling adjustment mode is the reducing polling adjustment mode, a second target number of second processors is found and the second processors are removed from the central processors polled in the data plane development kit network; wherein the second target number is a difference between a current polling number and the number of polling central processors, and the second processors are idle central processors in the central processors polled in the data plane development kit network.
[0018] In another aspect, the adding the first processors to the central processors polled in the data plane development kit network comprises:
[0019] Computing processor masks of the first processors;
[0020] Taking or of the processor masks and a current polling processor mask and amplitude to the current polling processor mask;
[0021] Updating the central processors polled in the data plane development kit network by using the current polling processor mask.
[0022] In another aspect, the determining the number of polling central processors according to the packet flow data in a preset time period comprises:
[0023] Computing port flow rates on the virtual switch bridge according to the packet flow data in a preset time period; wherein the port flow rates comprise all-port inflow flow rates and / or all-port outflow flow rates;
[0024] Determining the number of polling central processors according to the port flow rates, the preset maximum number of processors, the preset redundant number of processors and a preset maximum network flow rate.
[0025] In another aspect, when the port flow rates comprise the all-port inflow flow rates and the all-port outflow flow rates, the computing the port flow rates on the virtual switch bridge according to the packet flow data in a preset time period comprises:
[0026] According to the message flow data in the preset time period, first reported inflow traffic, first reported outflow traffic, first reported time, last reported inflow traffic, last reported outflow traffic and last reported time of each port on the virtual switch bridge in the preset time period are determined; wherein the first reported inflow traffic is the number of received messages first reported by the virtual switch in the preset time period, the first reported outflow traffic is the number of sent messages first reported by the virtual switch in the preset time period, the first reported time is the reporting time of the first reporting of the virtual switch in the preset time period, the last reported inflow traffic is the sum of the number of received messages from the first reporting to the last reporting of the virtual switch in the preset time period, the last reported outflow traffic is the sum of the number of sent messages from the first reporting to the last reporting of the virtual switch in the preset time period, and the last reported time is the reporting time of the last reporting of the virtual switch in the preset time period;
[0027] The inflow traffic flow rate and the outflow traffic flow rate of each port are calculated through V1=(S 1m -S 11 ) / (T m -T1) and V2=(S 2m -S 21 ) / (T m -T1); wherein V1 is the inflow traffic flow rate of the current port, S 1m is the last reported inflow traffic of the current port, S 11 is the first reported inflow traffic of the current port, T m is the last reported time of the current port, T1 is the first reported time of the current port, S 2m is the last reported outflow traffic of the current port, and S 21 is the first reported outflow traffic of the current port, and the current port is any of the ports;
[0028] The sum of the inflow traffic flow rates of all the ports is calculated to obtain the total port inflow traffic flow rate;
[0029] The sum of the outflow traffic flow rates of all the ports is calculated to obtain the total port outflow traffic flow rate.
[0030] In another aspect, when the port traffic flow rate includes the total port inflow traffic flow rate and the total port outflow traffic flow rate, the determination of the number of polling central processors according to the port traffic flow rate, the preset maximum processor number, the preset redundant processor number and the preset maximum network traffic flow rate includes:
[0031] Through calculating a first processor quantity; wherein Q1 is the first processor quantity, V 1a is the total port inflow flow rate, Q max is the preset maximum processor number, V max is the preset maximum network flow rate, Q r is the preset redundant processor number;
[0032] by calculating a second processor quantity; wherein Q1 is the second processor quantity, V 2a is the total port outflow flow rate;
[0033] determining a target processor quantity in the first processor quantity and the second processor quantity; wherein the target processor quantity is a larger value in the first processor quantity and the second processor quantity;
[0034] if the target processor quantity is less than the preset maximum processor number, the target processor quantity is determined as the polling central processor quantity;
[0035] if the target processor quantity is not less than the preset maximum processor number, the preset maximum processor number is determined as the polling central processor quantity.
[0036] The application further provides a network flow management device of a cloud platform, comprising:
[0037] a monitoring module, configured to monitor message flow data on a virtual switch bridge by using a virtual switch in the cloud platform; wherein the message flow data comprises a sending message quantity and / or a receiving message quantity;
[0038] a determining module, configured to determine a polling central processor quantity according to message flow data in a preset time period; wherein the polling central processor quantity is greater than a preset redundant processor number and less than or equal to a preset maximum processor number;
[0039] an adjusting module, configured to adjust a quantity of polling central processors in a data plane development kit network of the virtual switch according to the polling central processor quantity, so as to process messages on the virtual switch bridge by using the polling central processor quantity of central processors in the data plane development kit network.
[0040] The application further provides a network flow management device of a cloud platform, comprising:
[0041] a memory, configured to store a computer program;
[0042] A processor is configured to implement the steps of the network traffic management method of the cloud platform when executing the computer program.
[0043] The application further provides a computer readable storage medium, wherein the computer readable storage medium stores a computer program, and the computer program is configured to implement the steps of the network traffic management method of the cloud platform when executed by a processor.
[0044] The network traffic management method of the cloud platform comprises the following steps: monitoring message flow data on a virtual switch bridge by using a virtual switch in the cloud platform; wherein the message flow data comprises a number of sent messages and / or a number of received messages; determining a number of polling central processing units according to the message flow data in a preset time period; wherein the number of polling central processing units is greater than a preset number of redundant processors and less than or equal to a preset maximum number of processors; and adjusting the number of polling central processing units in a data plane development kit network of the virtual switch according to the number of polling central processing units, so that the polling central processing units in the data plane development kit network are used to process messages on the virtual switch bridge.
[0045] It can be seen that, by determining the number of polling central processing units (CPU) according to the message flow data in a preset time period, the network traffic in the preset time period on the virtual switch bridge is monitored, the number of polling CPUs in the OVS-DPDK network is dynamically adjusted, the dynamic adjustment of the polling CPUs in the OVS-DPDK network is realized, when the network traffic is small, the number of polling CPUs is reduced, the energy waste caused by the idling of the polling CPUs is reduced, the message forwarding energy consumption of the cloud platform is reduced, and the network forwarding performance of the cloud platform is not significantly reduced, the user experience is improved, and the network forwarding performance when the network traffic suddenly increases is improved by setting the number of redundant processors. In addition, the application also provides a network traffic management device and equipment of a cloud platform and a storage medium, which also have the above beneficial effects. BRIEF DESCRIPTION OF DRAWINGS
[0046] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the following will briefly introduce the drawings needed to be used in the embodiments or prior art description. Obviously, the drawings in the following description are only embodiments of the present application, and for those skilled in the art, other drawings can also be obtained without creative labor on the basis of the provided drawings.
[0047] Figure 1 A flowchart of the network traffic management method of the cloud platform provided by the embodiments of the present application is shown in the figure.
[0048] Figure 2 A cloud platform network traffic management method provided by an embodiment of the present application has a structure diagram as shown in FIG. 1.
[0049] Figure 3 A cloud platform network traffic management device provided by an embodiment of the present application has a structure diagram as shown in FIG. 2.
[0050] Figure 4 A cloud platform network traffic management device provided by an embodiment of the present application has a structure diagram as shown in FIG. 2.
[0051] Figure 5 A cloud platform network traffic management device provided by an embodiment of the present application has a structure diagram as shown in FIG. 2. DETAILED DESCRIPTION
[0052] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some but not all of the embodiments of the present application. Based on the embodiments in the present application, all other embodiments obtained by those of ordinary skill in the art without creative work fall within the protection scope of the present application.
[0053] For reference Figure 1 , Figure 1 A cloud platform network traffic management method provided by an embodiment of the present application has a flow chart as shown in FIG. 3. The method can include:
[0054] Step 101: monitoring message flow data on a virtual switch bridge by using a virtual switch in a cloud platform; wherein the message flow data includes the number of sent messages and / or the number of received messages.
[0055] It can be understood that the message flow data in the embodiment can be data related to the number of sent and / or received messages on the virtual switch bridge monitored by the virtual switch (such as OpenVSwitch) in the cloud platform.
[0056] Correspondingly, the specific way in which the processor monitors the message flow data on the virtual switch bridge by using the virtual switch in the cloud platform in this step can be determined by the designer according to the practical scene and user demand. For example, in some embodiments, when the message flow data includes the number of sent messages and the number of received messages, the processor can use the counting sampling function of the network flow monitoring agent (sFlow Agent) integrated in the virtual switch to monitor the number of received and sent messages on the virtual switch bridge according to the preset configuration parameters to obtain the message flow data; wherein the preset configuration parameters include the sending source port information, the counting sampling reporting period and the sending destination port information. For example,Figure 2 As shown, the VSwitch (virtual switch) in an OVS-DPDK network can integrate an sFlow Agent (network traffic monitoring agent). This agent can obtain preset configuration parameters for sFlow configuration through a db-server (database server), enable the counting and sampling function, collect the number of packets received and sent on the VSwitch bridge, encapsulate sFlow packets (i.e., packet traffic data), and send them to a specified IP (network association) address, such as the IP address bound to the sFlow Collector (network traffic monitoring collector) in the CPU dynamic adjustment process. In other embodiments, the virtual switch in the cloud platform can also use other network traffic monitoring methods to count the number of sent and / or received packets; this embodiment does not impose any restrictions on this.
[0057] Accordingly, this embodiment does not limit the specific content of the above-mentioned preset configuration parameters. For example, the preset configuration parameters may include source port information (Agent), used to encapsulate the source IP and source MAC (physical address) of the sFlow packet; they may also include a counting sampling reporting period (Polling), used to specify the reporting period during counting sampling, with the unit being seconds; and they may also include destination port information (Targets), used to encapsulate the destination IP and destination port of the sFlow packet. The preset configuration parameters may also include header information (Header) and packet sampling interval information (Sampling) to enable sampling of sent and received packets, facilitating the implementation of other network traffic analysis functions; the header can be used to specify the length of the collected packet header during packet sampling, with the unit being bytes; and sampling can be used to specify the packet sampling interval during packet sampling.
[0058] For example, such as Figure 2 As shown, the sFlow Agent of the virtual switch can create sFlow data records and associate them with the br-int (integrated bridge) bridge by setting preset configuration parameters such as Agent=ens5f0 (an interface name used to specify the source port), Polling=1, and Targets="127.0.0.1:6343". This allows it to monitor the traffic information of the br-int bridge (i.e., the virtual switch bridge), encapsulate this traffic information into sFlow packets (i.e., packet traffic data), and send them to the address 127.0.0.1:6343. Correspondingly, the CPU dynamic adjustment process (i.e., the CPU dynamic adjustment service) starts the sFlow Collector program, starts the socket, binds to the address 127.0.0.1:6343, and can then receive the sFlow packets sent by the sFlow Agent.
[0059] Step 102: determining the polling central processor number according to the packet flow data in the preset time period; wherein the polling central processor number is greater than the preset redundant processor number and less than or equal to the preset maximum processor number.
[0060] It can be understood that, in the embodiment, the packet flow data in the preset time period on the virtual switch bridge is monitored, and the number of polling CPUs (such as CPU cores) in the dynamically adjusted OVS-DPDK network (i.e., the polling CPU number) can be determined, that is, the number of polling CPUs to be adjusted currently.
[0061] Correspondingly, for the specific manner in which the processor determines the polling central processor number according to the packet flow data in the preset time period, the designer can set it according to the practical scene and user demand, for example, when the virtual switch uses the counting sampling function of sFlow Agent to count the number of received and / or sent packets on the virtual switch bridge, the processor in this step can use the network flow monitoring collector (sFlow Collector) of the CPU dynamic adjustment process to analyze the received packet flow data, and obtain the reporting flow information reported by the virtual switch each time; wherein the network flow monitoring collector binds the address of the sending destination port information, and the reporting flow information includes the number of sent packets, the number of received packets, and the reporting time; the CPU dynamic adjustment process is used to determine the polling central processor number according to the reporting flow information in the preset time period, for example, as shown in FIG. 8, the CPU dynamic adjustment process can use a dynamic adjustment algorithm to calculate the polling central processor number according to the reporting flow information in the preset time period. Figure 2
[0062] For example, the sFlow Collector can use a Python (a programming language) library (such as pysflow) to parse the sFlow packet (i.e., packet flow data) to obtain the reported flow information; the reported flow information can include counter sampling data (Counters) such as the number of sent packets and the number of received packets, can also include the reporting time (Uptime) of the sampling data, which can be in milliseconds, and can also include the source address (Agent_address) of the sFlow packet, the sequence number (Sequence_number) of the sFlow packet, and packet sampling data (Samples) and the like. For example, after parsing the sFlow packet to read the Counters field, the data_format=(0,1) element in the Counters field can be the packet counter sampling data of the ports on the br-int bridge of the OpenVSwitch, such as the number of sent packets and the number of received packets of each port, where ifIndex is the port index, ifInOctets is the flow byte number flowing into the port, and ifOutOctets is the flow byte number flowing out of the port. These data can be classified and stored according to the port index.
[0063] It should be noted that in the present embodiment, the device with a preset maximum processor number is used to avoid the case that the number of polling central processors is too large; and the preset redundant processor number is used to ensure that the number of polling central processors is slightly larger than the number of polling CPUs required by the current demand of the packet flow data in the preset time period, so as to ensure the network forwarding performance in the case of network traffic surge. The preset redundant processor number can be less than the preset maximum processor number.
[0064] Correspondingly, for the specific determination method of the number of polling central processors in the present step, the specific process of determining the number of polling central processors according to the reported flow information in the preset time period by using the CPU dynamic adjustment process can be set by the designer, for example, the processor can calculate the port flow rate on the virtual switch bridge according to the packet flow data in the preset time period; wherein the port flow rate includes the total port inflow flow rate and / or the total port outflow flow rate; and the number of polling central processors is determined according to the port flow rate, the preset maximum processor number, the preset redundant processor number, and the preset maximum network flow rate.
[0065] Correspondingly, when the port flow rate includes the total port inflow flow rate and the total port outflow flow rate, the process of calculating the port flow rate on the virtual switch bridge according to the packet flow data in the preset time period can include: determining the first reported inflow flow S 11, the first time of reporting the outflow S 21 , the last time of reporting the inflow S 1m , the last time of reporting the outflow S 2m , and the last time of reporting T m ; the inflow flow rate V1 and the outflow flow rate V2 of each port are calculated through V1=(S 1m -S 11 ) / (T m -T1) and V2=(S 2m -S 21 ) / (T m -T1); the sum of the inflow flow rates of all ports is calculated to obtain the inflow flow rate of all ports, that is, the inflow flow rate of the virtual switch bridge; the sum of the outflow flow rates of all ports is calculated to obtain the outflow flow rate of all ports, that is, the outflow flow rate of the virtual switch bridge. Wherein, the first time of reporting the inflow is the number of received messages reported by the virtual switch for the first time in a preset time period, the first time of reporting the outflow is the number of sent messages reported by the virtual switch for the first time in a preset time period, the first time of reporting the time is the reporting time of the virtual switch for the first time in a preset time period, the last time of reporting the inflow is the sum of the number of received messages from the first time of reporting to the last time of reporting by the virtual switch in a preset time period, the last time of reporting the outflow is the sum of the number of sent messages from the first time of reporting to the last time of reporting by the virtual switch in a preset time period, and the last time of reporting the time is the reporting time of the virtual switch for the last time in a preset time period.
[0066] That is, in some embodiments, the number of received messages reported for the first time in a preset time period can be counted, accumulated to the number of received messages reported for the last time in a preset time period, to obtain the last time of reporting the inflow S 1m . In other embodiments, the reporting of message flow data can also be timed from the beginning, accumulated to the number of received messages reported for the first time in a preset time period, to obtain the first time of reporting the inflow S 11 ; accumulated to the number of received messages reported for the last time in a preset time period, to obtain the last time of reporting the inflow S 1m ; that is, the first time of reporting the inflow is the number of received messages reported by the virtual switch for the first time in a preset time period, and the last time of reporting the inflow is the number of sent messages reported by the virtual switch for the last time in a preset time period.
[0067] Wherein, when the port flow rate includes the inflow flow rate of all ports and the outflow flow rate of all ports, the above determining the number of polling central processors according to the port flow rate, the preset maximum processor number, the preset redundant processor number and the preset maximum network flow rate includes: calculating the sum of the inflow flow rates of all ports through , calculating the first processor quantity; wherein Q1 is the first processor quantity, V 1a is the total port inflow traffic flow rate, Q max is the preset maximum processor number, V max is the preset maximum network traffic flow rate, Q r is the preset redundant processor number; by , calculating the second processor quantity; wherein Q1 is the second processor quantity, V 2a is the total port outflow traffic flow rate; determining a target processor quantity in the first processor quantity and the second processor quantity; wherein the target processor quantity is the larger value in the first processor quantity and the second processor quantity; if the target processor quantity is less than the preset maximum processor number, determining the target processor quantity as the polling central processor quantity; if the target processor quantity is not less than the preset maximum processor number, determining the preset maximum processor number as the polling central processor quantity.
[0068] Further, the above process is demonstrated by setting a preset redundant processor number as an example. In some embodiments, in order to further improve the accuracy of the dynamically adjusted polling CPU quantity and reduce the message forwarding energy consumption of the cloud platform, a plurality of different preset redundant processor numbers can be set, so that the above process of calculating the first processor quantity and the second processor quantity can include: determining a corresponding target redundant number according to the first upward integer value and the second upward integer value, respectively; adding the first upward integer value and the corresponding target redundant number to obtain the first processor quantity; adding the second upward integer value and the corresponding target redundant number to obtain the second processor quantity; wherein the target redundant number is any preset redundant processor number; the first upward integer value can be the quotient of the product of the total port inflow traffic flow rate and the preset maximum processor number divided by the preset maximum network traffic flow rate, rounded up, i.e. ; and the second upward integer value can be the quotient of the product of the total port outflow traffic flow rate and the preset maximum processor number divided by the preset maximum network traffic flow rate, rounded up, i.e. That is, by setting different preset redundant processor numbers, the preset redundant processor number used under different network traffic flow rates can be set according to the demand, such as the greater the network traffic flow rate, the greater or smaller the preset redundant processor number used, further improving the accuracy of the dynamically adjusted polling CPU quantity.
[0069] Step 103: adjusting the number of polling central processors in the data plane development kit network of the virtual switch according to the polling central processor quantity, so as to utilize the central processors with the polling central processor quantity in the data plane development kit network to process the messages on the virtual switch bridge.
[0070] It can be understood that, after determining the current polling central processor quantity, the processor in this step can adjust the number of polling CPUs in the data plane development kit (OVS-DPDK) network of the virtual switch, so as to continue to read and analyze the messages on the virtual switch bridge using the CPUs with the adjusted polling central processor quantity; when the network traffic is small, the number of polling CPUs can be reduced, the energy waste of idle polling CPUs can be reduced, the message forwarding energy consumption of the cloud platform is reduced, and the situation of sending messages by interrupt is avoided, which does not significantly reduce the network forwarding performance of the cloud platform; and the embodiment does not depend on the underlying CPU architecture, supports multiple architectures such as x86 architecture and arm (Advanced RISC Machine, Advanced RISC Machine) architecture, and has a wide range of applications.
[0071] Correspondingly, for the specific way of adjusting the number of polling central processors in the data plane development kit network of the virtual switch according to the polling central processor quantity in this step, the designer can set it by himself, for example, the processor can determine the polling adjustment mode according to the polling central processor quantity and the current polling quantity; wherein the polling adjustment mode includes increasing polling adjustment mode (such as the number of polling CPUs is greater than the current polling quantity) and reducing polling adjustment mode (such as the number of polling CPUs is less than the current polling quantity), and the current polling quantity is the number of currently polling central processors in the data plane development kit network; if the polling adjustment mode is the increasing polling adjustment mode, find the first processor of the first target quantity, and add the first processor to the polling central processors in the data plane development kit network; wherein the first target quantity is the difference between the polling central processor quantity and the current polling quantity, and the first processor is a central processor outside the polling central processors in the data plane development kit network; if the polling adjustment mode is the reducing polling adjustment mode, find the second processor of the second target quantity, and remove the second processor from the polling central processors in the data plane development kit network; wherein the second target quantity is the difference between the current polling quantity and the polling central processor quantity, and the second processor is an idle central processor in the polling central processors in the data plane development kit network.
[0072] For example, after determining the number of polling CPUs to which the current OVS-DPDK network needs to be adjusted, the number of polling CPUs in the current OVS-DPDK network can be compared to dynamically adjust the number of polling CPUs in the OVS-DPDK network; if the polling CPUs in the OVS-DPDK network need to be increased, a CPU (i.e., a first processor) that is not currently polling in the OVS-DPDK network can be found and its cpu-mask (processor mask) can be calculated, and the cpu-mask can be or-ed with the current pmd-cpu-mask (current polling processor mask) and assigned to the pmd-cpu-mask; if the polling CPUs in the OVS-DPDK network need to be reduced, an idle CPU can be found from the CPUs that are currently polling in the OVS-DPDK network, and its cpu-mask can be calculated, and the cpu-mask can be xor-ed with the current pmd-cpu-mask and assigned to the pmd-cpu-mask; then, the pmd-cpu-mask updated by the assignment is used to adjust the polling CPUs in the OVS-DPDK network, so that the number of polling CPUs after the adjustment is the determined number of polling CPUs, such as successfully setting the polling CPUs of the OVS-DPDK network by executing the command "ovs-vsctl --no-wait set Open_vSwitch. other_config:pmd-cpu-mask=0xc0c0".
[0073] That is, the above-mentioned adding the first processor to the central processing units polling in the data plane development kit network can include: calculating the processor mask of each first processor; or-ing the processor mask with the current polling processor mask and assigning the current polling processor mask; and updating the central processing units polling in the data plane development kit network using the current polling processor mask. The above-mentioned removing the second processor from the central processing units polling in the data plane development kit network can include: calculating the processor mask of each second processor; xor-ing the processor mask of each second processor with the current polling processor mask and assigning the current polling processor mask; and updating the central processing units polling in the data plane development kit network using the current polling processor mask.
[0074] In this embodiment, the embodiment of the application can utilize the network traffic monitored on the virtual switch bridge within the preset time period to determine the polling CPU number of the dynamically adjusted OVS-DPDK network, so as to realize the dynamic adjustment of the polling CPU in the OVS-DPDK network, reduce the number of polling CPUs when the network traffic is small, reduce the energy waste of the idle running of the polling CPUs, reduce the message forwarding energy consumption of the cloud platform, and will not significantly reduce the network forwarding performance of the cloud platform, and improve the user experience. And through the setting of the preset redundant processor number, the network forwarding performance when the network traffic suddenly increases can be improved.
[0075] Corresponding to the above method embodiment, the embodiment of the application also provides a network traffic management device of a cloud platform. The network traffic management device described below can be correspondingly referred to the network traffic management method of a cloud platform described above.
[0076] Please refer to Figure 3 , Figure 3 A structural block diagram of a network traffic management device of a cloud platform provided by the embodiment of the application. The device can include:
[0077] The monitoring module 10 is configured to monitor the message flow data on the virtual switch bridge by using the virtual switch in the cloud platform. The message flow data includes the number of sent messages and / or the number of received messages.
[0078] The determination module 20 is configured to determine the number of polling central processing units according to the message flow data within a preset time period. The number of polling central processing units is greater than the preset redundant processor number and less than or equal to the preset maximum processor number.
[0079] The adjustment module 30 is configured to adjust the number of polling central processing units in the data plane development kit network of the virtual switch according to the number of polling central processing units, so that the polling central processing units in the data plane development kit network process the messages on the virtual switch bridge.
[0080] In some embodiments, the monitoring module 10 can be specifically configured to utilize the counting sampling function of the network traffic monitoring agent integrated with the virtual switch, to monitor the number of messages received and sent on the virtual switch bridge according to the preset configuration parameters, to obtain the message flow data. The preset configuration parameters include the sending source port information, the counting sampling reporting period and the sending destination port information.
[0081] Correspondingly, the determining module 20 can be specifically configured to utilize the central processor to dynamically adjust the process of the network traffic monitoring collector, perform packet analysis on the received packet traffic data to obtain reporting traffic information reported by the virtual switch each time, utilize the central processor to dynamically adjust the process, and determine the number of polling central processors according to the reporting traffic information in a preset time period; wherein the network traffic monitoring collector binds an address of a sending destination port information, and the reporting traffic information includes a number of sent packets, a number of received packets, and reporting time.
[0082] In some embodiments, the adjusting module 30 can include:
[0083] A mode determining sub-module, configured to determine a polling adjustment mode according to the number of polling central processors and a current polling number; wherein the polling adjustment mode includes an increase polling adjustment mode and a decrease polling adjustment mode, and the current polling number is a number of currently polled central processors in the data plane development kit network;
[0084] An increase adjusting sub-module, configured to, if the polling adjustment mode is the increase polling adjustment mode, find a first target number of first processors, and add the first processors to the polling central processors in the data plane development kit network; wherein the first target number is a difference between the number of polling central processors and the current polling number, and the first processors are central processors other than the polling central processors in the data plane development kit network;
[0085] A decrease adjusting sub-module, configured to, if the polling adjustment mode is the decrease polling adjustment mode, find a second target number of second processors, and remove the second processors from the polling central processors in the data plane development kit network; wherein the second target number is a difference between the current polling number and the number of polling central processors, and the second processors are idle central processors in the polling central processors in the data plane development kit network.
[0086] In some embodiments, the increase adjusting sub-module can include:
[0087] A mask calculating unit, configured to calculate a processor mask of each first processor;
[0088] An or calculating unit, configured to perform an or operation on the processor mask and a current polling processor mask, and amplitude to the current polling processor mask;
[0089] An updating unit, configured to update the polling central processors in the data plane development kit network by using the current polling processor mask.
[0090] In some embodiments, the determining module 20 can include:
[0091] The flow rate calculation submodule is configured to calculate port flow rates on the virtual switch bridge according to message flow data in a preset time period; wherein the port flow rates include all-port inflow flow rates and / or all-port outflow flow rates.
[0092] The number determination submodule is configured to determine the number of polling central processing units according to the port flow rates, a preset maximum number of processors, a preset number of redundant processors, and a preset maximum network flow rate.
[0093] In some embodiments, the flow rate calculation submodule can include:
[0094] The determination unit is configured to determine, according to message flow data in a preset time period, first reported inflow flow, first reported outflow flow, first reported time, last reported inflow flow, last reported outflow flow, and last reported time of each port on the virtual switch bridge in the preset time period; wherein the first reported inflow flow is the number of received messages first reported by the virtual switch in the preset time period, the first reported outflow flow is the number of sent messages first reported by the virtual switch in the preset time period, the first reported time is the reporting time of the first reporting by the virtual switch in the preset time period, the last reported inflow flow is the sum of the number of received messages from the first reporting to the last reporting by the virtual switch in the preset time period, the last reported outflow flow is the sum of the number of sent messages from the first reporting to the last reporting by the virtual switch in the preset time period, and the last reported time is the reporting time of the last reporting by the virtual switch in the preset time period.
[0095] The flow rate calculation unit is configured to calculate inflow flow rates and outflow flow rates of each port by V1=(S 1m -S 11 ) / (T m -T1) and V2=(S 2m -S 21 ) / (T m -T1); wherein V1 is the inflow flow rate of the current port, S 1m is the last reported inflow flow of the current port, S 11 is the first reported inflow flow of the current port, T m is the last reported time of the current port, T1 is the first reported time of the current port, S 2m is the last reported outflow flow of the current port, and S 21 is the first reported outflow flow of the current port, and the current port is any port.
[0096] The first summary calculation unit is configured to calculate the sum of all-port inflow flow rates to obtain all-port inflow flow rates.
[0097] a second aggregation calculation unit configured to calculate a sum of the outflow flow rates of all the ports to obtain an all-port outflow flow rate.
[0098] In some embodiments, when the port flow rates include the all-port inflow flow rate and the all-port outflow flow rate, the quantity determination submodule can include:
[0099] a first quantity calculation unit configured to calculate a first processor quantity by ; wherein Q1 is the first processor quantity, V 1a is the all-port inflow flow rate, Q max is a preset maximum processor quantity, V max is a preset maximum network flow rate, Q r is a preset redundant processor quantity.
[0100] a second quantity calculation unit configured to calculate a second processor quantity by ; wherein Q1 is the second processor quantity, V 2a is the all-port outflow flow rate.
[0101] a first comparison determination unit configured to determine a target processor quantity from the first processor quantity and the second processor quantity; wherein the target processor quantity is the larger one of the first processor quantity and the second processor quantity.
[0102] a second comparison determination unit configured to determine the target processor quantity as a round-robin central processor quantity if the target processor quantity is less than the preset maximum processor quantity, or determine the preset maximum processor quantity as the round-robin central processor quantity if the target processor quantity is not less than the preset maximum processor quantity.
[0103] In this embodiment, the determination module 20 determines the round-robin CPU quantity according to the message flow data in a preset time period, so that the network flow in the virtual switch network bridge in the preset time period is monitored to determine the round-robin CPU quantity of the dynamically adjusted OVS-DPDK network, thereby realizing the dynamic adjustment of the round-robin CPU in the OVS-DPDK network. When the network flow is small, the number of round-robin CPUs can be reduced to reduce the energy waste of idle round-robin CPUs, thereby reducing the message forwarding energy consumption of the cloud platform without significantly reducing the network forwarding performance of the cloud platform, and improving the user experience. In addition, the preset redundant processor quantity can be set to improve the network forwarding performance when the network flow suddenly increases.
[0104] Corresponding to the above method embodiments, the embodiments of the present application also provide a network traffic management device of a cloud platform. The network traffic management device described below can be referred to in correspondence with the network traffic management method of a cloud platform described above.
[0105] Please refer to Figure 4 , Figure 4 A simple structure diagram of a network traffic management device of a cloud platform provided by the embodiments of the present application. The network traffic management device can include:
[0106] The memory D1 is configured to store a computer program.
[0107] The processor D2 is configured to execute the computer program to implement the steps of the network traffic management method of a cloud platform provided by the method embodiments.
[0108] Specifically, please refer to Figure 5 , Figure 5 A specific structure diagram of a network traffic management device of a cloud platform provided by the embodiments of the present application. The network traffic management device 310 can have great differences due to different configurations or performances, and can include one or more central processing units (CPUs) 322 (for example, one or more processors) and a memory 332, one or more storage media 330 (for example, one or more mass storage devices) storing application programs 342 or data 344. The memory 332 and the storage media 330 can be temporary storage or persistent storage. The programs stored in the storage media 330 can include one or more modules (not shown in the figure), and each module can include a series of instruction operations in the data processing device. Further, the central processing unit 322 can be configured to communicate with the storage media 330 to execute a series of instruction operations in the storage media 330 on the network traffic management device 310.
[0109] The network traffic management device 310 can also include one or more power supplies 326, one or more wired or wireless network interfaces 350, one or more input / output interfaces 358, and / or one or more operating systems 341. For example, Windows ServerTM, Mac OS XTM, UnixTM, LinuxTM, FreeBSDTM, etc.
[0110] In the embodiments, the network traffic management device 310 can be a server device of a cloud platform, such as a server.
[0111] The steps of the network traffic management method of a cloud platform described above can be implemented by the structure of the network traffic management device of a cloud platform.
[0112] Corresponding to the above method embodiments, the embodiments of the present application also provide a computer program product, which can be correspondingly referred to the above method of the network traffic management device of the cloud platform.
[0113] A computer program product comprises computer programs / instructions, which, when executed by a processor, implement the steps of the method of the network traffic management device of the cloud platform provided by the above method embodiments.
[0114] Corresponding to the above method embodiments, the embodiments of the present application also provide a computer readable storage medium, which can be correspondingly referred to the above method of the network traffic management device of the cloud platform.
[0115] A computer readable storage medium, wherein the computer program is stored on the readable storage medium, and the computer program, when executed by a processor, implements the steps of the method of the network traffic management device of the cloud platform provided by the above method embodiments.
[0116] The computer readable storage medium can be a U disk, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, or various readable storage media that can store program codes.
[0117] The embodiments in the specification are described in a progressive manner, and each embodiment focuses on the differences from other embodiments. The same or similar parts of each embodiment can be referred to each other. For the apparatus, device, computer program product and computer readable storage medium disclosed by the embodiments, since they correspond to the method disclosed by the embodiments, the description is relatively simple, and the relevant parts can be referred to the method part.
[0118] The above provides a detailed description of the network traffic management method, device, equipment and storage medium of the cloud platform. The principle and implementation of the present application are described by applying specific examples. The above embodiment is only used to help understand the method and core idea of the present application. It should be pointed out that for ordinary skilled in the art, without departing from the principle of the present application, the present application can be improved and modified. These improvements and modifications also fall within the protection scope of the present application.
Claims
1. A method for network traffic management on a cloud platform, characterized in that, include: Monitor packet traffic data on virtual switch bridges using virtual switches in a cloud platform; wherein, the packet traffic data includes the number of sent packets and / or the number of received packets; The number of central processing units (CPUs) to be polled is determined based on the message traffic data within a preset time period; wherein the number of CPUs to be polled is greater than the preset number of redundant processors and less than or equal to the preset maximum number of processors. Based on the number of polling CPUs, adjust the number of polling CPUs in the data plane development kit network of the virtual switch so as to utilize the number of CPUs in the data plane development kit network that are polling CPUs to process packets on the virtual switch bridge; The step of determining the number of central processing units to poll based on message traffic data within a preset time period includes: Based on the packet traffic data within a preset time period, calculate the port traffic flow rate on the virtual switch bridge; wherein, the port traffic flow rate includes the total inflow traffic flow rate and the total outflow traffic flow rate. pass Calculate the number of the first processors; where Q1 is the number of the first processors, V 1a Q represents the flow rate of all incoming traffic to the ports. max V is the preset maximum number of processors. max To preset the maximum network traffic flow rate, Q r The preset number of redundant processors; pass Calculate the number of second processors; where Q2 is the number of second processors, V 2a The outflow rate of all ports; Determine the target number of processors between the first number of processors and the second number of processors; wherein the target number of processors is the larger value between the first number of processors and the second number of processors; If the number of target processors is less than the preset maximum number of processors, then the number of target processors is determined to be the number of polling central processing units; If the target number of processors is not less than the preset maximum number of processors, then the preset maximum number of processors is determined as the number of polling central processing units.
2. The network traffic management method for a cloud platform according to claim 1, characterized in that, The method of monitoring packet traffic data on virtual switch bridges using virtual switches in the cloud platform includes: By utilizing the counting and sampling function of the network traffic monitoring agent integrated in the virtual switch, the number of packets received and sent on the virtual switch bridge is monitored according to preset configuration parameters to obtain the packet traffic data; wherein, the preset configuration parameters include the sending source port information, the counting and sampling reporting period, and the sending destination port information; Correspondingly, determining the number of central processing units to poll based on message traffic data within a preset time period includes: A network traffic monitoring and collector that dynamically adjusts processes using a central processing unit analyzes the received packet traffic data to obtain the reported traffic information of the virtual switch each time; wherein, the network traffic monitoring and collector is bound to the address of the sending destination port information, and the reported traffic information includes the number of sent packets, the number of received packets, and the reporting time; The process is dynamically adjusted using the central processing unit, and the number of polling central processing units is determined based on the reported traffic information within the preset time period.
3. The network traffic management method for a cloud platform according to claim 1, characterized in that, Adjusting the number of polling CPUs in the data plane development kit network of the virtual switch according to the number of polling CPUs includes: Based on the number of polling CPUs and the current polling count, a polling adjustment method is determined; wherein, the polling adjustment method includes increasing the polling adjustment method and decreasing the polling adjustment method, and the current polling count is the number of CPUs currently polling in the data plane development kit network; If the polling adjustment method is the increased polling adjustment method, then find the first target number of first processors and add the first processors to the polled central processors in the data plane development kit network; wherein, the first target number is the difference between the number of polled central processors and the current polling number, and the first processor is a central processor other than the polled central processors in the data plane development kit network; If the polling adjustment method is the reduced polling adjustment method, then the second processor of the second target number is found, and the second processor is removed from the polled CPUs in the data plane development kit network; wherein, the second target number is the difference between the current polling number and the polled CPU number, and the second processor is an idle CPU in the polled CPUs in the data plane development kit network.
4. The network traffic management method for a cloud platform according to claim 3, characterized in that, The step of adding the first processor to the central processing unit polled in the data plane development kit network includes: Calculate the processor mask for each of the first processors; The processor mask is ORed with the current polling processor mask, and the result is assigned to the current polling processor mask. Update the polling central processing unit in the data plane development kit network using the current polling processor mask.
5. The network traffic management method for a cloud platform according to claim 1, characterized in that, The step of calculating the port traffic rate on the virtual switch bridge based on the packet traffic data within a preset time period includes: Based on the packet traffic data within the preset time period, determine the first reported inflow traffic, the first reported outflow traffic, the first reported time, the last reported inflow traffic, the last reported outflow traffic, and the last reported time for each port on the virtual switch bridge within the preset time period; wherein, the first reported inflow traffic is the number of received packets first reported by the virtual switch within the preset time period, the first reported outflow traffic is the number of sent packets first reported by the virtual switch within the preset time period, the first reported time is the reporting time of the first report by the virtual switch within the preset time period, the last reported inflow traffic is the sum of the number of received packets from the first report to the last report by the virtual switch within the preset time period, the last reported outflow traffic is the sum of the number of sent packets from the first report to the last report by the virtual switch within the preset time period, and the last reported time is the reporting time of the last report by the virtual switch within the preset time period; via V1=(S 1m -S 11 ) / (T m -T1) and V2=(S 2m -S 21 ) / (T m -T1), calculate the inflow velocity and outflow velocity of each port; where V1 is the inflow velocity of the current port, S 1m S represents the last reported inbound traffic for the current port. 11 T represents the first reported inflow traffic for the current port. m T1 is the last reporting time of the current port, and S is the first reporting time of the current port. 2m S represents the last reported outbound traffic for the current port. 21 This refers to the first reported outbound traffic for the current port, which can be any of the aforementioned ports. Calculate the sum of the inflow velocities of all the ports to obtain the inflow velocities of all the ports; Calculate the sum of the outflow rates of all the ports to obtain the outflow rates of all the ports.
6. A network traffic management device for a cloud platform, characterized in that, include: The monitoring module is used to monitor packet traffic data on the virtual switch bridge using the virtual switch in the cloud platform; wherein, the packet traffic data includes the number of sent packets and / or the number of received packets; The determination module is used to determine the number of central processing units to be polled based on the message traffic data within a preset time period; wherein the number of central processing units to be polled is greater than a preset number of redundant processors and less than or equal to a preset maximum number of processors; An adjustment module is used to adjust the number of polling CPUs in the data plane development kit network of the virtual switch according to the number of polling CPUs, so as to utilize the number of CPUs in the data plane development kit network to process the packets on the virtual switch bridge; The determining module includes: The flow rate calculation submodule is used to calculate the port flow rate on the virtual switch bridge based on the packet flow data within a preset time period; wherein, the port flow rate includes the flow rate of all port inflows and the flow rate of all port outflows. The quantity determination submodule is used to determine the number of polling central processing units based on the port traffic flow rate, the preset maximum number of processors, the preset redundant number of processors, and the preset maximum network traffic flow rate. The quantity determination submodule includes: The first quantity calculation unit is used to calculate the quantity through... Calculate the number of the first processors; where Q1 is the number of the first processors, V 1a Q represents the flow rate of all incoming traffic to the ports. max V is the preset maximum number of processors. max Q is the preset maximum network traffic flow rate. r The preset number of redundant processors; The second quantity calculation unit is used to calculate... Calculate the number of second processors; where Q2 is the number of second processors, V 2a The outflow rate of all ports; The first comparison and determination unit is used to determine a target number of processors between the first number of processors and the second number of processors; wherein the target number of processors is the larger value between the first number of processors and the second number of processors; The second comparison and determination unit is used to determine the number of target processors as the number of polling central processing units if the number of target processors is less than the preset maximum number of processors; and to determine the preset maximum number of processors as the number of polling central processing units if the number of target processors is not less than the preset maximum number of processors.
7. A network traffic management device for a cloud platform, characterized in that, include: Memory, used to store computer programs; A processor, configured to implement the steps of the network traffic management device method for a cloud platform as described in any one of claims 1 to 5 when executing the computer program.
8. A computer-readable storage medium, characterized in that, The computer-readable storage medium stores a computer program that, when executed by a processor, implements the steps of the network traffic management device method for a cloud platform as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Resource allocation method and device, equipment and storage medium
CN116954874A