CentOS7配置BBR加速

1. 安装ELRepo

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
# install ELRepo for RHEL-8 or CentOS-8
# rpm -Uvh https://www.elrepo.org/elrepo-release-8.0-2.el8.elrepo.noarch.rpm
# install ELRepo for RHEL-7 or CentOS-7
rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-4.el7.elrepo.noarch.rpm
# install ELRepo for RHEL-6, SL-6 or CentOS-6
rpm -Uvh https://www.elrepo.org/elrepo-release-6-9.el6.elrepo.noarch.rpm

2. 升级 CentOS 7 内核

yum --enablerepo=elrepo-kernel -y install kernel-ml kernel-ml-devel

3. 更新grub引导

# 查询当前内核版本
uname -r
> 3.10.0-957.27.2.el7.x86_64

# 查询可用内核版本
egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'
> CentOS Linux (5.2.14-1.el7.elrepo.x86_64) 7 (Core)
> CentOS Linux (3.10.0-957.27.2.el7.x86_64) 7 (Core)
> CentOS Linux (3.10.0-514.26.2.el7.x86_64) 7 (Core)
> CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)
> CentOS Linux (0-rescue-963c2c41b08343f7b063dddac6b2e486) 7 (Core)

# 更换默认启动内核
grub2-set-default 0

# 重启
reboot

4. 写入BBR配置文件

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
# 保存配置文件
sysctl -p

5. 检查BBR是否启用成功

# 当返回结果包含bbr,则启用成功
sysctl net.ipv4.tcp_available_congestion_control
> net.ipv4.tcp_available_congestion_control = reno cubic bbr

# 当能查询到bbr,则启用成功
lsmod | grep bbr
> tcp_bbr                20480  6

End

至此已成功启用CentOS 7上的Google BBR加速

posted @ 2019-09-11 22:39  雪域熊猫  阅读(3404)  评论(0编辑  收藏  举报