WO2025260970A1 - 调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品 - Google Patents

调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品

Info

Publication number
WO2025260970A1
WO2025260970A1 PCT/CN2025/091478 CN2025091478W WO2025260970A1 WO 2025260970 A1 WO2025260970 A1 WO 2025260970A1 CN 2025091478 W CN2025091478 W CN 2025091478W WO 2025260970 A1 WO2025260970 A1 WO 2025260970A1
Authority
WO
WIPO (PCT)
Prior art keywords
network
network queue
queue
adjustment factor
pressure
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
PCT/CN2025/091478
Other languages
English (en)
French (fr)
Inventor
范雨
徐鑫
司豪
李禄财
张运凯
杨洋
张文涯
张润
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by ZTE Corp filed Critical ZTE Corp
Publication of WO2025260970A1 publication Critical patent/WO2025260970A1/zh
Pending legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/29Flow control; Congestion control using a combination of thresholds

Definitions

  • This disclosure relates to the field of network queue technology, and in particular to a method and apparatus for adjusting network queue parameters, a computer-readable medium, and a computer program product.
  • a device When a device receives and sends network data packets, it can use a network queue for buffering, and the network queue parameters have a significant impact on the device's network performance.
  • This disclosure provides a method and apparatus for adjusting network queue parameters, a computer-readable medium, and a computer program product.
  • This disclosure provides a method for adjusting network queue parameters, comprising: acquiring network queue load data of a target device, wherein the network queue load data characterizes the load status of a network queue in the network device, and the network queue is used to cache network data packets; determining network pressure based on the network queue load data; and adjusting the network queue parameters of the target device based on the network pressure.
  • This disclosure provides an apparatus for adjusting network queue parameters, which includes a memory and a processor.
  • the memory stores a computer program that can be executed by the processor.
  • the computer program When executed by the processor, it implements a method for adjusting network queue parameters according to an embodiment of this disclosure.
  • This disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements a method for adjusting network queue parameters according to embodiments of this disclosure.
  • This disclosure provides a computer program product, which includes a computer program that, when executed by a processor, implements a method for adjusting network queue parameters according to embodiments of this disclosure.
  • Figure 1 is a flowchart of a method for adjusting network queue parameters provided in an embodiment of this disclosure
  • Figure 2 is another flowchart of a method for adjusting network queue parameters provided in an embodiment of this disclosure
  • Figure 3 is a block diagram of the device for adjusting network queue parameters provided in an embodiment of this disclosure
  • Figure 4 is a block diagram of the composition of a computer-readable medium provided in an embodiment of this disclosure.
  • Figure 5 is a schematic diagram of the module division of the device for adjusting network queue parameters provided in an embodiment of this disclosure
  • Figure 6 is a schematic diagram of the logical process of the method for adjusting network queue parameters provided in an embodiment of this disclosure.
  • network queues can be used to cache network data packets. That is, network data packets to be processed are cached in the network queue and processed in the first-in-first-out order.
  • network queue parameters can be set for the device's operating system, i.e., "system-level network queue parameters" can be set.
  • system-level network queue parameters can only be preset by the operator according to several application scenarios, and only one set of default values can be selected at a time. Therefore, such system-level network queue parameters may not be suitable for the specific situation of the device and may not meet the requirements.
  • applications running on the device can set network queue parameters for their own processes; that is, set "process-level network queue parameters.”
  • applications cannot perceive the overall (underlying) network status of the device, and therefore cannot set network queue parameters that meet the requirements based on the specific network conditions of the device.
  • This disclosure provides a method for adjusting network queue parameters, used to control and adjust network queue parameters in a target device.
  • a network queue is used to buffer network packets. It can be of various specific types, such as a process (application) socket receive queue, a system ARP queue, an IP fragmentation reassembly queue, or a network card driver ring buffer.
  • the target device can be a mobile phone, tablet computer or other device that can connect to the network. It can send and receive data (network data packets) and process them through the network.
  • the network data packets can be cached in the network queue of the target device.
  • the network queue parameters are parameters used to set the network queue, such as network queue length, exception handling method, etc.
  • the method for adjusting network queue parameters includes the following steps S101 to S103.
  • step S101 network queue load data of the target device is obtained.
  • Network queue load data characterizes the load status of network queues in network devices.
  • step S102 network pressure is determined based on network queue load data.
  • step S103 the network queue parameters of the target device are adjusted according to the network pressure.
  • data on the load status of the target device's network queue i.e., network queue load data
  • real time e.g., monitored
  • an indicator characterizing the current network load status of the target device i.e., network pressure
  • the network queue parameters of the target device can be adjusted so that the network queue operating according to the adjusted network queue parameters can meet the needs of the current network load status.
  • network pressure can be obtained from network queue load data through a preset stress assessment model.
  • the stress assessment model can comprehensively consider network queue load data such as the arrival rate of network packets within a certain period of time, the number of times/duration of the queue being under pressure, and the number of times/duration of the queue being in an overflow state.
  • the network pressure is calculated through weighted averaging or other methods (for example, values between 0 and 100, with higher values indicating higher load).
  • the network queue length can be increased, thereby allowing more network packets to be cached in the network queue and avoiding packet loss; or, when network pressure indicates that the network queue resources are surplus, the network queue length can be decreased, thereby preventing the network queue from occupying cached resources that are not actually used.
  • network pressure can be calculated based on specific network queue load data in the target device. Then, network queue parameters are adjusted according to the network pressure. This allows for automatic, efficient, and real-time adjustment of network queue parameters without manual intervention, adapting them to demand. It enables rapid response to sudden network performance bottlenecks, achieving quick adjustments, effectively preventing packet loss, and improving service quality.
  • This embodiment has a wide range of applications and can be used in various scenarios (e.g., cloud computing environments, IoT applications, mobile communication networks, etc.), ensuring the stable operation of various applications.
  • adjusting the network queue parameters of the target device according to network pressure includes step S103A.
  • step S103A the system-level network queue parameters and/or process-level network queue parameters of the target device are adjusted according to the network pressure.
  • adjusting network queue parameters can be done by adjusting the network queue parameters of the overall operating system of the target device (i.e., system-level network queue parameters) or by adjusting network queue parameters related to a specific process (i.e., process-level network queue parameters).
  • the cause of the current network pressure can be further analyzed. If the network pressure is caused by the target device as a whole, the system-level network queue parameters can be adjusted by modifying the specified /proc parameters. If the network pressure is caused by a specific process (application), the process can be notified to actively modify its corresponding network queue parameters (i.e., process-level network queue parameters) through signals, shared memory, etc.
  • the process can be notified to actively modify its corresponding network queue parameters (i.e., process-level network queue parameters) through signals, shared memory, etc.
  • the embodiments of this disclosure can adapt to various different situations.
  • the system-level network queue parameters can be adjusted to improve the overall resource management and response capabilities of the target device.
  • the specific needs of different applications can be met through refined process-level network queue parameters to improve the resource utilization efficiency and performance of the applications.
  • adjusting the network queue parameters of the target device according to network pressure includes steps S103B1 to S103B2.
  • step S103B1 the adjustment factor is determined based on the network pressure.
  • the adjustment factor represents the ratio of the adjustment value of the network queue parameters to the original value of the network queue parameters.
  • step S103B2 the network queue parameters of the target device are adjusted according to the adjustment factor.
  • an “adjustment factor” can be calculated in a predetermined manner based on network pressure.
  • the adjustment factor represents the specific "proportion" by which the current network queue parameters should be adjusted (e.g., increasing the network queue length by 10%), thereby allowing the network queue parameters to be adjusted accordingly based on the adjustment factor.
  • adjustment factors can be obtained based on network pressure mapping through a preset mapping function (e.g., linear mapping, logarithmic transformation, sigmoid transformation, etc.).
  • a preset mapping function e.g., linear mapping, logarithmic transformation, sigmoid transformation, etc.
  • determining the adjustment factor based on network pressure includes steps S103B11 to S103B12.
  • step S103B11 the initial adjustment factor is obtained based on the network pressure mapping.
  • step S103B12 the initial adjustment factor is smoothed according to the historical adjustment factor information to obtain the adjustment factor.
  • Historical adjustment factor information includes multiple previously used adjustment factors.
  • step S103B3 is also included.
  • step S103B3 the adjustment factor is recorded in the historical adjustment factor information.
  • the adjustment factor used each time can be recorded in historical adjustment factor information. Accordingly, when calculating the adjustment factor, an initial adjustment factor can be directly calculated based on network pressure, and then smoothed based on historical adjustment factor information to obtain the final adjustment factor used (and recorded).
  • an initial adjustment factor can be obtained based on a network pressure "mapping".
  • the initial adjustment factor can be obtained by performing a linear mapping, logarithmic transformation, sigmoid transformation, etc., based on the network pressure.
  • the purpose of smoothing is to make the adjustment factor obtained in this calculation as close as possible to the adjustment factors used in previous calculations (i.e., to make the curve as smooth as possible), thereby preventing drastic fluctuations in the adjustment factor and avoiding drastic fluctuations in network performance due to excessive adjustment of network queue parameters.
  • the historical adjustment factor information also includes the network performance change corresponding to the adjustment factor.
  • the network performance change corresponding to the adjustment factor characterizes the amount of change in the network performance of the target device relative to the state before the adjustment, after the network queue parameters of the target device are adjusted according to the adjustment factor.
  • recording the adjustment factor in the historical adjustment factor information includes step S103B31.
  • step S103B31 the current network performance of the target device is obtained, and the network performance change corresponding to the adjustment factor is determined based on the current network performance and the network performance of the target device before adjustment.
  • the adjustment factor and the corresponding network performance change are recorded in the historical adjustment factor information.
  • the overall network performance of the target device before and after each adjustment using the adjustment factor, the overall network performance of the target device can be recorded, and the change in network performance after adjustment relative to the network performance before adjustment (i.e., network performance change) can be calculated.
  • the network performance change and the adjustment factor are recorded together in the historical adjustment factor information.
  • the network performance change corresponding to the adjustment factor is also referred to, thereby obtaining an adjustment factor with better smoothing effect.
  • Network performance is a performance indicator that represents the overall network status of a target device. It can be derived by comprehensively considering indicators such as packet loss rate, throughput, and latency (e.g., weighted average).
  • the adjustment factor (and the corresponding network performance changes) can be analyzed according to the time sequence of usage to establish a model of the adjustment factor changing over time. Then, the smoothed adjustment factor can be predicted based on the historically used adjustment factor (and the corresponding network performance changes) and the initial adjustment factor.
  • determining network pressure based on network queue load data includes step S101A.
  • step S101A in response to the network queue load data meeting a preset first condition, the network pressure is determined based on the network queue load data.
  • network pressure can be calculated only when the network queue load data meets a preset first condition, thereby reducing unnecessary computation.
  • the first condition indicates that the network queue resources are highly likely to be overloaded or excessive, for example, network queue pressure and/or network queue overflow occurs more than a predetermined number of times within a time period.
  • the socket receive queue of an application can be monitored.
  • a preset threshold e.g. 90%
  • a queue pressure is recorded.
  • a queue overflow is recorded. If queue pressure and/or queue overflow occur consecutively within a preset period (e.g., the number of times exceeds the preset threshold), network pressure calculation begins.
  • adjusting the network queue parameters of the target device according to network pressure includes step S102A.
  • step S102A in response to the network pressure meeting a preset second condition, the network queue parameters of the target device are adjusted according to the network pressure.
  • the network queue parameters of the target device can be adjusted only if the calculated network pressure meets a preset second condition (e.g., an adjustment factor is calculated and the network queue parameters are adjusted according to the adjustment factor), thereby avoiding excessively frequent adjustments to the network queue parameters.
  • the second condition indicates whether the network load is very high or very low; for example, the network pressure exceeds a preset threshold or is less than another preset threshold.
  • an embodiment of the present disclosure provides a device for adjusting network queue parameters, which includes a memory and a processor; the memory stores a computer program that can be executed by the processor, and when the computer program is executed by the processor, it implements any of the methods for adjusting network queue parameters according to the embodiments of the present disclosure.
  • this disclosure provides a computer-readable medium having a computer program stored thereon, which, when executed by a processor, implements a method for adjusting network queue parameters according to any of the embodiments of this disclosure.
  • an embodiment of this disclosure provides a computer program product, which includes a computer program that, when executed by a processor, implements a method for adjusting network queue parameters according to any embodiment of this disclosure.
  • a processor is a device with data processing capabilities, including but not limited to a central processing unit (CPU); a memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); an I/O interface (read/write interface) connects the processor and the memory, enabling information exchange between the memory and the processor, including but not limited to a data bus (Bus).
  • CPU central processing unit
  • a memory is a device with data storage capabilities, including but not limited to random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), and flash memory (FLASH); an I/O interface (read/write interface) connects the processor and the memory, enabling information exchange between the memory and the processor, including but not limited to a data bus (Bus).
  • Buss data
  • the method for adjusting network queue parameters in this embodiment of the present disclosure can be executed by a device for adjusting network queue parameters, the device including a stress monitoring module A100, a network queue tuning module A110, and a performance feedback module A120.
  • the pressure monitoring module A100 is used to monitor the load of the network queue in the device system in real time, periodically acquire and record relevant data (i.e., network queue load data), and when it is determined that the network queue resources are overloaded or excessive, calculate the network pressure, notify and trigger the network queue tuning module A110.
  • relevant data i.e., network queue load data
  • the pressure monitoring module A100 in this embodiment may include a status recording unit A101 and a pressure assessment unit A102.
  • the status recording unit A101 is used to provide a data basis to the pressure assessment unit A102; the pressure assessment unit A102 is used to calculate the network pressure based on the received data, and to perform the operation of notifying the network queue tuning module A110 according to a specific state or state change.
  • the status recording unit A101 can insert monitoring points into the kernel protocol stack message queuing process.
  • the monitoring points periodically collect and analyze basic indicators such as the arrival rate of network packets and the percentage of network queue usage.
  • the pressure monitoring threshold interface e.g., /proc interface
  • the user can flexibly configure the sensitivity of network pressure according to the business situation.
  • a user can configure the usage threshold of a certain application's socket receive network queue to be 90%.
  • the monitoring point is responsible for recording and judging at the packet queuing point: when the network queue usage exceeds the threshold (90%), a network queue pressure is recorded; when the network queue usage exceeds 100%, a network queue overflow is recorded; if network queue pressure and/or network queue overflow occur continuously within a period of time (i.e., the first condition is met), the count of the network queue continuously being in a pressure state and/or overflow state is updated.
  • the period ends, the number of network packets arriving within the period is updated, and the above data is sent to the pressure assessment unit A102 in the form of parameter transmission to trigger the assessment unit A102 to calculate the network pressure based on the data.
  • the stress assessment unit A102 can calculate the current network stress based on the above data according to the preset stress assessment model, and send a network queue optimization signal to the network queue optimization module A110 when the network stress deviates from the normal fluctuation range (i.e., meets the second condition).
  • the stress assessment model can comprehensively consider multiple influencing factors such as the arrival rate of network packets within a period, the number of times/duration of the network queue being under stress, and the number of times/duration of the network queue being in an overflow state (i.e., network queue load data).
  • the stress assessment model may be a weighted average model, which calculates network stress according to the following formula:
  • n is the number of influence factors
  • ci is the normalized value of the i-th influence factor (ranging from 0 to 1)
  • wi is the weight value of the i-th influence factor, with each wi ranging from 0 to 100. That is, the sum of the weight values is 100, and thus the network pressure between 0 and 100 can be calculated.
  • a rule-based approach can be used to adjust the weight values of factors such as network queue overflow factor and network queue pressure factor based on factors such as packet arrival rate and service type within a period; alternatively, a statistical learning-based approach can be used to train the optimal combination of weight values through supervised learning.
  • the status of the network queue can be assessed based on the calculated network pressure.
  • the network queue shrinking strategy should be triggered (i.e., adjusting the network queue parameters to shrink the network queue); when the network pressure is in the range of 60 to 100, it can be considered that the network queue resources are overloaded (high pressure), and the network queue expanding strategy should be triggered (i.e., adjusting the network queue parameters to increase the network queue), and an optimization request should be actively sent to the network queue optimization module A110; when the network pressure is in the range of 20 to 60, it can be considered that the network queue resources are used appropriately and no adjustment is required (i.e., the second condition is not met).
  • the network queue tuning module A110 is used to calculate the adjustment factor based on the network pressure (carried in the tuning request) from the pressure monitoring module A100, and to perform the adjustment and configuration of the network queue parameters based on the adjustment factor.
  • the network queue optimization module A110 in this embodiment includes a parameter calculation unit A111 and a parameter configuration unit A112.
  • the parameter calculation unit A111 provides optimization decisions based on data analysis; the parameter configuration unit A112 is responsible for converting these decisions into actual network queue parameter adjustments.
  • the parameter calculation unit A111 receives an optimization request from the stress monitoring module A100, determines the current optimization strategy (reducing or expanding the network queue strategy) based on the network pressure carried therein, calculates the initial adjustment factor, and simultaneously considers the adjustment factors used in each previous optimization, the network performance changes after adjustment (i.e., network performance changes), and other records (i.e., historical adjustment factor information) to smooth the initial adjustment factor and obtain the final adjustment factor used.
  • the initial adjustment factor can be obtained by mapping network stress, such as using linear mapping, logarithmic transformation, sigmoid transformation, etc.
  • mapping network stress such as using linear mapping, logarithmic transformation, sigmoid transformation, etc.
  • a model of the adjustment factor changing over time can be established using time series analysis methods. Then, the smoothed adjustment factor value is predicted based on historical data and influencing factors, and recorded for subsequent configuration operations by the parameter configuration unit A112.
  • the parameter configuration unit A112 is used to maintain and adjust all network queue parameters, specifically including system-level network queue parameters and/or process-level network queue parameters. First, it obtains the current system-level network queue parameters and/or process-level network queue parameters, along with the adjustment factor given by the parameter calculation unit A111, to calculate the optimized system-level network queue parameters and/or process-level network queue parameters (e.g., network queue length). Then, it performs parameter configuration within the system's allowed configuration range. The parameter configuration unit A112 is also used to verify whether the configuration is effective, including verifying whether the configured parameters meet process resource limits and system global resource limits. If the configuration fails, it may be because the parameter adjustment has exceeded the adjustment range, thus requiring the failure information to be fed back to the parameter calculation unit A111 for adaptive adjustments.
  • the optimized system-level network queue parameters and/or process-level network queue parameters e.g., network queue length
  • the parameter configuration unit A112 is also used to verify whether the configuration is effective, including verifying whether the configured parameters meet process resource limits and system
  • system-level network queue parameters can be adjusted by modifying a specified /proc parameter; for process-level network queue parameters, the process can be notified to actively modify the corresponding network queue parameters through signals, shared memory, or other means.
  • the performance feedback module A120 is used to evaluate the performance changes of the network before and after the adjustment (i.e., network performance changes) and feed back the smoothing message to the network queue tuning module A110, so that the network queue tuning module A110 can smooth the initial adjustment factor to ensure the stability and performance of the system.
  • the performance feedback module A120 includes a performance evaluation unit A121 and a tuning history record unit A122, which together complete a comprehensive evaluation of network performance.
  • the performance evaluation unit A121 provides real-time feedback on network performance
  • the tuning history record unit A122 records the changes in network performance before and after tuning, so as to adjust the optimization strategy of the network queue (i.e., the smoothing process).
  • the performance evaluation unit A121 uses relevant tools to monitor the network performance of the operating system, or the process actively performs network performance testing internally to obtain changes in parameters such as network packet loss rate before and after adjustment.
  • the performance evaluation unit A121 may use tools such as iperf, iftop, and traceroute to obtain network performance.
  • the performance evaluation unit A121 can be used primarily in two scenarios.
  • the first scenario is the development phase, where the performance evaluation unit A121 monitors the overall network metrics such as packet loss rate, throughput, and latency. Under relatively stable basic business scenarios, it comprehensively evaluates network performance and obtains stable values for optimal network queue parameters through repeated tuning processes.
  • the second scenario is the routine deployment phase, where the evaluation unit A121 focuses on evaluating the network's packet loss rate to anticipate and dynamically adjust for sudden pressure scenarios, preventing packet loss from occurring.
  • the tuning history unit A122 records the network performance of the system after parameter adjustment and compares it with the network performance before tuning to determine the change in network performance.
  • the optimization history unit A122 can record the network performance at different time points and draw a historical curve of network performance changes based on this data to help analyze the effect of parameter adjustment, so as to adjust the optimization strategy of the optimization algorithm according to the characteristics of historical data, and feed the message back to the network queue optimization module A110.
  • the method for adjusting network queue parameters may include the following steps B210 to B240.
  • step B210 start the pressure monitoring module, network queue optimization module, and performance feedback module, and ensure that the inter-module collaborative operation is normal.
  • step B220 the pressure monitoring module periodically monitors the operating status of the network queue and calculates the network pressure.
  • the network queue optimization module is triggered to perform optimization.
  • step B230 the network queue tuning module calculates the initial adjustment factor based on the stress monitoring data, and smooths the initial adjustment factor by comprehensively considering records such as network performance changes and stress changes. The network queue tuning is then performed based on the smoothed adjustment factor, and the results are monitored.
  • step B240 the performance feedback module evaluates the changes in network performance before and after parameter adjustment, records the parameter adjustment history, and sets a minimum adjustment interval to guide and coordinate a smooth tuning process.
  • this embodiment takes adjusting the process-level socket receive buffer as an example to describe in detail the method for adjusting network queue parameters of this disclosure embodiment, which may include the following steps one to four.
  • step one the upper-layer business process is started, and the various resources of the network queue optimization device are initialized, including stress monitoring data (network packet arrival rate within a period, number of times/duration of network queue under stress, number of times/duration of network queue in overflow state), network queue adjustment factor, stress assessment model parameters, etc.
  • stress monitoring data network packet arrival rate within a period, number of times/duration of network queue under stress, number of times/duration of network queue in overflow state
  • network queue adjustment factor stress assessment model parameters, etc.
  • step two by adding a monitoring point to the socket packet receiving process of the kernel protocol stack transport layer, the real-time network queue usage percentage of the service process (e.g., a specific socket) is collected during normal service operation.
  • the network queue usage percentage exceeds the user-configured threshold
  • a network queue pressure status is recorded. If the network queue usage percentage exceeds the threshold consecutively, the count of the network queue continuously under pressure is recorded and updated.
  • a network queue overflow status is recorded. If the network queue usage percentage exceeds the limit consecutively, the count of the network queue continuously overflowing is updated.
  • the network pressure of the current network queue is periodically evaluated, and key influencing factors are normalized. The network pressure is obtained by using a weighted average sum of the above influencing factors.
  • step three the network queue adjustment factor is calculated by assessing the network pressure status. Simultaneously, considering network performance metrics and pressure changes, the factor is smoothed to calculate the adjusted network queue parameter size. An adjustment signal is sent to notify the process to use ⁇ setsockopt() ⁇ to adjust the ⁇ SO_RCVBUF ⁇ receive buffer parameters. The configuration is then checked to verify its effectiveness. If the configuration fails, it indicates that the current matching exceeds the adjustment range, and the tuning factor needs to be recalculated for adaptive adjustments.
  • step four after parameter adjustments, relevant monitoring tools are used to monitor network performance metrics such as packet loss rate during process execution. Simultaneously, the network queue pressure is reassessed using the network pressure calculation method from step two, and the changes in network pressure before and after adjustments are recorded. If the pressure is alleviated, the tuning factor is decreased; if the pressure is not alleviated, the tuning factor is increased. The network performance metrics and historical network pressure information are fed back into the tuning factor calculation model in step three to guide the calculation of the tuning factor in step three.
  • relevant monitoring tools are used to monitor network performance metrics such as packet loss rate during process execution. Simultaneously, the network queue pressure is reassessed using the network pressure calculation method from step two, and the changes in network pressure before and after adjustments are recorded. If the pressure is alleviated, the tuning factor is decreased; if the pressure is not alleviated, the tuning factor is increased. The network performance metrics and historical network pressure information are fed back into the tuning factor calculation model in step three to guide the calculation of the tuning factor in step three.
  • the process of calculating the adjustment factor in the embodiments of this disclosure may include the following steps C310 to C340.
  • a stress assessment factor i.e., an influencing factor
  • this data is monitored periodically, such as the network packet arrival rate, the number of times/duration the network queue is under stress, and the number of times/duration the network queue is in an overflow state within a period.
  • step C320 the stress assessment model is trained by inputting stress assessment factors and outputting network stress.
  • step C330 intelligent tuning is achieved based on pressure perception and performance feedback.
  • the tuning calculation model is trained, the network pressure of the network queue is input, the expansion factor or contraction factor of the network queue tuning is obtained, and the parameter values of the network queue after tuning are output.
  • step C340 after the tuning is completed, the tuning factor is further smoothed based on the network performance feedback results before and after the adjustment.
  • the stress assessment model and optimization calculation model are implemented using, but are not limited to, rule-based methods and machine learning methods. Those skilled in the art can make appropriate selections based on the specific circumstances.
  • the division between functional modules/units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be executed by several physical components working together.
  • Some or all of the physical components may be implemented as software executed by a processor, such as a central processing unit (CPU), digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC).
  • a processor such as a central processing unit (CPU), digital signal processor, or microprocessor, or as hardware, or as an integrated circuit, such as an application-specific integrated circuit (ASIC).
  • ASIC application-specific integrated circuit
  • Such software may be distributed on a computer-readable medium, which may include computer storage media (or non-transitory media) and communication media (or transient media).
  • computer storage media includes volatile and non-volatile, removable and non-removable media implemented in any method or technique for storing information (such as computer-readable instructions, data structures, program modules, or other data).
  • Computer storage media include, but are not limited to, random access memory (RAM, more specifically SDRAM, DDR, etc.), read-only memory (ROM), electrically erasable programmable read-only memory (EEPROM), flash memory (FLASH) or other disk storage; read-only optical disc (CD-ROM), digital versatile disc (DVD) or other optical disc storage; magnetic cartridges, magnetic tapes, disk storage or other magnetic storage; and any other media that can be used to store desired information and can be accessed by a computer.
  • communication media typically contain computer-readable instructions, data structures, program modules, or other data in modulated data signals such as carrier waves or other transmission mechanisms, and may include any information delivery medium.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

