Flow collector-oriented cache resource management and isolation method and system
By pre-allocating LLC space for the traffic collector during the system startup phase and dynamically adjusting it, the problems of performance fluctuations and low resource utilization efficiency caused by cache contention are solved, achieving high stability and efficient cache management, and meeting the real-time requirements of high-performance traffic collection.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-12-25
- Publication Date
- 2026-03-27
AI Technical Summary
In multi-core processor architectures, cache contention in traffic collectors leads to cache pollution, performance fluctuations, low resource utilization efficiency, and difficulties in QoS assurance. Existing solutions cannot effectively isolate neighbor noise interference, making it difficult to meet the real-time and stability requirements of high-performance traffic collection.
By detecting processor architecture and neighbor noise during system startup, a dedicated cache space is reserved for the traffic collector using an LLC pre-allocation strategy. Furthermore, the LLC allocation is optimized through performance monitoring and adaptive adjustment. A neighbor noise impact assessment model is established, and the LLC partitions are dynamically adjusted to isolate interference.
It improves the performance stability and cache hit rate of the traffic collector, reduces memory access latency, enhances resource utilization efficiency, and ensures QoS guarantee for critical tasks.
Smart Images

Figure CN121750595A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of data processing technology, and more specifically, to a method and system for managing and isolating cache resources for traffic collectors. Background Technology
[0002] With the explosive growth of internet traffic, high-performance traffic collectors are playing an increasingly important role in network monitoring, security analysis, and other fields. Modern data centers and network infrastructures place extremely high demands on the real-time performance, accuracy, and stability of traffic collection, especially when processing high-speed network traffic (such as 10Gbps, 40Gbps, and even 100Gbps), where traffic collectors need to have extremely low latency and extremely high throughput.
[0003] In multi-core processor architectures, the Last Level Cache (LLC) serves as a crucial buffer layer between the processor cores and main memory, and its performance directly impacts the overall system's data processing efficiency. LLCs are typically shared by multiple CPU cores, and when multiple applications or processes run simultaneously, cache contention occurs, known as "neighbor noise." In traditional systems, LLCs employ a dynamic allocation strategy, with each application dynamically occupying LLC space based on its memory access patterns and timing characteristics. However, this dynamic allocation method presents significant problems in high-performance traffic acquisition scenarios: 1. Cache pollution issue: Memory access from other applications may evict data from the traffic collector from the LLC, resulting in a decrease in cache hit rate and increased memory access latency.
[0004] 2. Performance fluctuation issue: Due to the uncertainty of cache contention, the performance of the traffic collector exhibits significant fluctuations, making it difficult to meet real-time requirements.
[0005] 3. Low resource utilization efficiency: LLC space is not optimized according to the importance and performance requirements of the application, resulting in low overall system efficiency.
[0006] 4. Difficulty in ensuring QoS: In a multi-application mixed deployment environment, it is difficult to provide stable quality of service guarantees for critical traffic collection tasks.
[0007] Unpredictable fluctuations in traffic collector performance can be addressed by existing solutions, such as process isolation, NUMA affinity binding, and CPU core exclusivity. However, most of these methods employ passive response strategies, failing to reserve sufficient and stable LLC space for high-performance traffic collectors at system startup and making it difficult to effectively isolate interference from neighboring noise.
[0008] Therefore, there is an urgent need for a proactive LLC management method based on pre-allocation strategies to reduce the impact of neighbor noise on traffic acquisition performance. Summary of the Invention
[0009] To address the shortcomings of existing technologies, the purpose of this invention is to provide a method and system for managing and isolating cache resources for traffic collectors.
[0010] A method for managing and isolating cache resources for traffic collectors according to the present invention includes the following steps: System initialization and resource detection steps: During the system startup phase, the processor's architecture information and supported cache allocation techniques are detected, and the traffic collector process is identified; Neighbor noise detection and analysis steps: Collect load data of the traffic collector, analyze the memory access patterns of neighbor processes, establish a neighbor noise impact assessment model, and quantify the degree of interference of neighbor processes on the performance of the traffic collector. LLC pre-allocation strategy calculation steps: Based on the performance data and load characteristics of the traffic collector, calculate the optimal LLC partition size and generate hardware configuration parameters; Hardware configuration execution steps: Call the system interface to apply the pre-allocation policy to the hardware level, set up a dedicated LLC partition for the traffic collector process, and configure cache usage limits for neighboring processes; Performance monitoring and feedback steps: Continuously monitor the performance metrics of the traffic collector, evaluate the effectiveness of the pre-allocation strategy, and if effective, continue monitoring; otherwise, perform adaptive adjustment and optimization steps. Adaptive adjustment and optimization steps: Dynamically adjust the LLC allocation strategy based on real-time monitoring data.
[0011] Preferably, the detection of processor architecture information and supported cache allocation techniques includes obtaining the number of processor cores, cache hierarchy, and LLC capacity through CPUID instructions and MSR registers.
[0012] Preferably, the LLC pre-allocation strategy calculation step includes: calculating the optimal LLC partition size using a dynamic programming algorithm or a multi-objective optimization algorithm.
[0013] Preferably, the performance monitoring and feedback steps include: establishing a performance baseline, setting performance thresholds and anomaly detection mechanisms, and triggering alarms when performance indicators deviate from expectations.
[0014] Preferably, the adaptive adjustment and optimization step includes: dynamically adjusting the LLC partitioning parameters using a gradient descent algorithm or a genetic algorithm.
[0015] A cache resource management and isolation system for traffic collectors provided by the present invention includes: The system initialization and resource detection module is used to detect the processor's architecture information and supported cache allocation techniques during the system startup phase, and to identify high-performance traffic collector processes. The Neighbor Noise Detection and Analysis module is used to collect load data of the traffic collector and memory access patterns of neighboring processes, establish a neighbor noise impact assessment model, and quantify the degree of interference of neighboring processes on the performance of the traffic collector. The LLC pre-allocation strategy calculation module is used to calculate the optimal LLC partition size based on the performance data and load characteristics of the traffic collector, and generate hardware configuration parameters. The hardware configuration execution module is used to call the system interface, apply the pre-allocation strategy to the hardware level, set up a dedicated LLC partition for the traffic collector process, and configure the cache usage limits of neighboring processes. The performance monitoring and feedback module is used to continuously monitor the performance indicators of the traffic collector and evaluate the effectiveness of the pre-allocation strategy. If it is effective, it will continue to monitor; otherwise, it will execute the adaptive adjustment and optimization module. The adaptive adjustment and optimization module is used to dynamically adjust the LLC allocation strategy based on real-time monitoring data.
[0016] Preferably, the system initialization and resource detection module obtains the number of processor cores, cache hierarchy, and LLC capacity through the CPUID instruction and MSR register.
[0017] Preferably, the LLC pre-allocation strategy calculation module uses a dynamic programming algorithm or a multi-objective optimization algorithm to calculate the optimal LLC partition size.
[0018] Preferably, the performance monitoring and feedback module establishes a performance baseline, sets performance thresholds and anomaly detection mechanisms, and triggers an alarm when performance indicators deviate from expectations.
[0019] Preferably, the adaptive adjustment and optimization module uses a gradient descent algorithm or a genetic algorithm to dynamically adjust the LLC partition. Compared with the prior art, the present invention has the following beneficial effects: 1. This invention, through the LLC pre-allocation mechanism, can effectively isolate neighbor noise interference, improve the performance stability of the traffic collector, significantly reduce the fluctuation of the traffic collector's performance indicators, and ensure that it can maintain stable processing capabilities under high load conditions.
[0020] 2. This invention significantly improves the cache hit rate of the traffic collector by using a dedicated LLC partition, reduces memory access latency caused by cache failure, and lowers the overall processing latency.
[0021] 3. This invention improves LLC resource utilization efficiency through an intelligent pre-allocation algorithm, ensuring the performance of the traffic collector while avoiding resource waste and improving overall system efficiency. Attached Figure Description
[0022] Other features, objects, and advantages of the present invention will become more apparent from the following detailed description of non-limiting embodiments with reference to the accompanying drawings: Figure 1 This is a schematic diagram of the cache resource management and isolation method for traffic collectors in an embodiment of the present invention; Figure 2 This is a system architecture diagram in an embodiment of the present invention. Detailed Implementation
[0023] The present invention will now be described in detail with reference to specific embodiments. These embodiments will help those skilled in the art to further understand the present invention, but do not limit the invention in any way. It should be noted that those skilled in the art can make several changes and improvements without departing from the concept of the present invention. These all fall within the protection scope of the present invention.
[0024] Example 1 Please refer to Figure 1 and Figure 2 This embodiment uses an Intel processor platform as an example and combines Intel Cache Allocation Technology (CAT) to describe in detail the specific implementation process of the present invention. The system runs on a Linux operating system, and the traffic collector is a high-performance network packet processing application based on DPDK (Data Plane Development Kit).
[0025] Step S1: System initialization and resource detection; During system startup, resource checks are performed by performing the following operations: Use the CPUID instruction and Model-Specific Register (MSR) to obtain processor architecture information, including the number of CPU cores, cache hierarchy, total last-level cache (LLC) capacity (e.g., 20MB), and cache partition support. Detect the availability of IntelCAT technology and obtain the number of supported cache partitions (e.g., up to 16 partitions) and the bitmask configuration range for each partition.
[0026] Identify high-performance traffic collector processes running in the system and assign them high priority. Simultaneously, scan other active processes and establish a process priority mapping table, where critical system processes have high priority, and ordinary applications have medium or low priority.
[0027] Step S2: Neighbor noise detection and analysis; The following data is collected in real time using system performance monitoring tools: Key metrics for traffic collectors include: packet processing rate, memory access pattern, LLC hit rate, etc.
[0028] Memory access behavior of neighboring processes: including working set size, memory bandwidth utilization, and LLC miss rate, etc.
[0029] Based on the collected data, a neighbor noise impact assessment model was established. This model uses a linear regression algorithm, taking the LLC miss rate and memory bandwidth usage of neighboring processes as inputs, and outputting an interference score (e.g., 0-100). For example, processes with an interference score higher than 70 are labeled as "high-noise processes".
[0030] In one specific implementation, the method for quantifying the interference of neighbor processes on the performance of the traffic collector includes: First, periodically collecting key indicators of neighbor processes, including LLC miss rate and memory bandwidth utilization, using system performance monitoring tools, and using these data as input features of the model; then, constructing an evaluation model using a linear regression algorithm, determining the weights of each feature through training on historical datasets, thereby quantifying the interference degree of each neighbor process on the traffic collector, and outputting an interference score of 0-100, where a higher score indicates stronger interference. In the specific calculation, the LLC miss rate and memory bandwidth utilization are normalized and substituted into the linear equation, and calibrated by combining empirical parameters from real-world scenarios to ensure that the score reflects the true impact.
[0031] Step S3: LLC pre-allocation strategy calculation; Based on the output of step S2, calculate the optimal LLC allocation scheme: A dynamic programming algorithm is used, with the performance improvement of the traffic collector as the objective function. The objective function is defined as: maximizing the LLC hit rate of the traffic collector and minimizing the overall memory access latency. Constraints include the total LLC capacity and the minimum cache guarantee for neighboring processes.
[0032] Calculate the optimal LLC partition size based on the performance data of the traffic collector and the current load characteristics.
[0033] Based on the current load characteristics of the traffic collector, estimate its required LLC space. Simultaneously, considering the interference scores of neighboring processes, allocate limited LLC space to high-noise processes, while allocating shared remaining space to low-priority processes.
[0034] Generate hardware configuration parameters: For Intel CAT, set the Class of Service (COS) parameter. For example, assign COS1 to the traffic collector, with a corresponding Cache Bit Mask of 0xFF00; assign COS2 to the high-noise process, with a Cache Bit Mask of 0x00F0 (occupying 4-way cache); other processes use the default COS0, with a Cache Bit Mask of 0x000F.
[0035] Step S4: Hardware configuration execution; Apply the pre-allocation strategy via the Linux kernel's resctrl interface (or by writing directly to MSR): Create the resctrl group: Create a dedicated group "traffic_group" for the traffic collector process and set its LLC bitmask to 0xFF00. Write the PID (e.g., 1234) of the traffic collector process to the "traffic_group / tasks" file.
[0036] Create a cache usage limit "noise_limited_group" for high-noise processes, set the bitmask to 0x00F0, and write its PID to the corresponding task file.
[0037] Step S5: Performance monitoring and feedback; During system operation, continuously monitor the following metrics: Traffic collector performance: packet processing latency, throughput, CPU utilization, etc.
[0038] System-wide metrics: LLC partition utilization and memory bandwidth usage. Evaluate the effectiveness of the pre-allocation strategy based on LLC partition usage performance.
[0039] Establish a performance baseline: Before pre-allocation, record the average performance of the traffic collector. After pre-allocation, compare the current performance with the baseline and set anomaly thresholds: for example, trigger an alarm if the LLC hit rate drops below 88% or the latency exceeds 120 microseconds.
[0040] Step S6: Adaptive adjustment and optimization; When the performance monitoring module detects an anomaly or load change, it triggers adaptive adjustment: A feedback control loop is established with traffic collector performance metrics (such as latency, throughput, and cache hit rate) as the optimization objective and LLC partition size as the parameter. When performance metrics deviate from preset thresholds, the LLC partition configuration is adjusted until the performance requirements are met. In a preferred embodiment, a gradient descent algorithm is used to dynamically adjust the LLC partition size. For example, if the traffic collector's LLC hit rate remains below the threshold, its allocated space is increased in 1MB increments (from 8MB to 9MB), while the space for low-priority processes is correspondingly reduced.
[0041] The future load on the traffic collector is predicted based on a load forecasting model (such as the ARIMA time series model). If a burst of traffic is predicted (such as a 20% increase in packet processing rate), the LLC allocation is increased in advance.
[0042] The adjustment process adopts a gradual strategy: wait 5 minutes after each adjustment to observe the effect, and avoid frequent changes that may affect system stability.
[0043] Example 2 This embodiment uses an AMD processor platform as an example, employing AMD Platform Quality of Service (PQoS) technology to achieve similar functionality. The system environment is Windows Server, and the traffic collector is a WinPcap-based real-time traffic analysis application.
[0044] Step S1: System initialization and resource detection; Processor information, including LLC capacity (e.g., 16MB) and PQoS support, can be detected through driver interfaces provided by AMD (such as amd_pqos.sys).
[0045] Use Windows Management Instrumentation (WMI) to query the process list and identify the traffic collector process.
[0046] Step S2: Neighbor noise detection and analysis; Use Windows performance counters to collect metrics from the traffic collector, such as packet processing rate and LLC hit rate.
[0047] Obtain memory access data of neighboring processes using the AMD PQoS monitoring library, including cache misses and memory bandwidth.
[0048] Step S3: LLC pre-allocation strategy calculation; A multi-objective optimization algorithm is employed to balance performance and fairness. The objectives include maximizing the throughput of the traffic collector and minimizing the performance impact of neighbor processes.
[0049] Allocation scheme: Allocate 10MB LLC space to the traffic collector and the remaining 6MB to other processes.
[0050] Step S4: Hardware configuration execution; Call the AMD PQoS API (such as PqosSetCos) to set the cache allocation. Create COS1 for the traffic collector and configure the cache bitmask; set COS2 for other processes.
[0051] The traffic collector process is bound to a specific CPU core (such as cores 0-3) through the process binding interface, and LLC allocation is applied.
[0052] Step S5: Performance monitoring and feedback; Use Windows event tracing to monitor performance metrics in real time. Set performance thresholds: for example, trigger adjustments when throughput drops by 10%.
[0053] Step S6: Adaptive adjustment and optimization; A genetic algorithm is used to optimize LLC allocation parameters. Performance is evaluated every 30 minutes, and the allocation scheme is recalculated if the traffic collector latency increases.
[0054] Those skilled in the art will understand that, besides implementing the system and its various devices, modules, and units provided by this invention in the form of purely computer-readable program code, the same functions can be achieved entirely through logical programming of the method steps, making the system and its various devices, modules, and units of this invention function in the form of logic gates, switches, application-specific integrated circuits, programmable logic controllers, and embedded microcontrollers. Therefore, the system and its various devices, modules, and units provided by this invention can be considered as a hardware component, and the devices, modules, and units included therein for implementing various functions can also be considered as structures within the hardware component; alternatively, the devices, modules, and units for implementing various functions can be considered as both software modules implementing the method and structures within the hardware component.
[0055] In the description of this application, it should be understood that the terms "upper", "lower", "front", "back", "left", "right", "vertical", "horizontal", "top", "bottom", "inner", "outer", etc., indicate the orientation or positional relationship based on the orientation or positional relationship shown in the accompanying drawings. They are only for the convenience of describing this application and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, or be constructed and operated in a specific orientation. Therefore, they should not be construed as limitations on this application.
[0056] Specific embodiments of the present invention have been described above. It should be understood that the present invention is not limited to the specific embodiments described above, and those skilled in the art can make various changes or modifications within the scope of the claims, which do not affect the essence of the present invention. Unless otherwise specified, the embodiments and features described in this application can be arbitrarily combined with each other.
Claims
1. A method for managing and isolating cache resources for traffic collectors, characterized in that, Includes the following steps: System initialization and resource detection steps: During the system startup phase, the processor's architecture information and supported cache allocation techniques are detected, and the traffic collector process is identified; Neighbor noise detection and analysis steps: Collect load data of the traffic collector, analyze the memory access patterns of neighbor processes, establish a neighbor noise impact assessment model, and quantify the degree of interference of neighbor processes on the performance of the traffic collector. LLC pre-allocation strategy calculation steps: Based on the performance data and load characteristics of the traffic collector, calculate the optimal LLC partition size and generate hardware configuration parameters; Hardware configuration execution steps: Call the system interface to apply the pre-allocation policy to the hardware level, set up a dedicated LLC partition for the traffic collector process, and configure cache usage limits for neighboring processes; Performance monitoring and feedback steps: Continuously monitor the performance metrics of the traffic collector, evaluate the effectiveness of the pre-allocation strategy, and if effective, continue monitoring. Conversely, perform adaptive adjustment and optimization steps; Adaptive adjustment and optimization steps: Dynamically adjust the LLC allocation strategy based on real-time monitoring data.
2. The method for managing and isolating cache resources for traffic collectors according to claim 1, characterized in that, The detection of processor architecture information and supported cache allocation techniques includes obtaining the number of processor cores, cache hierarchy, and LLC capacity through CPUID instructions and MSR registers.
3. The method for managing and isolating cache resources for traffic collectors according to claim 1, characterized in that, The LLC pre-allocation strategy calculation steps include: using a dynamic programming algorithm or a multi-objective optimization algorithm to calculate the optimal LLC partition size.
4. The method for managing and isolating cache resources for traffic collectors according to claim 1, characterized in that, The performance monitoring and feedback steps include: establishing a performance baseline, setting performance thresholds and anomaly detection mechanisms, and triggering alarms when performance indicators deviate from expectations.
5. The method for managing and isolating cache resources for traffic collectors according to claim 1, characterized in that, The adaptive adjustment and optimization steps include: dynamically adjusting LLC partitioning parameters using a gradient descent algorithm or a genetic algorithm.
6. A cache resource management and isolation system for traffic collectors, characterized in that, include: The system initialization and resource detection module is used to detect the processor's architecture information and supported cache allocation techniques during the system startup phase, and to identify high-performance traffic collector processes. The Neighbor Noise Detection and Analysis module is used to collect load data of the traffic collector and memory access patterns of neighboring processes, establish a neighbor noise impact assessment model, and quantify the degree of interference of neighboring processes on the performance of the traffic collector. The LLC pre-allocation strategy calculation module is used to calculate the optimal LLC partition size based on the performance data and load characteristics of the traffic collector, and generate hardware configuration parameters. The hardware configuration execution module is used to call the system interface, apply the pre-allocation strategy to the hardware level, set up a dedicated LLC partition for the traffic collector process, and configure the cache usage limits of neighboring processes. The performance monitoring and feedback module is used to continuously monitor the performance metrics of the traffic collector and evaluate the effectiveness of the pre-allocation strategy. If effective, it will continue to monitor. Conversely, execute the adaptive adjustment and optimization module; The adaptive adjustment and optimization module is used to dynamically adjust the LLC allocation strategy based on real-time monitoring data.
7. The cache resource management and isolation system for traffic collectors according to claim 6, characterized in that, The system initialization and resource detection module obtains the number of processor cores, cache hierarchy, and LLC capacity through the CPUID instruction and MSR register.
8. The cache resource management and isolation system for traffic collectors according to claim 6, characterized in that, The LLC pre-allocation strategy calculation module uses dynamic programming or multi-objective optimization algorithms to calculate the optimal LLC partition size.
9. The cache resource management and isolation system for traffic collectors according to claim 6, characterized in that, The performance monitoring and feedback module establishes a performance baseline, sets performance thresholds and anomaly detection mechanisms, and triggers an alarm when performance indicators deviate from expectations.
10. The cache resource management and isolation system for traffic collectors according to claim 6, characterized in that, The adaptive adjustment and optimization module uses dynamic programming or genetic algorithms to adjust LLC partition parameters.