一.簡介
Google BBR 是一款免費開源的TCP擁塞控制傳輸控制協議, 可以使Linux服務器顯著提高吞吐量和減少TCP連接的延遲。
二.安裝
1.yum系統更新
yum update
2.查看系統版本
cat /etc/redhat-release
3.安裝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
4.安裝完成后使用下面命令查看當前已安裝的內核
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
返回
0 : 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)
查看當前default的entry
grub2-editenv list
把CentOS Linux (4.19.0-1.el7.elrepo.x86_64) 7 (Core)內核設置為默認,0是第幾號的意思
grub2-set-default 0
5.重啟服務器
reboot
三.設置BBR
1.編輯配置文件,添加內容
vi /etc/sysctl.conf
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
2.加載系統參數(正常情況下會輸出我們之前加入的內容)
sysctl -p
3.驗證bbr是否已經開啟
輸入
sysctl net.ipv4.tcp_available_congestion_control
返回如下是成功
net.ipv4.tcp_available_congestion_control = reno cubic bbr
輸入
lsmod | grep bbr
返回如下成功
tcp_bbr 20480 2