本公开提供了一种调整网络队列参数的方法,包括:获取目标设备的网络队列负载数据,其中,所述网络队列负载数据表征网络设备中的网络队列的负载情况,所述网络队列用于缓存网络数据包;根据所述网络队列负载数据确定网络压力;根据所述网络压力调整所述目标设备的网络队列参数。本公开还提供了一种调整网络队列参数的设备、计算机可读介质、计算机程序产品。

Description

调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品
相关申请的交叉引用
本申请要求于2024年6月19日提交的名称为“调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品”的中国专利申请CN 202410796935.9的优先权,其全部内容通过引用并入本文中。
技术领域
本公开涉及网络队列技术领域,特别涉及一种调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品。
背景技术
设备接收和发送网络数据包时,可采用网络队列(Network Queue)进行缓存,而网络队列参数对设备的网络性能有着重要的影响。
在一些相关技术中,无法根据具体情况实时调整网络队列参数,导致一些情况下(例如,网络负载激增时)网络队列参数不足以维持业务正常运行,出现网络处理瓶颈、丢包等,影响服务质量。
发明内容
本公开提供一种调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品。
本公开实施例提供一种调整网络队列参数的方法,包括:获取目标设备的网络队列负载数据,其中,所述网络队列负载数据表征网络设备中的网络队列的负载情况,所述网络队列用于缓存网络数据包;根据所述网络队列负载数据确定网络压力;根据所述网络压力调整所述目标设备的网络队列参数。
本公开实施例提供一种调整网络队列参数的设备,其包括存储器、处理器,所述存储器存储有能被所述处理器执行的计算机程序,所述计算机程序被所述处理器执行时实现根据本公开实施例的调整网络队列参数的方法。
本公开实施例提供一种计算机可读介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现根据本公开实施例的调整网络队列参数的方法。
本公开实施例提供一种计算机程序产品,其包括计算机程序,所述计算机程序被处理器执行时实现根据本公开实施例的调整网络队列参数的方法。
附图说明
在本公开实施例的附图中:
图1为本公开实施例提供的调整网络队列参数的方法的流程图;
图2为本公开实施例提供的调整网络队列参数的方法的另一流程图;
图3为本公开实施例提供的调整网络队列参数的设备的组成框图;
图4为本公开实施例提供的计算机可读介质的组成框图;
图5为本公开实施例提供的调整网络队列参数的设备的模块划分示意图;
图6为本公开实施例提供的调整网络队列参数的方法的逻辑过程示意图。
具体实施方式
为使本领域的技术人员更好地理解本公开的技术方案,下面结合附图对本公开实施例提供的调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品进行详细描述。
在下文中将参考附图更充分地描述本公开,但是所示的实施例可以以不同形式来体现,且本公开不应当被解释为限于以下阐述的实施例。相反,提供这些实施例的目的在于使本公开透彻和完整,并将使本领域技术人员充分理解本公开的范围。
本公开实施例的附图用来提供对本公开实施例的进一步理解,并且构成说明书的一部分,与详细实施例一起用于解释本公开,并不构成对本公开的限制。通过参考附图对详细实施例进行描述,以上和其它特征和优点对本领域技术人员将变得更加显而易见。
本公开可借助本公开的理想示意图而参考平面图和/或截面图进行描述。因此,可根据制造技术和/或容限来修改示例图示。
在不冲突的情况下,本公开各实施例及实施例中的各特征可相互组合。
本公开所使用的术语仅用于描述特定实施例,且不意欲限制本公开。如本公开所使用的术语“和/或”包括一个或多个相关列举条目的任何和所有组合。如本公开所使用的单数形式“一个”和“该”也意欲包括复数形式,除非上下文另外清楚指出。如本公开所使用的术语“包括”、“由……制成”,指定存在所述特征、整体、步骤、操作、元件和/或组件,但不排除存在或添加一个或多个其它特征、整体、步骤、操作、元件、组件和/或其群组。
除非另外限定,否则本公开所用的所有术语(包括技术术语和科学术语)的含义与本领域普通技术人员通常理解的含义相同。还将理解,诸如那些在常用字典中限定的那些术语应当被解释为具有与其在相关技术以及本公开的背景下的含义一致的含义,且将不解释为具有理想化或过度形式上的含义,除非本公开明确如此限定。
本公开不限于附图中所示的实施例,而是包括基于制造工艺而形成的配置的修改。因此,附图中例示的区具有示意性属性,并且图中所示区的形状例示了元件的区的具体形状,但并不是旨在限制性的。
各种网络设备(例如,手机、平板电脑等)经常需要通过网络发送和接收网络数据包,为保证能够按顺序处理网络数据包以及网络服务的稳定性,可采用网络队列对网络数据包进行缓存,即,将待处理的网络数据包缓存在网络队列中,并按照先入先出的顺序对网络队列中的网络数据包进行处理。
由此,网络队列参数(例如,网络队列长度、异常处理方式等)的设定对设备的网络性能会产生很大的影响。
在一些相关技术中,可为设备的操作系统设定网络队列参数,即,设置“系统级网络队列参数”。但是,系统级网络队列参数只能由操作人员根据几种应用场景预先设置几组“默认值”,并且同一时间只能选择其中一组默认值,因此这样的系统级网络队列参数不一定能适应设备的具体情况,可能无法满足需求。
在另一些相关技术中,可由设备中运行的应用程序对自身相关进程的网络队列参数进行设置,即,设置“进程级网络队列参数”。但是,应用程序无法对设备整体(底层)的网络情况进行感知,因此同样无法根据设备具体的网络情况,随时设定符合要求的网络队列参数。
由此,相关技术无法根据具体情况实时调整网络队列参数,导致一些情况下(例如,网络负载激增时)网络队列参数不足以维持业务正常运行,出现网络处理瓶颈、丢包等,影响服务质量。
本公开实施例提供一种调整网络队列参数的方法,用于对目标设备中的网络队列参数进行控制、调整。
网络队列(Network Queue)用于缓存网络数据包,其可为各种具体类型的队列,例如,进程(应用程序)socket接收队列、系统arp队列、ip分片重组队列、网卡驱动环形缓冲区等。
本公开实施例中,目标设备可以为手机、平板电脑等能连接网络的设备,可通过网络发送、接收数据(网络数据包)并进行处理,网络数据包可缓存在目标设备的网络队列中,网络队列参数是用于设置网络队列的参数,例如,网络队列长度、异常处理方式等。
参照图1,根据本公开实施例的调整网络队列参数的方法包括如下步骤S101至S103。
在步骤S101,获取目标设备的网络队列负载数据。
网络队列负载数据表征网络设备中的网络队列的负载情况。
在步骤S102,根据网络队列负载数据确定网络压力。
在步骤S103,根据网络压力调整目标设备的网络队列参数。
本公开实施例中,实时地获取(例如,监控)有关目标设备的网络队列的负载情况的数据(即,网络队列负载数据),例如,网络队列中网络数据包的到达速率、网络队列长度、队列压力持续占比等指标;根据网络队列负载数据,可计算得到表征目标设备当前的网络负载情况的指标(即,网络压力Network Stress);根据网络压力,可对目标设备的网络队列参数进行调整,使按照调整后的网络队列参数工作的网络队列可满足当前网络负载情况的需求。
本公开实施例中,根据网络队列负载数据得到网络压力的具体方式是多样的。
例如,可通过预设的压力评估模型,根据网络队列负载数据得到网络压力。压力评估模型可综合考虑一定时间内网络数据包的到达速率、队列处于压力状态次数/持续时间、队列处于溢出状态次数/持续时间等网络队列负载数据,根据为各数据预设的权重值,通过加权平均等方式计算出网络压力(例如,为0~100间的值,值越大表示负载越高)。
本公开实施例中,调整目标设备的网络队列参数的具体方式也是多样的。
例如,可以在网络压力表明网络队列的资源过载时,增大网络队列长度,从而使网络队列中能缓存更多的网络数据包,避免丢包;或者,可以在网络压力表明网络队列的资源过剩时,减小网络队列长度,从而避免网络队列占用实际不使用的缓存资源。
本公开实施例中,可根据目标设备中具体的网络队列负载数据计算得到网络压力,再根据网络压力调整网络队列参数,从而可在不需要人工干预的情况下,自动、高效、实时地对网络队列参数进行调整,使其适应需求,在面对网络性能突发瓶颈时可迅速做出反应,实现快速调整,有效预防丢包,改善服务质量。本公开实施例的适用范围广,可用于各种场景(例如,云计算环境、物联网应用、移动通信网络等),可为各种应用的平稳运行提供保障。
在一些实施例中,根据网络压力调整目标设备的网络队列参数(即,步骤S103)包括步骤S103A。
在步骤S103A,根据网络压力调整目标设备的系统级网络队列参数和/或进程级网络队列参数。
根据本公开实施例,对网络队列参数进行调整,可以是对目标设备整体的操作系统的网络队列参数(即,系统级网络队列参数)进行调整,也可以是对与特定进程相关的网络队列参数(即,进程级网络队列参数)进行调整。
例如,可进一步分析造成当前网络压力的原因,若网络压力是由目标设备整体导致的,可通过修改指定/proc参数等方式对系统级网络队列参数进行调整;若网络压力是由特定进程(应用程序)导致的,可通过信号、共享内存等形式,通知该进程主动修改其对应的网络队列参数(即,进程级网络队列参数)。
由此,本公开实施例可适应各种不同的情况,当应用场景改变时,可对系统级网络队列参数进行调整,提高目标设备整体的资源管理和响应能力;针对运行中的不同应用程序,可通过精细化的进程级网络队列参数满足不同应用程序的特定需求,以提升应用程序的资源利用效率和性能。
在一些实施例中,参照图2,根据网络压力调整目标设备的网络队列参数(S103)包括步骤S103B1至S103B2。
在步骤S103B1,根据网络压力确定调整因子。
调整因子表征对网络队列参数的调整值相对网络队列参数的原值的比例。
在步骤S103B2,根据调整因子调整目标设备的网络队列参数。
根据本公开实施例,可以根据网络压力,按照预定方式计算得到“调整因子”。调整因子表示应对当前的网络队列参数的具体值进行多大“比例”的调整(例如,将网络队列长度增大10%等),从而可根据调整因子相应地调整网络队列参数。
本公开实施例中,根据网络压力得到调整因子的具体方式是多样的。
例如,可通过预设的映射函数(例如,线性映射、对数变换、Sigmoid变换等),根据网络压力映射得到调整因子等。
应当理解,本公开实施例不限于以上的具体方式,例如,也可根据网络压力直接计算出调整后的网络队列参数的具体值等。
在一些实施例中,参照图2,根据网络压力确定调整因子(即,步骤S103B1)包括步骤S103B11至S103B12。
在步骤S103B11,根据网络压力映射得到初始调整因子。
在步骤S103B12,根据历史调整因子信息对初始调整因子进行平滑处理得到调整因子。
历史调整因子信息包括多个之前使用过的调整因子。
在根据调整因子调整目标设备的网络队列参数(即,步骤S103B2)之后,还包括步骤S103B3。
在步骤S103B3,将调整因子记录在历史调整因子信息中。
根据本公开实施例,可以将每次使用的调整因子记录到历史调整因子信息中。相应地,在计算调整因子时,可先根据网络压力直接计算得到的初始调整因子,并根据历史调整因子信息对初始调整因子进行平滑处理,得到最终使用(并记录)的调整因子。
根据本公开实施例,可根据网络压力“映射”得到初始调整因子,例如,根据网络压力进行线性映射、对数变换、Sigmoid变换等得到初始调整因子。
平滑处理的作用是使本次计算得到的调整因子与之前各次使用的调整因子尽量接近(即,曲线尽量平滑),从而可防止调整因子剧烈波动,以避免因网络队列参数的调整幅度过大而导致网络性能出现剧烈波动。
在一些实施例中,历史调整因子信息还包括与调整因子对应的网络性能变化。与调整因子对应的网络性能变化表征了在根据调整因子调整目标设备的网络队列参数之后,目标设备的网络性能相对调整前的变化量。
参照图2,将调整因子记录在历史调整因子信息(即,步骤S103B3)包括步骤S103B31。
在步骤S103B31,获取目标设备的当前网络性能,根据当前网络性能和调整前目标设备的网络性能确定与调整因子对应的网络性能变化,将调整因子和对应的网络性能变化记录在历史调整因子信息中。
根据本公开实施例,在每次使用调整因子进行调整的前后,还可分别将目标设备整体的网络性能记录下来,并计算出调整后的网络性能相对调整前的网络性能的变化量(即,网络性能变化),将网络性能变化与调整因子一起记录在历史调整因子信息中,从而在对初始调整因子进行平滑的过程中,除参考调整因子外,还参考与调整因子对应的网络性能变化,从而得出平滑效果更好的调整因子。
网络性能是代表目标设备的网络整体情况的性能指标,可根据丢包率、吞吐量、延迟等指标综合得出(例如,加权平均等方式)网络性能。
本公开实施例中,进行平滑的具体方式是多样的。
例如,可按照使用时间的序列对调整因子(以及对应的网络性能变化)进行分析,以建立调整因子随时间变化的模型,然后根据历史上使用的调整因子(以及对应的网络性能变化)和初始调整因子预测得到平滑后的调整因子。
在一些实施例中,参照图2,根据网络队列负载数据确定网络压力(即,步骤S101)包括步骤S101A。
在步骤S101A,响应于网络队列负载数据符合预设的第一条件,根据网络队列负载数据确定网络压力。
根据本公开实施例,可以在网络队列负载数据满足预设的第一条件时,才相应计算网络压力,从而减少不必要的运算量。第一条件表征了网络队列的资源有很大可能过载或过剩,例如,在一个时间周期内发生网络队列压力和/或网络队列溢出超过预定次数。
例如,可对某应用程序的socket接收队列进行监控,当该网络队列使用占比超过一个预设阈值(例如,90%)时记录一次队列压力,当网络队列使用占比超过100%时记录一次队列溢出,在预设周期内连续出现队列压力和/或队列溢出的情况(例如,次数超过预设阈值)时,开始进行网络压力的计算。
在一些实施例中,参照图2,根据网络压力调整目标设备的网络队列参数(即,步骤S102)包括步骤S102A。
在步骤S102A,响应于网络压力符合预设的第二条件,根据网络压力调整目标设备的网络队列参数。
根据本公开实施例,当需要计算网络压力时,可以仅在计算得到的网络压力符合预设的第二条件时,才相应根据网络压力调整目标设备的网络队列参数(例如,计算调整因子并根据调整因子调整网络队列参数),从而避免对网络队列参数的过于频繁的调整。第二条件表征了网络负载很大或很小,例如,网络压力超过一个预设阈值,或小于另一个预设阈值。
参照图3,本公开实施例提供一种调整网络队列参数的设备,其包括存储器、处理器;存储器存储有能被处理器执行的计算机程序,计算机程序被处理器执行时实现根据本公开实施例的任意一种调整网络队列参数的方法。
参照图4,本公开实施例提供一种计算机可读介质,其上存储有计算机程序,计算机程序被处理器执行时实现根据本公开实施例的任意一种调整网络队列参数的方法。
参照图5,本公开实施例提供一种计算机程序产品,其包括计算机程序,计算机程序被处理器执行时实现根据本公开实施例的任意一种调整网络队列参数的方法。
处理器为具有数据处理能力的器件,其包括但不限于中央处理器(CPU)等;存储器为具有数据存储能力的器件,其包括但不限于随机存取存储器(RAM,更具体如SDRAM、DDR等)、只读存储器(ROM)、带电可擦可编程只读存储器(EEPROM)、闪存(FLASH);I/O接口(读写接口)连接在处理器与存储器间,能实现存储器与处理器的信息交互,其包括但不限于数据总线(Bus)等。
下面对本公开实施例的调整网络队列参数的方法进行示例性的介绍。
参照图5,本公开实施例的调整网络队列参数的方法可由调整网络队列参数的设备执行,该设备包括压力监控模块A100、网络队列调优模块A110、性能反馈模块A120。
本公开实施例中,压力监控模块A100用于实时监测设备系统中的网络队列的负载情况,周期性获取并记录相关的数据(即,网络队列负载数据),当判断网络队列资源利用过载或过剩时,计算网络压力,通知并触发网络队列调优模块A110。
参照图5,本公开实施例中的压力监控模块A100可包括状态记录单元A101与压力评估单元A102。状态记录单元A101用于向压力评估单元A102提供数据基础;压力评估单元A102用于根据收到的数据计算网络压力,并根据特定状态或状态变化执行通知网络队列调优模块A110的操作。
示例性地,状态记录单元A101可在内核协议栈报文入队流程中插入监控点,监控点周期性的采集、分析网络数据包的到达速率、网络队列使用占比等基础指标,同时将压力监控阈值接口(例如,/proc接口)暴露给用户,用户可根据业务情况对网络压力的敏感性进行灵活配置。
例如,在实施例中,用户可配置某应用程序的socket接收网络队列的使用占比阈值为90%,从而在一个指定周期内,监控点负责在报文入队处记录并进行判断:当网络队列使用占比超过该阈值(90%)时,记录一次网络队列压力;当网络队列使用占比超过100%时,记录一次网络队列溢出;若一段时间内连续出现网络队列压力和/或网络队列溢出的情况(即,符合第一条件),则更新网络队列持续处于压力状态和/或溢出状态的计数,当周期结束后,更新周期内网络数据包的达到数量,并将上述数据以参数传递形式发送给压力评估单元A102,以触发评估单元A102根据这些数据计算网络压力。
示例性地,压力评估单元A102可根据预设的压力评估模型,根据以上数据计算当前的网络压力,并在网络压力偏离正常的波动范围(即,符合第二条件)时发送网络队列调优信号给网络队列调优模块A110。
压力评估模型可综合考虑周期内网络数据包的到达速率、网络队列处于压力状态次数/持续时间、网络队列处于溢出状态次数/持续时间等多个影响因子(即,网络队列负载数据)。
例如,在实施例中,压力评估模型可为加权平均模型,其根据以下公式计算网络压力:
其中,stress表示网络压力,n为影响因子的个数,ci为第i个影响因子归一化后的数值(取值范围为0~1),wi为第i个影响因子的权重值,每个wi的取值范围0~100,且 即,权重值的总和为100,由此,可计算得到0~100之间的网络压力。
在为每个影响因子分配权重值时,可采用基于规则的方法,根据周期内包到达速率、业务类型等,调整网络队列溢出因子、网络队列压力因子等的权重值;也可采用基于统计学习的方法,通过监督学习训练出最佳的权重值组合。
当网络压力计算完毕后,可根据计算的网络压力评估网络队列的状态。
例如,可认为网络压力处于0~20的区间时代表网络队列资源过剩,应触发缩小网络队列策略(即,进行缩小网络队列的网络队列参数调整);网络压力处于60~100的区间时代表网络队列资源过载(高压),应触发扩大网络队列策略(即,进行增大网络队列的网络队列参数调整),主动发送调优请求至网络队列调优模块A110;网络压力处于20~60的区间时,认为网络队列资源利用适中,无需做出任何调整(即,不符合第二条件)。
本公开实施例中,网络队列调优模块A110用于根据来自压力监控模块A100的网络压力(承载在调优请求中)计算调整因子,并根据调整因子执行网络队列参数的调整、配置。
参照图5,本公开实施例中的网络队列调优模块A110包含参数计算单元A111、参数配置单元A112。参数计算单元A111提供了基于数据分析得出的调优决策;参数配置单元A112负责将这些决策转化为实际的网络队列参数调整。
示例性地,参数计算单元A111接收来自压力监控模块A100的调优请求,通过其中承载的网络压力确定当前调优策略(缩小网络队列策略或扩大网络队列策略),计算得到初始调整因子,同时综合考虑之前每次调优中使用的调整因子、调整后的网络性能变化(即,网络性能变化)等记录(即,历史调整因子信息),平滑初始调整因子,得到最终使用的调整因子。
例如,在实施例中,初始调整因子可通过将网络压力映射得来,如可使用线性映射、对数变换、Sigmoid变换等映射。在平滑初始调整因子时,可使用时间序列分析方法建立调整因子随时间变化的模型,然后根据历史数据和影响因子预测得到平滑后的调整因子的值,并将记录,供参数配置单元A112执行后续配置操作。
示例性地,参数配置单元A112用于维护和调整所有网络队列参数,具体包括系统级网络队列参数和/或进程级网络队列参数。首先,获取当前的系统级网络队列参数和/或进程级网络队列参数,以及参数计算单元A111给出的调整因子,从而计算得到调优后的系统级网络队列参数和/或进程级网络队列参数(例如,网络队列长度);随后,在系统允许配置的范围内执行参数配置。参数配置单元A112还用于验证配置是否生效,包括验证配置后的参数是否满足进程资源限制与系统全局资源限制,若配置失败,则可能是本次参数调整超出调整范围,从而需要将失败信息反馈给参数计算单元A111,以便于做出适应性调整。
例如,在实施例中,可通过修改指定/proc参数实现系统级网络队列参数的调整;对于进程级网络队列参数,可通过信号、共享内存等形式,通知进程主动修改对应的网络队列参数。
本公开实施例中,性能反馈模块A120用于评估调整前后网络的性能变化(即,网络性能变化),并将平滑消息反馈至网络队列调优模块A110,使得网络队列调优模块A110能够对初始调整因子进行平滑,以确保系统的稳定性和性能。
本公开实施例中,参照图5,性能反馈模块A120包含性能评估单元A121、调优历史记录单元A122,二者共同完成对网络性能的全面评估。性能评估单元A121提供有关网络性能的实时反馈,调优历史记录单元A122记录调优前后的网络性能的变化,以便于调整网络队列的优化策略(即,平滑过程)。
示例性地,性能评估单元A121在参数配置单元A112完成配置后,使用相关工具来监测操作系统的网络性能,或进程在内部主动执行进行网络性能测试,以获取调整前后网络丢包率等参数的变化。
例如,在实施例中,性能评估单元A121可选用iperf、iftop、traceroute等工具获取网络性能。
可主要在两种场景使用性能评估单元A121。第一种场景为开发阶段,性能评估单元A121在本阶段整体监控网络的丢包率、吞吐量、延迟等指标,在较为稳定的基础业务场景下,综合评估网络性能,并通过重复调优过程得出性能最优的网络队列参数的稳定值;第二种场景为常态化部署阶段,评估单元A121在本阶段重点评估网络的丢包率,以便于面临突发压力场景,提前预知并进行动态调整,防止丢包的情况出现。
示例性地,调优历史记录单元A122记录参数调整后系统的网络性能情况,并与调优前的网络性能进行对比,以得出网络性能的变化。
例如,在实施例中,在参数调整完成后,调优历史记录单元A122可以记录在不同时间点的网络性能,并根据这些数据绘制出网络性能变化历史曲线,帮助分析参数调整的效果,以根据历史数据的特征调整优化算法的优化策略,并将消息反馈至网络队列调优模块A110。
示例性地,参照图6,本公开实施例的调整网络队列参数的方法可包括以下步骤B210至B240。
在步骤B210,启动压力监控模块、网络队列调优模块、性能反馈模块,并确保模块间协同运行状态正常。
在步骤B220,压力监控模块周期性监控网络队列的运行状态,计算网络压力,当网络压力超出正常波动范围,触发网络队列调优模块进行调优。
在步骤B230,网络队列调优模块基于压力监控数据,计算初始调整因子,并综合考虑网络性能变化、压力变化等记录,平滑初始调整因子,根据平滑后的调整因子执行网络队列调优并监控结果。
在步骤B240,性能反馈模块评估参数调整前后的网络性能变化,记录参数调整历史,并设定最小调整间隔,以指导和协调平滑的调优过程。
示例性地,参照图6,本实施例以调整进程级套接字(socket)接收缓冲区为例,对本公开实施例的调整网络队列参数的方法进行详细说明,其可包括以下步骤一至步骤四。
在步骤一,启动上层业务进程,并初始化网络队列调优装置的各项资源,包括压力监控数据(周期内网络数据包到达速率、网络队列处于压力状态次数/持续时间、网络队列处于溢出状态次数/持续时间)、网络队列调整因子、压力评估模型参数等。
在步骤二,通过在内核协议栈传输层的套接字收包流程中新增监控点,在业务正常运行过程中,采集该业务进程(例如,某个socket)的网络队列实时使用占比情况。当网络队列使用占比超出用户配置的阈值比例时,记录一次网络队列压力状态;若连续出现网络队列使用占比超出阈值情况,记录并更新网络队列持续处于压力状态的计数。当网络队列使用占比超出当前系统/进程配置的限额时,记录一次网络队列溢出状态;若连续出现网络队列使用占比超出限额的情况,更记录并新网络队列持续处于溢出状态的计数。随后,周期性评估当前网络队列的网络压力,对关键影响因子做归一化处理。对上述影响因子使用加权平均和方式求得网络压力。
在步骤三,通过判断网络压力的状态,计算得到网络队列调整因子。同时综合考虑网络性能指标、压力变化等记录,平滑因子变化,计算调整后的网络队列参数大小。通过发送调整信号的形式,通知进程使用setsockopt()调整SO_RCVBUF接收缓冲区参数,随后查询验证配置是否生效,若配置失败,则说明此次匹配超出调整范围,需重新计算调优因子,以便于做出适应性调整。
在步骤四,在执行完参数调整后,使用相关的监控工具来监测进程运行时网络丢包率等网络性能指标。同时使用步骤二中的网络压力计算方法再次评估网络队列压力,记录系统在调整前后的网络压力变化。若压力缓解则减小调优因子;若压力未缓解,则增大调优因子。将网络性能指标与网络压力历史信息,反馈至步骤三中的调优因子计算模型中,指导第三步中调优因子的计算。
示例性地,参照图6,本公开实施例中计算调整因子的过程可包括以下步骤C310至C340。
在步骤C310,定义压力评估因子(即,影响因子),并周期性监控该数据,例如,周期内网络数据包到达速率、网络队列处于压力状态次数/持续时间、网络队列处于溢出状态次数/持续时间。
在步骤C320,训练压力评估模型,输入压力评估因子,输出网络压力。
在步骤C330,基于压力感知-性能反馈实现智能调优,训练调优计算模型,输入网络队列网络压力,得到网络队列调优的扩大因子或缩小因子,并输出网络队列调优后的参数值。
在步骤C340,在完成调优后,根据调整前后的网络性能反馈结果,进一步平滑调优因子。
本算法在具体实施过程中,压力评估模型、调优计算模型的实现包含但不限于基于规则的方法、机器学习方法等。本领域的人员可以根据实际情况进行合理选择。
本领域普通技术人员可以理解,上文中所公开的全部或某些步骤、系统、装置中的功能模块/单元可以被实施为软件、固件、硬件及其适当的组合。
在硬件实施方式中,在以上描述中提及的功能模块/单元之间的划分不一定对应于物理组件的划分;例如,一个物理组件可以具有多个功能,或者一个功能或步骤可以由若干物理组件合作执行。
某些物理组件或所有物理组件可以被实施为由处理器,如中央处理器(CPU)、数字信号处理器或微处理器执行的软件,或者被实施为硬件,或者被实施为集成电路,如专用集成电路。这样的软件可以分布在计算机可读介质上,计算机可读介质可以包括计算机存储介质(或非暂时性介质)和通信介质(或暂时性介质)。如本领域普通技术人员公知的,术语计算机存储介质包括在用于存储信息(诸如计算机可读指令、数据结构、程序模块或其它数据)的任何方法或技术中实施的易失性和非易失性、可移除和不可移除介质。计算机存储介质包括但不限于随机存取存储器(RAM,更具体如SDRAM、DDR等)、只读存储器(ROM)、带电可擦可编程只读存储器(EEPROM)、闪存(FLASH)或其它磁盘存储器;只读光盘(CD-ROM)、数字多功能盘(DVD)或其它光盘存储器;磁盒、磁带、磁盘存储或其它磁存储器;可以用于存储期望的信息并且可以被计算机访问的任何其它的介质。此外,本领域普通技术人员公知的是,通信介质通常包含计算机可读指令、数据结构、程序模块或者诸如载波或其它传输机制之类的调制数据信号中的其它数据,并且可包括任何信息递送介质。
本公开已经公开了示例实施例,并且虽然采用了具体术语,但它们仅用于并仅应当被解释为一般说明性含义,并且不用于限制的目的。在一些实例中,对本领域技术人员显而易见的是,除非另外明确指出,否则可单独使用与特定实施例相结合描述的特征、特性和/或元素,或可与其它实施例相结合描述的特征、特性和/或元件组合使用。因此,本领域技术人员将理解,在不脱离由所附的权利要求阐明的本公开的范围的情况下,可进行各种形式和细节上的改变。

