How to deploy Google BBR on CentOS 7
This article describes how to deploy Google BBR on CentOS 7. [Note: The kernel version used at the time of this article is 4.9.0 and is 4.15.6 at present (version 4.15 is higher than version 4.9 )]
Step 1: Use the Elrepo RPM repository to upgrade the kernel
To use BBR, You need to upgrade the kernel of CentOS 7 to 4.9.0 or above. You can use the Elrepo RPM repository to perform this operation easily.
Before upgrading, you can view the current kernel:
Uname-r
This command should output a string, similar:
3.10.0-514.2. 2. El7 x86_64
As you can see, the current kernel is 3.10.0.
Install ELRepo repo:
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
Use ELRepo repo to install the 4.9.0 kernel: [4.15.6 is currently installed]
Sudo yum -- enablerepo = elrepo-kernel install kernel-ml-y
Confirmation result:
Rpm-qa | grep kernel
If the installation is successful, you should see the kernel-ml-4.9.0-1.el7.elrepo.x86_64 in the output list
Kernel-ml-4.9.0-1.el7.elrepo.x86_64
Kernel-3.10.0-514.el7.x86_64
Kernel-tools-libs-3.10.0-514.2.2.el7.x86_64
Kernel-tools-3.10.0-514.2.2.el7.x86_64
Kernel-3.10.0-514.2.2.el7.x86_64
[Do not see OK]
Now, you need to enable the 4.9.0 kernel by setting the default GRUB2 boot item.
Show all entries in the Grub2 menu:
Sudo egrep ^ menuentry/etc/grub2.cfg | cut-f 2-d \'
The result should be similar:
CentOS Linux 7 Rescue a0cbf86a6ef1416a8812657bb4f2b860 (4.9.0-1. el7.elrepo. x86_64)
CentOS Linux (4.9.0-1. el7.elrepo. x86_64) 7 (Core)
CentOS Linux (3.10.0-514.2.2.el7.x86 _ 64) 7 (Core)
CentOS Linux (3.10.0-514. el7.x86 _ 64) 7 (Core)
CentOS Linux (0-rescue-bf94f46c6bd04792a6a42c91bae645f7) 7 (Core)
Because the row count starts from 0 and the 4.9.0 kernel item is located on the second line, the default startup Item is set to 1:
Sudo grub2-set-default 1
Note: The result is different from the example.
CentOS Linux (4.15.6-1. el7.elrepo. x86_64) 7 (Core)
CentOS Linux 7 Rescue 186e68c8657e4bfc8df5044d08b50231 (3.10.0-693.17.1.el7.x86 _ 64)
CentOS Linux (3.10.0-693.17.1.el7.x86 _ 64) 7 (Core)
CentOS Linux (3.10.0-693.11.6.el7.x86 _ 64) 7 (Core)
CentOS Linux (3.10.0-693. el7.x86 _ 64) 7 (Core)
CentOS Linux (0-rescue-c73a5ccf3b8145c3a675b64c4c3ab1d4) 7 (Core)
In this case, CentOS Linux (4.15.6-1. el7.elrepo. x86_64) 7 (Core) is located in the first entry, so what I entered should be
Sudo grub2-set-default 0
Restart the system:
Sudo shutdown-r now
When the server is online again, log on again and run the uname command again to confirm that you are using the correct kernel:
Uname-r
You should see the following results:
4.9.0-1. el7.elrepo. x86_64
(Now it should be)
4.15.6-1. el7.elrepo. x86_64
Step 2: Enable BBR
To enable the BBR algorithm, you must modify the Sysctl configuration as follows:
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
Now, you can use the following command to confirm that BBR is Enabled:
Sudo sysctl net. ipv4.tcp _ available_congestion_control
The output should be similar:
Net. ipv4.tcp _ available_congestion_control = bbr cubic reno
Next, verify:
Sudo sysctl-n net. ipv4.tcp _ congestion_control
The output should be:
Bbr
Finally, check whether the kernel module is loaded:
Lsmod | grep bbr
The output will be similar:
Tcp_bbr 16384 0
Step 3 (optional): test network performance enhancement
To test the BBR network performance enhancement, you can create a file in the Web Server Directory for download, and then test the download speed from the Web browser on the desktop computer.
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 of1_500mb.zip bs = 1024 k count = 500
Finally, access the URL http: // [your-server-IP]/500mb.zip from the Web browser on the desktop computer, and evaluate the download speed.
OK. Thank you for reading.
This article permanently updates link: https://www.bkjia.com/Linux/2018-02/151095.htm