内核性能调优
tuned-adm profile network-latency #Linux系统性能修改为低延迟网络策略
cpupower frequency-set -g performance #CPU频率策略改为性能模式
#内核参数调优(UDP缓存)
sysctl -w net.core.rmem_default=1073741824
sysctl -w net.core.rmem_max=1073741824
sysctl -w net.core.wmem_default=1073741824
sysctl -w net.core.wmem_max=1073741824
sysctl -a |grep net.core
#修改端口mtu
ifconfig eth0 down
ip link set eth0 mtu 9500
ifconfig eth0 up
#设置cpu亲和性(查看网卡所在的numa节点,然后绑定)(注意:中断所在的cpu和iperf绑定的cpu不要选同一个)
cat /sys/class/net/<网口号>/device/numa_node #查看网卡所在的numa节点
cat /proc/interrupts |grep xnic #查看网卡中断号
cat /proc/irq/<中断号>/smp_affinity_list #查看中断号当前所在cpu
echo cpu-num > /proc/irq/<中断号>/smp_affinity_list #将中断号绑定到网卡所在CPU上
taskset -c cpu编号+iperf命令 #将iperf进程绑定到对应的cpu上