Claims (10)

  1. 一种调整网络队列参数的方法,包括:
    获取目标设备的网络队列负载数据,其中,所述网络队列负载数据表征网络设备中的网络队列的负载情况,所述网络队列用于缓存网络数据包;
    根据所述网络队列负载数据确定网络压力;
    根据所述网络压力调整所述目标设备的网络队列参数。
  2. 根据权利要求1所述的方法,其中,根据所述网络压力调整所述目标设备的网络队列参数包括:
    根据所述网络压力调整所述目标设备的系统级网络队列参数和/或进程级网络队列参数。
  3. 根据权利要求1所述的方法,其中,根据所述网络压力调整所述目标设备的网络队列参数包括:
    根据所述网络压力确定调整因子,其中,所述调整因子表征对所述网络队列参数的调整值相对所述网络队列参数的原值的比例;
    根据所述调整因子调整所述目标设备的网络队列参数。
  4. 根据权利要求3所述的方法,其中,根据所述网络压力确定调整因子包括:
    根据所述网络压力映射得到初始调整因子;
    根据历史调整因子信息对所述初始调整因子进行平滑处理得到所述调整因子,其中,所述历史调整因子信息包括多个之前使用过的调整因子,
    在根据所述调整因子调整所述目标设备的网络队列参数之后,所述方法还包括:
    将所述调整因子记录在所述历史调整因子信息中。
  5. 根据权利要求4所述的方法,其中,
    所述历史调整因子信息还包括与所述调整因子对应的网络性能变化,所述调整因子对应的网络性能变化表征在根据所述调整因子调整所述目标设备的网络队列参数之后,所述目标设备的网络性能相对调整前的变化量,
    将所述调整因子记录在历史调整因子信息中包括:
    获取所述目标设备的当前网络性能,根据所述当前网络性能和调整前所述目标设备的网络性能确定与所述调整因子对应的网络性能变化,将所述调整因子和对应的网络性能变化记录在所述历史调整因子信息中。
  6. 根据权利要求1所述的方法,其中,根据所述网络队列负载数据确定网络压力包括:
    响应于所述网络队列负载数据符合预设的第一条件,根据所述网络队列负载数据确定网所述络压力。
  7. 根据权利要求1所述的方法,其中,根据所述网络压力调整所述目标设备的网络队列参数包括:
    响应于所述网络压力符合预设的第二条件,根据所述网络压力调整所述目标设备的网络队列参数。
  8. 一种调整网络队列参数的设备,其包括存储器、处理器,所述存储器存储有能被所述处理器执行的计算机程序,所述计算机程序被所述处理器执行时实现根据权利要求1至7中任意一项所述的调整网络队列参数的方法。
  9. 一种计算机可读介质,其上存储有计算机程序,所述计算机程序被处理器执行时实现根据权利要求1至7中任意一项所述的调整网络队列参数的方法。
  10. 一种计算机程序产品,其包括计算机程序,所述计算机程序被处理器执行时实现根据权利要求1至7中任意一项所述的调整网络队列参数的方法。
