Google BBR Acceleration Tutorial for VPS and Independent Server Network Optimization

2,605 Secondary reading
No comment

Many people are using Google's BBR acceleration service, which is also the first thing to do to get VPS or server. When VPS encyclopedia buys VPS or servers, the first thing is to install Google's BBR acceleration.

The normal running environment of VPS Encyclopedia is the one click installation script of Qiushui Yibing, which is the original version of Google BBR acceleration. Of course, you can also try the BBR acceleration script of the Internet bosses.

Qiu Da's one click installation of the latest kernel and opening of the TCP BBR script are very useful, VPS encyclopedia has always been used on the official website of BBR one click script, but now the official website is Q, which is inconvenient to use. It is hereby reproduced.

VPS及独立服务器网络优化之谷歌BBR加速教程

Qiushui Boss Script Application Environment

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

About Qiushui BBR One button Script

  1. The author of the BBR script passed all the tests on several VPS.
  2. When the BBR one click script detects that the VPS virtual mode is OpenVZ, it will prompt an error and automatically exit the installation.
  3. After the BBR script runs and restarts, it is found that the machine cannot be started. Open the VNC of the VPS background control panel, boot the card in grub, and manually select the kernel.
  4. Since the latest version of the system kernel is used, it is better not to install it in the production environment to avoid unpredictable consequences.

How to use BBR one click script

Log in as root and run the following command:

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

After the installation is completed, the script will prompt you to restart VPS, enter y and press Enter to restart.

After the reboot is completed, enter VPS, verify whether the latest kernel is successfully installed and TCP BBR is started, and enter the following command:

uname -r

Check the kernel version. If it displays the latest version, it means OK

Execution: sysctl net.ipv4.tcp_available_congestion_control

The return value is generally:

net.ipv4.tcp_available_congestion_control = bbr cubic reno or

net.ipv4.tcp_available_congestion_control = reno cubic bbr

Execution: sysctl net.ipv4.tcp_congestion_control

The return value is generally: net.ipv4.tcp_congestion_control = bbr

Execution: sysctl net.core.default_qdisc

The return value is generally: net.core.default_qdisc = fq

Execution: lsmod | grep bbr

The return value of the tcp_bbr module indicates that the bbr has been started. Note: Not all VPS will have this return value. If not, it is normal.

How to install the latest version of kernel headers in CentOS

It was originally intended to install kernel ml headers directly in the script, but it will conflict with the original kernel headers.

Therefore, add a script here to manually install the latest version of the kernel headers tutorial after execution.

Execute the following command:

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

Depending on the CentOS version, an error message similar to the following will appear:

Error: kernel-ml-headers conflicts with kernel-headers-2.6.32-696.20.1.el6.x86_64

Error: kernel-ml-headers conflicts with kernel-headers-3.10.0-693.17.1.el7.x86_64

Therefore, you need to uninstall the original kernel headers first, and then install the latest kernel headers. Execute command:

yum remove kernel-headers

After confirmation, enter y and enter Enter to start unloading. Note that sometimes this operation also uninstalls some installation packages that depend on kernel headers, such as gcc Gcc-c++and so on.

But it doesn't matter. We can reinstall the latest kernel headers after installing them.

After uninstallation, execute the installation command given above again.

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

After successful installation, install the packages that previously depended on kernel headers, such as gcc Gcc-c++can be installed again.

Why install the latest kernel headers?

This is because the shadowlocks libev version has a tcp fast open function. If it is not installed, this function cannot be enabled.

Kernel Upgrade Method

For CentOS system, execute the following command to upgrade the kernel:

yum -y install kernel-ml kernel-ml-devel

If you also manually installed the new version of kernel headers, you also need the following command to upgrade headers:

yum -y install kernel-ml-headers

In CentOS 6, execute the command:

sed -i 's/^default=.*/default=0/g' /boot/grub/grub.conf

For CentOS 7, execute the command:

grub2-set-default 0

For Debian/Ubuntu systems, you need to manually download the latest version of the kernel to install and upgrade.

go here Download the latest version of the kernel deb installation package.

If the system is 64 bit, the general deb package is included in the linux image of the amd64 download;

If the system is 32-bit, the general deb package is included in the Linux image of the i386 download;

The command to install is as follows (take the latest version of the 64 bit 4.12.4 as an example, please replace it with the downloaded deb package):

dpkg -i linux-image-4.12.4-041204-generic_4.12.4-041204.201707271932_amd64.deb

After installation, execute the command:

/usr/sbin/update-grub

Finally, restart VPS.

Special instructions for BBR one click script

If you use the Google Cloud Platform (GCP) to replace the kernel, sometimes the entire disk becomes read-only after restart. Simply execute the following command to restore:

mount -o remount rw /

The above script for BBR one click installation of the original BBR originates from Qiushui Boss , basically reproduced in the original, thank you for your contribution.

In addition, the famous BBR/BBR PLUS/Magic BBR/Sharp four in one script on the network is attached.

BBR/BBR PLUS/Magic BBR/Sharp Speed four in one script installation requirements:

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

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

BBR/BBR PLUS/Magic BBR/Sharp four in one script installation command:

wget --no-check-certificate -O tcp.sh https://github.com/cx9208/Linux-NetSpeed/raw/master/tcp.sh && chmod +x tcp.sh && ./ tcp.sh

Select the installation according to the prompts. Special note: After installation, the script must be executed again ./tcp.sh , enable TCP acceleration.

BBR/BBR PLUS/Magic BBR/Ruisu Four in One Script Installation Precautions:

  1. The four acceleration tools in the four in one script are TCP acceleration, which can accelerate the TCP protocol based content such as websites/FTP.
  2. The four tools all involve changes to the kernel, and the acceleration effect does not overlap. After installing one version of the kernel, it will automatically replace the previous version of the kernel.
  3. The 9th item in the script menu can uninstall all acceleration effects.
  4. The 10th item in the script menu can be used to optimize some network parameters in the system.

Finally, VPS encyclopedia reminds us that it is better to use the original BBR for acceleration in the production environment. After all, stable acceleration is the first.

End of body
  one
 VPS Encyclopedia Editor
Copyright notice: The original article of this website was written by VPS Encyclopedia Editor Published on December 7, 2020, with a total of 3039 words.
Reprint description:
Comments (no comments)