1. 程式人生 > >Linux - 在 CentOS 7 上部署 Google BBR

Linux - 在 CentOS 7 上部署 Google BBR

per 結果 http wall lease 減少 ade lsm 成功

BBR(Bottleneck Bandwidth and RTT)是一種新的擁塞控制算法,由Google開發。有了BBR,Linux服務器可以顯著提高吞吐量並減少連接延遲。

Step 1: Upgrade the kernel using the ELRepo RPM repository

查看當前內核版本:

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

Step 2: Enable BBR

修改並保存 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

Step 3 (optional): Test the network performance enhancement

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