PCT/CN2025/091478 2024-06-19 2025-04-27 调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品 Pending WO2025260970A1 (zh)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN202410796935.9A CN120602432A (zh) 2024-06-19 2024-06-19 调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品
CN202410796935.9 2024-06-19

Publications (1)

Publication Number Publication Date
WO2025260970A1 true WO2025260970A1 (zh) 2025-12-26

Family

ID=96898262

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2025/091478 Pending WO2025260970A1 (zh) 2024-06-19 2025-04-27 调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品

Country Status (2)

Country Link
CN (1) CN120602432A (zh)
WO (1) WO2025260970A1 (zh)

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101997776A (zh) * 2010-11-18 2011-03-30 无锡源清高新技术研究所有限公司 基于拥塞辨识的路由器队列控制系统及其控制方法
WO2013151468A1 (en) * 2012-04-03 2013-10-10 Telefonaktiebolaget L M Ericsson (Publ) Method and arrangement for queue management
US20140140209A1 (en) * 2011-03-20 2014-05-22 King Abdullah University Of Science And Technology Buffer sizing for multi-hop networks
US20140355439A1 (en) * 2013-05-29 2014-12-04 Verizon Patent And Licensing Inc. End-to-end quality of service optimization and reporting
US20150222560A1 (en) * 2014-02-05 2015-08-06 Verizon Patent And Licensing Inc. Capacity management based on backlog information
CN106027412A (zh) * 2016-05-30 2016-10-12 南京理工大学 一种基于拥塞队列长度的tcp拥塞控制方法

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101207665B (zh) * 2007-11-05 2010-12-08 华为技术有限公司 一种衰减因子的获取方法
CN117729157A (zh) * 2023-06-26 2024-03-19 行吟信息科技(上海)有限公司 数据处理方法、装置、电子设备和存储介质

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101997776A (zh) * 2010-11-18 2011-03-30 无锡源清高新技术研究所有限公司 基于拥塞辨识的路由器队列控制系统及其控制方法
US20140140209A1 (en) * 2011-03-20 2014-05-22 King Abdullah University Of Science And Technology Buffer sizing for multi-hop networks
WO2013151468A1 (en) * 2012-04-03 2013-10-10 Telefonaktiebolaget L M Ericsson (Publ) Method and arrangement for queue management
US20140355439A1 (en) * 2013-05-29 2014-12-04 Verizon Patent And Licensing Inc. End-to-end quality of service optimization and reporting
US20150222560A1 (en) * 2014-02-05 2015-08-06 Verizon Patent And Licensing Inc. Capacity management based on backlog information
CN106027412A (zh) * 2016-05-30 2016-10-12 南京理工大学 一种基于拥塞队列长度的tcp拥塞控制方法

