Centos7 installs the new kernel to enable BBR acceleration

CentOS7 Installing the New Kernel and Starting the BBR Acceleration Tutorial_BBR2 One click Package

BBR is an open source TCP network congestion optimization algorithm of Google, which can speed up visitors' access to your server. Especially for foreign servers, enabling the bbr algorithm will Website optimization There is some help.

Here, my father will use CentOS7 system to show you how to install the new kernel (because BBR requires more than 4.9 kernels) and enable BBR acceleration.

Steps for installing a new version of CentOS7 kernel

First, check the kernel version of the current server.

 uname -sr

The uname command is used to print information about the current system (kernel version number, hardware architecture, host name, operating system type, etc.).

 -A or -- all: display all information; -M or -- machine: display the computer type; -N or - nodename: the host name displayed on the network; -R or -- release: displays the release number of the operating system; -S or -- sysname: displays the name of the operating system; -v: Display the version of the operating system; -P or -- processor: output processor type or "unknown"; -I or -- hardware platform: output hardware platform or "unknown"; -O or -- operating system: output the operating system name; --Help: Display help; --Version: displays version information.

The BBR kernel requires 4.9+. Generally speaking, the kernel version you get from the above command is at 3.

Next, enable the ELRepo warehouse

 rpm --import  https://www.elrepo.org/RPM-GPG-KEY-elrepo.org rpm -Uvh  https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm

 ELRepo Warehouse

Then install the new stable kernel

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

After installation, use the following command to check whether the installation is successful.

 rpm -qa | grep kernel

My display is as follows:

 kernel-3.10.0-862.14.4.el7.x86_64 kernel-ml-5.3.8-1.el7.elrepo.x86_64 kernel-3.10.0-1062.4.1.el7.x86_64 kernel-headers-3.10.0-1062.4.1.el7.x86_64 kernel-3.10.0-957.5.1.el7.x86_64 kernel-3.10.0-1062.1.2.el7.x86_64 kernel-tools-3.10.0-1062.4.1.el7.x86_64 kernel-tools-libs-3.10.0-1062.4.1.el7.x86_64 kernel-3.10.0-957.1.3.el7.x86_64

The kernel-ml-5.3.8-1.el7.elrepo.x86_64 is the new version of the kernel installed. (When you see this tutorial, the kernel version may change, depending on the circumstances.)

Next, you need to set the system startup sequence, and use the following command.

 sudo egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'

My display is as follows:

 CentOS Linux (5.3.8-1.el7.elrepo.x86_64) 7 (Core) CentOS Linux (3.10.0-1062.4.1.el7.x86_64) 7 (Core) CentOS Linux (3.10.0-1062.1.2.el7.x86_64) 7 (Core) CentOS Linux (3.10.0-957.5.1.el7.x86_64) 7 (Core) CentOS Linux (3.10.0-957.1.3.el7.x86_64) 7 (Core) CentOS Linux (3.10.0-862.14.4.el7.x86_64) 7 (Core) CentOS Linux (0-rescue-618ca2de6e204efbb013b592564ef36a) 7 (Core)

The first is CentOS Linux (5.3.8-1.el7. elrepo. x86_64) 7 (Core). From the first row, 0, 1, 2, and 3, you can see what your new kernel is.
Then enter the following command (the command example is line 1)

 sudo grub2-set-default 0

Next restart the server

 reboot

Check the kernel version again

 uname -r

The kernel version is above 4.9. When this article is updated, the new version is 5.3.8, which proves that the installation is successful.

Rebuild kernel configuration

 grub2-mkconfig -o /boot/grub2/grub.cfg

Restart the system to verify that it is OK.

 

Enable BBR on the new CentOS7 kernel

To enable the new kernel on the newly installed CentOS7, just copy the following code to execute.

 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

Then enter the following command to check whether the BBR is successfully started

 sudo sysctl net.ipv4.tcp_available_congestion_control

If successful, it should be the following output

 net.ipv4.tcp_available_congestion_control = bbr cubic reno

Continue verification

 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 should be similar to the following

 tcp_bbr 16384 0

What's the use of turning on BBR?

In short, opening BBR can optimize your website access speed to a certain extent. For example, Daddy's notes use WordPress, and BBR can also speed up and optimize WordPress website. Of course, Daddy uses a domestic server, so the BBR acceleration effect will not be obvious.

BBR is an open source TCP network congestion optimization algorithm from Google, TCP BBR is committed to solving two problems: making full use of bandwidth on network links with a certain packet loss rate. Reduce the buffer occupancy on the network link to reduce latency. The goal of TCP congestion control is to maximize the bandwidth of bottleneck links on the network.

Open source address: https://github.com/google/bbr

BBR and BBR2 one button package

What is BBR2?

BBR2 is currently a preview version and an upgraded version of BBR. It is not mature enough and is not recommended for production environments.

For details of BBR2, see: https://github.com/google/bbr/blob/v2alpha/README.md

At the same time, the instruction file contains the tutorials and steps for manually installing bbr2, which will not be copied here.

Bbr2 one button package

Warning: There is a risk in replacing the kernel. If you cannot start the machine after using this script, you will not be responsible for any loss.

It is recommended that the system Debian 10 x86_64 supports Debian 8+in theory, Ubuntu 16.04+

Only applicable to KVM virtual architecture VPS, if OVZ Xen、 Or don't try it alone.

Only for 64 bit (x86_64) systems, x86 is not supported, CentOS and other systems are not supported

The tile mover Debian 8 9 10, The test in Ubuntu 16.04 18.04 passed (Ubuntu 14.04 failed)

It has passed the test in Debian 10 systems of the following vendors: Oracle Public Cloud, DMIT, OLVPS, AlibabaCloud
Debian 10 installation success rate 100%

CentOS users recommend using bbr or trying to install bbr2 manually.

 wget --no-check-certificate -q -O bbr2.sh " https://raw.githubusercontent.com/yeyingorg/bbr2.sh/master/bbr2.sh " && chmod +x bbr2.sh && bash bbr2.sh auto

Important! Please restart the system after turning on/off BBR/ECN. It is found that the script may have a bug that causes it to become ineffective or coexist with the old bbr.

BBR one button package

The bbr one click package supports more systems, but only if the kernel version supports bbr. If the kernel version does not work, you still need to update the kernel manually.

System support: CentOS 6+, Debian 7+,Ubuntu 12+
Virtual technology: other than OpenVZ, such as KVM Xen, VMware, etc
Memory requirement: ≥ 128M

 wget --no-check-certificate  https://github.com/teddysun/across/raw/master/bbr.sh  && chmod +x bbr.sh && ./ bbr.sh

Bbr plus one button package

The bbr plus optimizes the parameters based on the original bbr. The acceleration effect on some machines is better than that of the original bbr.

The BBR Plus one click installation script introduced in this article is from cx9208. In addition to BBR Plus, it also integrates the original BBR one button installation, magic BBR one button installation, and lotServer one button installation. It is a four in one version, and the four versions can be switched.

Applicable architecture: KVM/Xen, does not support OpenVZ (OVZ).

Applicable system: CentOS 7 Debian 8、Debian 9、Ubuntu 16.04、Ubuntu 18.04。

 wget --no-check-certificate  https://github.com/teddysun/across/raw/master/bbr.sh  && chmod +x bbr.sh && ./ bbr.sh
3.3/5 - (3 votes)
Scroll to top