Centos 7开启BBR加速

发布时间:2021-04-04

前言

Google BBR 是一款免费开源的TCP拥塞控制传输控制协议, 可以使 Linux 服务器显著提高吞吐量和减少 TCP 连接的延迟。
yum系统更新

yum update

查看系统版本

cat /etc/redhat-release

输出如下则表示已升级到7.6

CentOS Linux release 7.6.1810 (Core)

安装elrepo并升级内核

rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-ml -y

安装完成后使用下面命令查看当前已安装的内核

awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg

返回

CentOS Linux (4.19.0-1.el7.elrepo.x86_64) 7 (Core)1 : CentOS Linux 7 Rescue 
ee7953a3b5944053a26f29daf8c71e2f (3.10.0-862.14.4.el7.x86_64)2 : CentOS Linux (3.10.0- 
862.14.4.el7.x86_64) 7 (Core)3 : CentOS Linux (3.10.0-862.3.2.el7.x86_64) 7 (Core)4 : CentOS 
Linux (3.10.0-862.el7.x86_64) 7 (Core)5 : CentOS Linux (0-rescue-4bbda2095d924b72b05507b68bd509f0) 7 (Core)

把CentOS Linux (4.19.0-1.el7.elrepo.x86_64) 7 (Core)内核设置为默认

grub2-set-default 0

重启服务器

reboot

设置BBR

vi /etc/sysctl.conf

添加如下内容

net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

加载系统参数(正常情况下会输出我们之前加入的内容)

sysctl -p

验证bbr是否已经开启

sysctl net.ipv4.tcp_available_congestion_control

如果返回

net.ipv4.tcp_available_congestion_control = reno cubic bbr

则安装 成功

lsmod | grep bbr

如果返回

tcp_bbr 20480  2

则安装 成功

打赏


哇 你要支持我吗?太慷慨了!谢谢
上一篇
下一篇
评论 ( 4 )
  1. Boke.One

    你这字体有点奇怪

    2022年03月24日 回复
    1. 是指短代码块嘛?还是网站字体

      2022年03月24日 回复
      1. Boke.One

        网站字体,看着难受

        2022年03月24日 回复
        1. 有空再更新

          2022年03月24日 回复