Also Published As

Publication number Publication date
CN120602432A (zh) 2025-09-05

Similar Documents

Publication Publication Date Title
CN109819057B (zh) 一种负载均衡方法及系统
CN112689007B (zh) 资源分配方法、装置、计算机设备和存储介质
CN112612618B (zh) 接口限流方法、装置、计算机设备和存储介质
CN107800574B (zh) 存储qos调节方法、系统、设备及计算机可读存储器
US20250190250A1 (en) Scheduler, Job Scheduling Method, and Related Device
CN110247816A (zh) 指标监控方法及装置
CN116346740B (zh) 一种负载均衡方法及装置
CN118233469A (zh) 基于延迟感知和负载均衡的计算任务调度方法、系统
CN116302578B (zh) 一种QoS约束的流应用延迟确保方法及系统
CN112866128A (zh) 分布式网络的限速方法、装置及电子设备
CN118733502A (zh) 一种数据传输方法、装置、电子设备及介质
CN118827563A (zh) 流量控制方法、装置、设备、存储介质和程序产品
CN113438274A (zh) 数据传输方法、装置、计算机设备及可读存储介质
CN110098976B (zh) 网络参数的测量方法、装置、计算机设备和存储介质
CN116208615A (zh) 网络数据处理方法、处理模块、阵列服务器和介质
WO2025260970A1 (zh) 调整网络队列参数的方法和设备、计算机可读介质、计算机程序产品
CN113986475A (zh) 容器集群的负载均衡方法、计算机设备及存储介质
CN110727518A (zh) 一种数据处理方法及相关设备
CN115297057B (zh) 基于信息管理平台的网络流量控制方法
CN111158899A (zh) 一种数据的采集方法、采集器、任务管理中心以及系统
CN117707760A (zh) 一种负载平衡方法、装置、设备及存储介质
CN117271154A (zh) 大数据量请求处理方法及装置
CN118035028A (zh) 一种用于多核处理器芯片的自适应调节QoS方法及装置
CN110636104B (zh) 一种资源请求方法、电子设备及存储介质
CN114422530A (zh) 流量控制方法、装置和计算机设备和存储介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 25829453

Country of ref document: EP

Kind code of ref document: A1