BBR(Bottleneck Bandwidth and RTT)是一种新的拥塞控制算法,由Google开发。有了BBR,Linux服务器可以显着提高吞吐量并减少连接延迟。
查看当前内核版本:
uname -r
安装 ELRepo 源:
sudo rpm --import <https://www.elrepo.org/RPM-GPG-KEY-elrepo.org>
sudo rpm -Uvh <http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm>
从 ELRepo 源安装最新版内核 :
sudo yum --enablerepo=elrepo-kernel install kernel-ml -y
查看已安装的内核列表:
rpm -qa | grep kernel
显示所有 grub2 menu 项:
sudo egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \‘
设置开机默认 grub2 项(上面的菜单列表标记从0开始)
sudo grub2-set-default 0
重启系统:
sudo shutdown -r now
确认内核已经切换到最新版本:
uname -r
修改并保存 sysctl 配置:
echo ‘net.core.default_qdisc=fq‘ | sudo tee -a /etc/sysctl.conf
echo ‘net.ipv4.tcp_congestion_control=bbr‘ | sudo tee -a /etc/sysctl.conf
sudo sysctl -p
验证 BBR 已启用:
sudo sysctl net.ipv4.tcp_available_congestion_control
如果结果如下,则说明配置成功。
net.ipv4.tcp_available_congestion_control = bbr cubic reno
下一个验证:
sudo sysctl -n net.ipv4.tcp_congestion_control
最后检查内核模块一启用:
lsmod | grep bbr
显示如下:
tcp_bbr 16384 0
In order to test BBR‘s network performance enhancement, you can create a file in the web server directory for download, and then test the download speed from a web browser on your desktop machine.
sudo yum install httpd -y
sudo systemctl start httpd.service
sudo firewall-cmd --zone=public --permanent --add-service=http
sudo firewall-cmd --reload
cd /var/www/html
sudo dd if=/dev/zero of=500mb.zip bs=1024k count=500
Finally, visit the URL <http://[your-server-IP]/500mb.zip>
from a web browser on your desktop computer, and then evaluate download speed.
How to Deploy Google BBR on CentOS 7
Linux - 在 CentOS 7 上部署 Google BBR
原文:https://www.cnblogs.com/zdfffg/p/10406888.html