A cloud host packet receiving processing method, device, equipment and medium
By dynamically adjusting the number of packets received in the cloud host network interface queue, the throughput and latency issues in the cloud host network IO processing mode were resolved, achieving network performance optimization with high throughput and low latency.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-04-29
- Publication Date
- 2026-03-27
AI Technical Summary
In existing technologies, cloud host network I/O processing modes cannot simultaneously meet the requirements of high throughput and low latency under different traffic models. Single packet processing mode results in low throughput and PPS performance, while static batch processing mode may cause network I/O waiting and high latency problems.
By dynamically adjusting the number of packet batches based on the throughput of the cloud host's network interface queue, the data packet processing method is optimized in real time, avoiding the low throughput of the single packet processing mode and the high latency of the static batch processing mode. A dynamic adjustment strategy is adopted to improve network I/O performance.
This approach improves the network I/O throughput and PPS performance of cloud servers while reducing network I/O waiting frequency and latency, thereby enhancing the overall performance of the cloud network data plane.
Smart Images

Figure CN114840337B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the technical field of cloud computing services, and particularly relates to a cloud host packet receiving processing method and device, equipment and a medium. BACKGROUND
[0002] At present, the network IO (Input / Output) processing mode of the cloud network data plane is divided into a single packet processing mode and a batch processing mode. In the single packet processing mode, a single packet is processed in a function call in the message receiving and processing process, which results in high per-packet processing overhead and low data plane processing capacity and performance. A typical representative is OvS-Kernel, which adopts the single packet processing mode, has high per-packet processing overhead, and thus has low OvS-Kernel PPS (Packet Per Second) forwarding capacity. In the batch processing mode, multiple packets are processed in a function call in the message receiving and processing process. According to the time / space locality principle, batch processing can significantly improve the CPU Cache hit rate and share the overhead of context switching on the stack / register group during function call. Typical representatives are OvS-DPDK and VPP, but the batch processing numbers of them are static values, and the batch processing numbers are relatively large (for example, 32 or 256), which can theoretically reduce the single packet processing overhead, improve the CPU processing capacity, and increase the network throughput, but increase the single packet processing delay and network delay. In the cloud host communication scenario, there may be a large number of large data packets, which requires a large amount of CPU clock to copy and process, thereby causing network IO waiting and delay and other problems in other cloud hosts. If the batch processing number is small, the value of the batch processing mode cannot be maximized, and thus the forwarding capacity of the cloud network data plane cannot be effectively improved.
[0003] As can be seen from the above, neither the static batch processing number nor the single packet processing mode can simultaneously meet the requirements of high throughput and low delay in different traffic models. SUMMARY
[0004] Therefore, the purpose of the present application is to provide a cloud host packet receiving processing method, device, equipment and medium, which can improve the throughput and PPS performance of cloud host network IO while meeting the requirements of reducing network IO waiting frequency and delay, thereby improving the performance of cloud network data plane. The specific scheme is as follows:
[0005] In a first aspect, the present application discloses a cloud host packet receiving processing method, comprising:
[0006] According to the batch processing number of the cloud host network port queue, the data packets are received;
[0007] The size sum of all the data packets received in the current round and the packet receiving time are determined.
[0008] determining a throughput rate of the cloud host network interface queue in the current round based on the size sum and the packet receiving time;
[0009] adjusting the packet receiving batch number according to the throughput rate.
[0010] Optionally, the adjusting the packet receiving batch number according to the throughput rate comprises:
[0011] determining whether the throughput rate is greater than or equal to a preset throughput rate threshold value;
[0012] if the throughput rate is greater than or equal to the preset throughput rate threshold value, reducing the packet receiving batch number, and if the throughput rate is less than the preset throughput rate threshold value and the packet receiving batch number is not a preset maximum batch number, increasing the packet receiving batch number based on the throughput rate of the packet receiving rounds in the latest preset number of rounds.
[0013] Optionally, the reducing the packet receiving batch number comprises:
[0014] determining a first target batch number according to the throughput rate and the number of the packets received in the current round;
[0015] adjusting the packet receiving batch number to the first target batch number.
[0016] Optionally, the reducing the packet receiving batch number comprises:
[0017] directly adjusting the packet receiving batch number to a preset minimum batch number.
[0018] Optionally, the increasing the packet receiving batch number based on the throughput rate of the packet receiving rounds in the latest preset number of rounds comprises:
[0019] if there is a packet receiving round with the throughput rate greater than or equal to the preset throughput rate threshold value in the latest preset number of packet receiving rounds, increasing the packet receiving batch number according to a preset adjustment strategy;
[0020] if there is no packet receiving round with the throughput rate greater than or equal to the preset throughput rate threshold value in the latest preset number of packet receiving rounds, directly increasing the packet receiving batch number to a preset maximum batch number.
[0021] Optionally, the increasing the packet receiving batch number according to the preset adjustment strategy comprises:
[0022] determining a second target batch number according to the throughput rate and the number of the packets received in the current round, and adjusting the packet receiving batch number to the second target batch number;
[0023] Or, the packet batch processing number is increased to a preset batch processing number.
[0024] Optionally, the method further comprises:
[0025] The preset minimum batch processing number is determined according to host CPU performance and memory performance.
[0026] The preset throughput rate threshold is determined based on the preset minimum batch processing number.
[0027] Optionally, before the data packets are collected according to the packet batch processing number of the cloud host network port queue, the method further comprises:
[0028] The packet batch processing number is initialized to a preset maximum batch processing number.
[0029] In a second aspect, the present application discloses a cloud host packet collection processing device, comprising:
[0030] A data packet collection module is configured to collect data packets according to a packet batch processing number of a cloud host network port queue.
[0031] A data and determination module is configured to determine a size sum of all the data packets collected in the current round.
[0032] A packet collection time determination module is configured to determine a packet collection time of all the data packets collected in the current round.
[0033] A throughput rate determination module is configured to determine a throughput rate of the cloud host network port queue in the current round based on the size sum and the packet collection time.
[0034] A batch processing number adjustment module is configured to adjust the packet batch processing number according to the throughput rate.
[0035] In a third aspect, the present application discloses an electronic device, comprising a processor and a memory; wherein,
[0036] The memory is configured to save a computer program.
[0037] The processor is configured to execute the computer program to implement the cloud host packet collection processing method.
[0038] In a fourth aspect, the present application discloses a computer readable storage medium for saving a computer program, wherein the computer program is executed by a processor to implement the cloud host packet collection processing method.
[0039] It can be seen that the application first collects data packets according to the packet collection batch processing number of the cloud host network port queue, determines the size sum of all the data packets collected in the current round and the packet collection time, then determines the throughput rate of the cloud host network port queue in the current round based on the size sum and the packet collection time, and then adjusts the packet collection batch processing number according to the throughput rate. That is, in the process of collecting data packets according to the packet collection batch processing number of the cloud host network port queue, the packet collection batch processing number of the cloud host network port queue is adjusted in real time according to the throughput rate of each round of data packet collection, so that data packet collection is performed according to the adjusted packet collection batch processing number in the next round of data packet collection. In this way, the packet collection batch processing number is automatically adjusted according to the throughput rate, which not only avoids the problem of low throughput rate and PPS performance caused by single packet processing mode, but also avoids the problem of high network IO waiting and latency of cloud host caused by static batch processing mode. The cloud network data plane performance can be improved while meeting the requirements of reducing network IO waiting frequency and latency, thereby improving the performance of cloud network data plane. BRIEF DESCRIPTION OF DRAWINGS
[0040] In order to more clearly illustrate the technical solutions in the embodiments of the present application or the prior art, the drawings needed to be used in the embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are only some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of the provided drawings.
[0041] Figure 1 A cloud host packet collection processing method flowchart is provided for the present application.
[0042] Figure 2 A specific cloud host packet collection processing flowchart is provided for the present application.
[0043] Figure 3 A cloud host packet collection processing device structure schematic diagram is provided for the present application.
[0044] Figure 4 An electronic device structure diagram is provided for the present application. DETAILED DESCRIPTION
[0045] The technical solutions in the embodiments of the present application will be described clearly and completely in the following with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are only some of the embodiments of the present application, not all. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor are within the scope of protection of the present application.
[0046] Currently, when the network IO of the data plane adopts the single packet processing mode, each function call only processes a single packet, resulting in high per-packet processing overhead and low PPS forwarding capability of the data plane. When the network IO of the data plane adopts the batch processing mode, the batch processing number is a static value. When the batch processing number is large, the per-packet processing overhead can be theoretically reduced. However, in the cloud host network scenario, this may cause network IO waiting and time delay of other cloud hosts. If the batch processing number is small, the value of the batch processing mode cannot be maximized, and thus the forwarding capability of the cloud network data plane cannot be effectively improved. Therefore, the cloud host packet receiving processing scheme provided in the embodiments of the present application can improve the throughput and PPS performance of the cloud host network IO while meeting the requirement of reducing the network IO waiting frequency and time delay, thereby improving the performance of the cloud network data plane.
[0047] Referring to Figure 1 The embodiments of the present application disclose a cloud host packet receiving processing method, comprising:
[0048] Step S11: receiving data packets according to the packet batch processing number of the cloud host network port queue.
[0049] In a specific embodiment, the packet batch processing number of the cloud host network port queue can be initialized to a preset maximum batch processing number before the data packets are received according to the packet batch processing number. That is, the packet receiving processing is performed in the batch processing mode, and the packet batch processing number of the cloud host network port queue is first initialized to the preset maximum batch processing number.
[0050] In one embodiment, the preset maximum batch processing number can be 32, which is the recommended value of DPDK (Data Plane Development Kit).
[0051] The cloud host is a scalable computing service that supports user-defined resources such as CPU, memory, hard disk, network, security, etc., and can be easily adjusted when the demand changes, and appears to the user as a virtual server. The host machine is a physical server on the cloud, and the physical carrier of the cloud host.
[0052] The data plane is the cloud network data forwarding plane, which processes network data packets according to predefined forwarding rules, and provides functions such as Layer 2 virtual switching, Layer 3 virtual routing, and load balancing for cloud hosts.
[0053] Step S12: determining the total size of all the data packets received in the current round and the packet receiving time.
[0054] Step S13: determining a throughput rate of the cloud host network interface queue in the current round of collecting the data packets.
[0055] In a specific embodiment, a sum of sizes of all the data packets collected in the current round by the cloud host network interface queue can be counted, and a packet collection time of all the data collected in the current round is taken as a unit time to obtain a throughput rate of the data packets collected in the current round.
[0056] It should be noted that the throughput rate represents an amount of data transmitted per unit time, and is usually in b / s (bit / s) or B / s (byte / s), which can be used to evaluate the forwarding capability of the network, and the higher the throughput rate, the higher the forwarding capability. In the embodiment of the application, the unit time is determined as a packet collection time of a round of collecting data packets, and a sum of sizes of all the data packets collected in the round is the throughput rate of the data packets collected in the round. PPS represents a transmission rate in units of data packets, which is used to evaluate the forwarding capability of the network, and the larger the PPS, the higher the forwarding capability.
[0057] Step S14: adjusting the packet collection batch number according to the throughput rate.
[0058] In a specific embodiment, the embodiment of the application can determine whether the throughput rate is greater than or equal to a preset throughput rate threshold value; if the throughput rate is greater than or equal to the preset throughput rate threshold value, the packet collection batch number is lowered, and if the throughput rate is less than the preset throughput rate threshold value and the packet collection batch number is not a preset maximum batch number, the packet collection batch number is increased based on the throughput rate of a data packet collection round of a preset number of recent rounds.
[0059] In the embodiment of the application, the preset minimum batch number can be determined according to the host CPU performance and the memory performance, and the preset throughput rate threshold value is determined based on the preset minimum batch number. Specifically, the time consumed by the host CPU to read data of a preset size across NUMA (Non-Uniform Memory Access) nodes can be calculated according to the host CPU performance and the memory performance to obtain a target time, the preset minimum batch number is determined based on the target time, and then the preset throughput rate threshold value is determined based on the preset minimum batch number. That is, the preset minimum batch number and the preset throughput rate threshold value can be determined based on the host CPU performance and the memory performance in the embodiment of the application.
[0060] It should be noted that, because the memory architecture of the host computer basically adopts the NUMA architecture, each CPU has an independent memory controller MC (i.e., Memory Controller), and the CPUs are interconnected through the QPI (i.e., QuickPath Interconnect) / UPI (i.e., Ultra Path Interconnect) bus, when the CPU accesses its directly connected memory, the memory access delay is minimum, which is called local access, and when the CPU accesses the directly connected memory of another CPU, the memory access delay is relatively large, which is called remote access. In the NUMA architecture, there is a performance difference between local memory access and remote memory access of the CPU, therefore, the embodiment of the present application can define T mem : the time consumed by the CPU to read 64KB memory data across the NUMA node. Further, the calculation formula of the preset minimum batch number is bmin = (64 / T mem ), and the calculation formula of the preset throughput threshold is X max = (b min *64K). When the netperf and iperf network performance tools run the TCP (i.e., Transmission Control Protocol) throughput performance test, a large number of 64KB size packets are sent, therefore, the embodiment of the present application selects 64K as the flow control reference value.
[0061] In an embodiment, the specific process of adjusting the packet receiving batch number includes: determining a first target batch number according to the throughput and the number of data packets received in the current round; wherein the first target batch number is less than the preset maximum batch number and greater than or equal to the preset minimum batch number; and adjusting the packet receiving batch number to the first target batch number.
[0062] In another embodiment, the specific process of adjusting the packet receiving batch number includes: directly adjusting the packet receiving batch number to the preset minimum batch number.
[0063] That is, the embodiment of the present application can adopt different batch number adjustment strategies according to the specific scene, when the throughput of the data packets received in the current round is greater than the preset throughput threshold. The batch number to be adjusted can be determined according to the throughput of the data packets received in the current round and the number of data packets received, or the packet receiving batch number can be directly adjusted to the preset minimum batch number.
[0064] Further, in an embodiment, the specific process of increasing the packet batch processing number based on the throughput rate of the last preset number of packet collection rounds comprises: if there is a packet collection round with a throughput rate greater than or equal to the preset throughput rate threshold in the last preset number of packet collection rounds, increasing the packet batch processing number according to a preset adjustment strategy; and if there is no packet collection round with a throughput rate greater than or equal to the preset throughput rate threshold in the last preset number of packet collection rounds, directly increasing the packet batch processing number to a preset maximum batch processing number. In a specific embodiment, the last preset number of times can be one or multiple times.
[0065] In an embodiment, the specific process of increasing the packet batch processing number according to a preset adjustment strategy can comprise: determining a second target batch processing number according to the throughput rate and the number of collected data packets in the current round, and adjusting the packet batch processing number to the second target batch processing number. In another embodiment, the packet batch processing number can be increased to a preset batch processing number. Of course, in other embodiments, the packet batch processing number can also be increased according to a preset adjustment range.
[0066] For example, referring to FIG. 1, a specific cloud host packet collection processing flowchart is disclosed in the embodiments of the present application. Figure 2 The calculation formula of the minimum batch processing number is b min =(64 / T mem ), where T mem is the time consumed by CPU to read 64 KB memory data across NUMA nodes. The maximum batch processing number is b max =32. The calculation formula of the maximum throughput rate threshold is X max =(b min *64K), thereby obtaining the minimum processing number b min , the maximum batch processing number b max , and the maximum throughput rate threshold X max . The cloud host network port packet collection loop comprises: (1) initializing the packet batch processing number of the cloud host network port queue to b max ; (2) if the throughput rate of any round of packet collection reaches the maximum throughput rate X max , adjusting the packet batch processing number of the network port queue and ending the packet collection loop; and (3) if the throughput rate of a round of packet collection is less than the maximum throughput rate X max , continuing to perform packet collection with b max . The specific process of adjusting the packet batch processing number comprises: if the throughput rate of a round of packet collection is greater than or equal to the maximum throughput rate X max , adjusting the batch processing number of the network port queue to b min ; and if the throughput rate of a round of packet collection is less than the maximum throughput rate X maxand the throughput rate of the last round of packet collection is greater than or equal to the maximum throughput rate X max , the batch processing number of the network interface queue is adjusted to 2*b min . If the throughput rate of the packet collection is less than the maximum throughput rate X max , and the batch processing number of the packet collection of the network interface queue is not equal to b max , the batch processing number of the network interface queue is adjusted to b max .
[0067] It can be seen that the embodiment of the present application collects data packets according to the batch processing number of the packet collection of the network interface queue of the cloud host, determines the total size of all the data packets collected in the current round and the packet collection time, then determines the throughput rate of the data packet collected in the current round of the network interface queue of the cloud host based on the total size and the packet collection time, and adjusts the batch processing number of the packet collection according to the throughput rate. That is, in the process of collecting data packets according to the batch processing number of the packet collection of the network interface queue of the cloud host, the batch processing number of the packet collection of the network interface queue of the cloud host is adjusted in real time according to the throughput rate of each round of data packet collection, so that data packet collection is performed according to the adjusted batch processing number of the packet collection in the next round of data packet collection. In this way, the batch processing number of the packet collection is automatically adjusted according to the throughput rate, which not only avoids the problem of low throughput rate and PPS performance caused by the single packet processing mode, but also avoids the problem of high network IO waiting and latency of the cloud host caused by the static batch processing mode. The throughput rate and PPS performance of the cloud network IO can be improved while meeting the requirements of reducing the network IO waiting frequency and latency, thereby improving the performance of the cloud network data plane.
[0068] Referring to Figure 3 , the embodiment of the present application discloses a cloud host packet collection processing device, which comprises:
[0069] A data packet collection module 11 is configured to collect data packets according to the batch processing number of the packet collection of the network interface queue of the cloud host.
[0070] A data and determination module 12 is configured to determine the total size of all the data packets collected in the current round.
[0071] A packet collection time determination module 13 is configured to determine the packet collection time of all the data packets collected in the current round.
[0072] A throughput rate determination module 14 is configured to determine the throughput rate of the data packets collected in the current round of the network interface queue of the cloud host based on the total size and the packet collection time.
[0073] A batch processing number adjustment module 15 is configured to adjust the batch processing number of the packet collection according to the throughput rate.
[0074] It can be seen that, according to the embodiment of the application, the data packets are collected according to the packet collection batch processing number of the cloud host network port queue, and the size sum of all the data packets collected in the current round and the packet collection time are determined, then the throughput rate of the cloud host network port queue in the current round of collecting the data packets is determined based on the size sum and the packet collection time, and then the packet collection batch processing number is adjusted according to the throughput rate. That is, in the process of collecting data packets according to the packet collection batch processing number of the cloud host network port queue, the packet collection batch processing number of the cloud host network port queue is adjusted in real time according to the throughput rate of each round of collecting data packets, so that in the next round of collecting data packets, the data packets are collected according to the adjusted packet collection batch processing number. In this way, the packet collection batch processing number is automatically adjusted according to the throughput rate, which not only avoids the problem of low throughput rate and PPS performance caused by the single packet processing mode, but also avoids the problem of high network IO waiting and latency of the cloud host caused by the static batch processing mode. The cloud network data plane performance can be improved while meeting the requirements of reducing network IO waiting frequency and latency, thereby improving the performance of the cloud network data plane.
[0075] The batch processing number adjustment module 15 specifically includes:
[0076] The throughput rate judgment submodule is configured to judge whether the throughput rate is greater than or equal to a preset throughput rate threshold.
[0077] The first batch processing number adjustment submodule is configured to, if the throughput rate judgment submodule determines that the throughput rate is greater than or equal to the preset throughput rate threshold, lower the packet collection batch processing number.
[0078] The second batch processing number adjustment submodule is configured to, if the throughput rate judgment submodule determines that the throughput rate is less than the preset throughput rate threshold and the packet collection batch processing number is not a preset maximum batch processing number, increase the packet collection batch processing number based on the throughput rate of the data packet collection round of the latest preset number of rounds.
[0079] In a specific embodiment, the first batch processing number adjustment submodule specifically includes:
[0080] The first target batch processing number determination unit is configured to determine a first target batch processing number according to the throughput rate and the number of data packets collected in the current round.
[0081] The first target batch processing number adjustment unit is configured to adjust the packet collection batch processing number to the first target batch processing number.
[0082] In another specific embodiment, the first batch processing number adjustment submodule is specifically configured to:
[0083] directly adjust the packet collection batch processing number to a preset minimum batch processing number.
[0084] In a specific embodiment, the second batch processing number adjustment submodule specifically comprises:
[0085] a historical throughput rate judgment unit configured to judge whether there is a data packet collection round with a throughput rate greater than or equal to the preset throughput rate threshold in the last preset number of data packet collection rounds;
[0086] a first batch processing number adjustment unit configured to, if there is a data packet collection round with a throughput rate greater than or equal to the preset throughput rate threshold in the last preset number of data packet collection rounds, increase the packet collection batch processing number according to a preset adjustment strategy;
[0087] a second batch processing number adjustment unit configured to, if there is no data packet collection round with a throughput rate greater than or equal to the preset throughput rate threshold in the last preset number of data packet collection rounds, directly increase the packet collection batch processing number to a preset maximum batch processing number.
[0088] In a specific embodiment, the first batch processing number adjustment unit is configured to determine a second target batch processing number according to the throughput rate and the number of data packets collected in the current round, and adjust the packet collection batch processing number to the second target batch processing number.
[0089] In another specific embodiment, the first batch processing number adjustment unit is configured to increase the packet collection batch processing number to a preset batch processing number.
[0090] Further, the device further comprises:
[0091] a preset minimum batch processing number determination module configured to determine a preset minimum batch processing number according to host CPU performance and memory performance;
[0092] a preset throughput rate threshold determination module configured to determine the preset throughput rate threshold based on the preset minimum batch processing number.
[0093] Further, the device further comprises a packet collection batch processing number initialization module configured to initialize the packet collection batch processing number to a preset maximum batch processing number before collecting data packets according to the packet collection batch processing number of the cloud host network port queue.
[0094] Further, the present application embodiment also provides an electronic device. Figure 4 The electronic device 20 structure diagram shown in the figure is according to an exemplary embodiment, and the content in the figure cannot be considered as any limitation on the use range of the present application.
[0095] Figure 4A structural schematic diagram of an electronic device 20 is provided in the embodiments of the present application. The electronic device 20 can specifically include at least one processor 21, at least one memory 22, a power supply 23, a communication interface 24, an input / output interface 25 and a communication bus 26. The memory 22 is configured to store a computer program, and the processor 21 is configured to load and execute the computer program to implement the related steps in the cloud host packet receiving processing method disclosed in any of the foregoing embodiments. In addition, the electronic device 20 in the embodiments of the present application can be specifically a server.
[0096] In the embodiments of the present application, the power supply 23 is configured to provide working voltage for each hardware device on the electronic device 20; the communication interface 24 is capable of creating a data transmission channel between the electronic device 20 and external devices, and the communication protocol followed by the communication interface 24 can be any communication protocol applicable to the technical solution of the present application, which is not limited specifically herein; the input / output interface 25 is configured to obtain external input data or output data to the outside, and the specific interface type can be selected according to the specific application needs, which is not limited specifically herein.
[0097] In addition, the memory 22 as a carrier for resource storage can be a read-only memory, a random access memory, a magnetic disk or an optical disk, etc., and the resources stored thereon can include an operating system 221, a computer program 222 and data 223, etc., and the storage mode can be temporary storage or permanent storage.
[0098] The operating system 221 is configured to manage and control each hardware device on the electronic device 20 and the computer program 222, so as to implement the operation and processing of the processor 21 on the data 223 in the memory 22, and the operating system 221 can be Windows Server, Netware, Unix, Linux, etc. In addition to the computer program capable of completing the cloud host packet receiving processing method executed by the electronic device 20 disclosed in any of the foregoing embodiments, the computer program 222 can further include a computer program capable of completing other specific work.
[0099] Further, the embodiments of the present application further disclose a storage medium, and the storage medium stores a computer program. When the computer program is loaded and executed by a processor, the steps of the cloud host packet receiving processing method disclosed in any of the foregoing embodiments are implemented.
[0100] The embodiments in the present 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 device disclosed in the embodiments, since it corresponds to the method disclosed in the embodiments, the description is relatively simple, and the related parts can be referred to the method part.
[0101] The steps of a method or algorithm described in connection with the embodiments disclosed herein can be embodied directly in hardware, in a software module executed by a processor, or in a combination of the two. A software module can reside in RAM, flash memory, ROM, electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), registers, hard disk, a removable disk, a CD-ROM, or any other form of storage medium known in the art. The storage medium can be coupled to the processor such that the processor can read information from, and write information to, the storage medium. In the alternative, the storage medium can be integral to the processor. The processor and the storage medium can reside in an ASIC.
[0102] Finally, it should be noted that, in the description of the application, relational terms such as first and second, and the like, can be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises", "comprising", or any other variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by "comprises a" does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the recited element.
[0103] The cloud host packet processing method, device, equipment and medium provided by the application are introduced in detail above, and the principles and implementation manners of the application are described by applying specific examples. The above description of the embodiments is only used to help understand the method of the application and its core idea; meanwhile, for those skilled in the art, according to the idea of the application, the specific implementation manner and application range can be changed, and the above description of the embodiments is not used to limit the application.
Claims
1. A method for processing packets received by a cloud server, characterized in that, The method includes: Data packets are collected based on the number of packet batches processed in the cloud server's network port queue; Determine the total size of all data packets received in this round and the packet reception time; The throughput of data packets received in this round by the cloud host network interface queue is determined based on the sum of the sizes and the packet reception time. The number of packet receiving batches is adjusted according to the throughput of the data packets received in this round; The adjustment of the packet receiving batch number based on the throughput of the data packets received in this round includes: Determine whether the throughput of the data packets received in this round is greater than or equal to the preset throughput threshold; If the throughput of the data packets received in this round is greater than or equal to the preset throughput threshold, the number of packet receiving batches is reduced; if the throughput of the data packets received in this round is less than the preset throughput threshold, and the number of packet receiving batches is not the preset maximum number of batches, the number of packet receiving batches is increased based on the throughput of the data packet receiving round of the most recent preset number of rounds. The step of increasing the number of packet receiving batches based on the throughput of the most recent preset number of packet receiving rounds includes: if there is a packet receiving round in the most recent preset number of packet receiving rounds with a throughput greater than or equal to the preset throughput threshold, then the number of packet receiving batches is increased according to a preset adjustment strategy; if there is no packet receiving round in the most recent preset number of packet receiving rounds with a throughput greater than or equal to the preset throughput threshold, then the number of packet receiving batches is directly increased to the preset maximum number of batches.
2. The cloud server packet receiving processing method according to claim 1, characterized in that, The reduction of the number of received packets includes: The first target batch size is determined based on the throughput of data packets received in this round and the number of data packets received in this round. Adjust the number of batches received to the first target number of batches.
3. The cloud server packet receiving and processing method according to claim 1, characterized in that, The reduction of the number of received packets includes: The number of batches for receiving packets is directly adjusted to the preset minimum number of batches.
4. The cloud server packet receiving processing method according to claim 1, characterized in that, The step of increasing the number of received packets according to a preset adjustment strategy includes: The second target batch number is determined based on the throughput of the data packets received in this round and the number of data packets received in this round, and the packet receiving batch number is adjusted to the second target batch number. Alternatively, the number of batch processing units for receiving packets can be increased to a preset number of batch processing units.
5. The cloud server packet receiving and processing method according to any one of claims 1 to 4, characterized in that, Also includes: The minimum batch size is determined based on the host machine's CPU and memory performance. The preset throughput threshold is determined based on the preset minimum batch size.
6. A cloud server packet receiving and processing device, characterized in that, include: The data packet receiving module is used to receive data packets based on the number of packet batches processed in the cloud host's network port queue; The data and determination module is used to determine the total size of all data packets received in this round; The packet reception time determination module is used to determine the packet reception time for all data packets in this round. The throughput determination module is used to determine the throughput of the cloud host network interface queue in this round of data packet reception based on the total size and the packet reception time. The batch processing number adjustment module is used to determine whether the throughput of the current round of data packet reception is greater than or equal to a preset throughput threshold. If the throughput of the current round of data packet reception is greater than or equal to the preset throughput threshold, the batch processing number is reduced. If the throughput of the current round of data packet reception is less than the preset throughput threshold, and the batch processing number is not a preset maximum batch processing number, the batch processing number is increased based on the throughput of the most recent preset round of data packet reception. The increase of the batch processing number based on the throughput of the most recent preset round of data packet reception includes: if there is a data packet reception round in the most recent preset round of data packet reception with a throughput greater than or equal to the preset throughput threshold, the batch processing number is increased according to a preset adjustment strategy; if there is no data packet reception round in the most recent preset round of data packet reception with a throughput greater than or equal to the preset throughput threshold, the batch processing number is directly increased to the preset maximum batch processing number.
7. An electronic device, characterized in that, Includes processor and memory; among which, The memory is used to store computer programs; The processor is used to execute the computer program to implement the cloud host packet receiving processing method as described in any one of claims 1 to 5.
8. A computer-readable storage medium, characterized in that, Used to store a computer program, wherein the computer program, when executed by a processor, implements the cloud host packet receiving processing method as described in any one of claims 1 to 5.
Citation Information
Patent Citations
Technologies for dynamic batch size management
US20190007349A1