RPS网卡多队列
一体机上传1G文件导致服务器很卡,怀疑是网卡未开启多核多队列导致。
脚本如下
#!/bin/bash
# Enable RPS (Receive Packet Steering)
read -p "请输入域名前缀(默认为eth0):" nic
nic=${nic:-eth0}
rfc=32768
cc=$(grep -c processor /proc/cpuinfo)
rsfe=$(echo $cc*$rfc | bc)
sysctl -w net.core.rps_sock_flow_entries=$rsfe
for fileRps in $(ls /sys/class/net/nic/queues/rx-*/rps_cpus)
do
echo fff > $fileRps
done
for fileRfc in $(ls /sys/class/net/nic/queues/rx-*/rps_flow_cnt)
do
echo $rfc > $fileRfc
done
tail /sys/class/net/nic/queues/rx-*/{rps_cpus,rps_flow_cnt}