修改网卡参数前得先修改
sysctl -w net.ipv4.tcp_window_scaling=1
sysctl -p
再重启服务器后再修改那些参数才能起效,这就是为啥我们先前修改参数一直没用的原因
1. 设置MTU 例如: ifconfig eth0 mtu 6000
2. ethtool -g eth0 修改RX TX 为 4096
3. 在/etc/sysctl.conf中添加
net.ipv4.tcp_rmem = 53687091 53687091 536870912
net.ipv4.tcp_wmem = 53687091 53687091 536870912
net.ipv4.tcp_mem = 53687091 53687091 536870912
net.core.rmem_max = 536870912
net.core.wmem_max = 536870912
net.core.rmem_default = 53687091
net.core.wmem_default = 53687091
net.core.optmem_max = 536870912