Debian/Ubuntu内核开启BBR及吞吐性能优化

Posted on

适用场景

适用于高延迟网络环境下的TCP传输优化,加大吞吐并发。

支持优化版本:Debian 9.x or Ubuntu 16.x(低于此版本的系统需要更换Linux内核至4.9+,推荐4.14),仅支持独占或KVM/Xen虚拟化环境

修改办法

配置文件位置:/etc/sysctl.d/local.conf 或 /etc/sysctl.conf(不推荐放在后者)

#Enable BBR Congestion Control Protocol
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

#Optimize File System Operation Performance
fs.file-max = 51200
net.core.rmem_max = 67108864
net.core.wmem_max = 67108864
net.core.rmem_default = 65536
net.core.wmem_default = 65536
net.core.netdev_max_backlog = 4096
net.core.somaxconn = 4096

#Enhance Network Transport/Exchange Performance
net.ipv4.tcp_tw_reuse = 1
net.ipv4.tcp_tw_recycle = 0
net.ipv4.tcp_fin_timeout = 30
net.ipv4.tcp_keepalive_time = 1200
net.ipv4.tcp_max_syn_backlog = 4096
net.ipv4.tcp_max_tw_buckets = 5000
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_rmem = 4096 87380 67108864
net.ipv4.tcp_wmem = 4096 65536 67108864
net.ipv4.tcp_mtu_probing = 1

保存后执行:sysctl --system | reboot

检查BBR模式是否生效:

$ sysctl net.ipv4.tcp_available_congestion_control
$ sysctl net.ipv4.tcp_congestion_control
$ lsmod | grep bbr

END

喜欢本文或者觉得本文有用的话,还请点赞,谢谢

6+