You need to enable JavaScript to run this app.
Elastic Compute Service

Elastic Compute Service

Copy page
Download PDF
Kernel fine-tuning
Modifying RPS-related parameters in Linux operating system
Copy page
Download PDF
Modifying RPS-related parameters in Linux operating system
This topic describes how to configure parameters related to the Receive Packet Steering (RPS) feature in the Linux operating system to optimize network packet processing and improve network performance and load balancing on multicore systems.​
Parameter description​
net.core.rps_sock_flow_entries​
This parameter specifies the maximum number of flow table entries in the Linux kernel, that is, the number of network flows that can be tracked simultaneously. Increasing the value of this parameter can improve RPS performance, thereby enabling more efficient utilization of multiple CPU cores for processing network traffic. Each flow in the flow table corresponds to a network connection. When a packet arrives, the kernel determines the corresponding flow based on the source address, destination address, protocol, and other information of the packet, and then dispatches the packet to the CPU core associated with that flow for processing.​
rps_cpus​
In this practice, rps_cpus refers to the /sys/class/net/<interface>/queues/rx-<queue>/rps_cpus parameter, which specifies the CPU cores that process network flow packets from the specified queue queues of a single network interface. By configuring this argument, you can limit the number of CPU cores involved in RPS processing, thereby improving system performance.​
rps_flow_cnt​
In this practice, rps_flow_cnt refers to the /sys/class/net/<interface>/queues/rx-<queue>/rps_flow_cnt parameter, which specifies the maximum number of flows that can be cached in the RPS queue on each CPU core, within the specified queues of a single network interface. By increasing the value of this parameter, more data packets can be distributed across multiple processing cores, thereby accelerating the processing of data packets.​
Applicable scenario​
  • When the number of CPUs is much greater than the number of network interface queues, you can improve network performance by configuring the rps_sock_flow_entries parameter.​
  • When an ECS instance uses a virtual network interface (for example, veth), you can configure the rps_sock_flow_entries parameter to significantly improve network performance.​
warning​
  • We recommend that you do not configure parameters related to the RPS feature for regular physical network interfaces, as this may increase inter-core interrupt overhead and degrade performance.​
  • RFS depends on RPS. RPS is disabled by default, and you need to enable RPS for RFS-related configuration to take effect. When you configure the CPU list for RPS, we recommend that you select CPUs within the same NUMA domain as the interrupt CPU, and do not select CPUs that are already heavily loaded.​
Procedure​
​
Configuration by using the proc interface
Configuration by using a file
​
You can use this method to temporarily modify the parameter values while the operating system is running. You need to configure the parameters again after the instance restarts.​
  1. Log in to the target instance. For more information, see Logging in to Linux instances.​
  1. Execute the following commands to view the parameter values.​
  • View the value of the rps_sock_flow_entries parameter.​
  • ​
    cat /proc/sys/net/core/rps_sock_flow_entries​
    ​
  • Sample output:​
  • ​​​
  • View the value of the rps_cpus parameter.​
  • ​
    cat /sys/class/net/eth0/queues/rx-*/rps_cpus​
    ​
  • Sample output:​
  • ​​​
  • View the value of the rps_flow_cnt parameter.​
  • ​
    cat /sys/class/net/eth0/queues/rx-*/rps_flow_cnt​
    ​
  • Sample output:​
  • ​​​
  1. Execute the following command to configure parameters.​
  • Configure the rps_sock_flow_entries parameter.​
tip​
We recommend that you set this parameter to 32768. You can also modify the parameter based on your actual needs.​
  • ​
    echo 32768 > /proc/sys/net/core/rps_sock_flow_entries​
    ​
  • Configure the rps_cpus parameter.​
tip​
This command is executed to specify that all available CPU cores are used for processing when the eth0 network interface receives data packets. Replace eth0 with the actual name of the network interface.​
  • ​
    echo ff > /sys/class/net/eth0/queues/rx-*/rps_cpus​
    ​
  • Configure the rps_flow_cnt parameter.​
tip​
In this practice, the number of CPU cores for the instance is 8, and the name of the network interface is eth0.​
  • Replace 4096 with the value of rps_sock_flow_entries divided by the number of CPU cores.​
  • Replace eth0 with the actual name of the network interface.​
  • ​
    echo 4096 > /sys/class/net/eth0/queues/rx-*/rps_flow_cnt​
    ​
​
​
​
Last updated: 2025.11.03 16:31:20