Google BBR 是一款免费开源的TCP拥塞控制传输控制协议, 可以使 Linux 服务器显著提高吞吐量和减少 TCP 连接的延迟。 项目地址:https://github.com/google/bbr

Step1:

1、yum系统更新

  1. yum update

2、查看系统版本

  1. cat /etc/redhat-release
  1. #输出如下则表示已升级到7.6
  2. CentOS Linux release 7.6.1810 (Core)

3、安装elrepo并升级内核

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

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

  1. awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
  1. 0 : CentOS Linux (4.19.0-1.el7.elrepo.x86_64) 7 (Core)
  2. 1 : CentOS Linux 7 Rescue ee7953a3b5944053a26f29daf8c71e2f (3.10.0-862.14.4.el7.x86_64)
  3. 2 : CentOS Linux (3.10.0-862.14.4.el7.x86_64) 7 (Core)
  4. 3 : CentOS Linux (3.10.0-862.3.2.el7.x86_64) 7 (Core)
  5. 4 : CentOS Linux (3.10.0-862.el7.x86_64) 7 (Core)
  6. 5 : CentOS Linux (0-rescue-4bbda2095d924b72b05507b68bd509f0) 7 (Core)

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

  1. grub2-set-default 0

6、重启服务器

  1. reboot

Step2: 设置BBR

1、编辑配置文件

  1. vi /etc/sysctl.conf

2、添加如下内容

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

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

  1. sysctl -p

Step3:验证bbr是否已经开启

1、输入

  1. sysctl net.ipv4.tcp_available_congestion_control

如果返回则安装 成功

  1. net.ipv4.tcp_available_congestion_control = reno cubic bbr

2、输入

  1. lsmod | grep bbr

如果返回则安装 成功

  1. tcp_bbr 20480 2