CentOS开启BBR算法加速网络访问

TCP BBR拥塞控制算法

安装环境:CentOS 7

首先,将CentOS 更新到最新的7.3版本

[root@vultr ~]# yum update -y
[root@vultr ~]# cat /etc/redhat-release
CentOS Linux release 7.3.1611 (Core)

其次, 安装elrepo内核
[root@vultr ~]# rpm –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
[root@vultr ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
卸载旧的kernel-headers,kernel-tools, kernel-tools-libs,只保留内核

[root@vultr ~]#rpm -qa |grep kernel
安装elrepo正式版4.9内核,以及kernel-ml-headers kernel-ml-tools kernel-ml-tools-libs
[root@vultr ~]#yum –enablerepo=elrepo-kernel install kernel-ml
安装完后,看看内核启动顺序
[root@vultr ~]#awk -F\’ ‘$1==”menuentry ” {print $2}’ /etc/grub2.cfg
CentOS Linux (4.9.0-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux 7 Rescue e1560806c22f484882d2c9f56a86709a (3.10.0-514.2.2.el7.x86_64)
CentOS Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-327.36.3.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-327.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-31a9087aafb1488babcebd79a3dbb493) 7 (Core)
将kernel-ml 4.9设为启动默认值后重新启动
[root@vultr ~]#grub2-set-default 0
最后在sysctl.conf中打开bbr配置

[root@vultr ~]#vim /etc/sysctl.conf
增加加两行:
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

[root@vultr ~]#sysctl -p

等待生效后就成功了。

***********************************************

centos 6 换4.9内核方法:
rpm –import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

rpm -Uvh http://www.elrepo.org/elrepo-release-6-6.el6.elrepo.noarch.rpm

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

vi /etc/grub.conf     把default=改成0

reboot

************************************************

安装脚本(2019-11)

$: wget -N –no-check-certificate “https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/tcp.sh”
$: chmod +x tcp.sh
$: ./tcp.sh

Leave A Comment