BBR accelerate Centos

What is BBR

BBR is Google proposed a new congestion control algorithms, the Linux server can significantly improve throughput and reduce latency TCP connection.

BBR Project Address

https://github.com/google/bbr

Manually install, upgrade the kernel

Open BBR requires 4.10 or later of the Linux kernel, use the following command to view the current kernel version

uname -r

3.10.0-514.10.2.el7.x86_64

If the current kernel version lower than 4.10, you can use ELRepo Source Update:
http://elrepo.org/tiki/tiki-index.php

  1. Importing a public key
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

To install ELRepo 7 is RHEL-, SL- 7 or CentOS- 7:

rpm -Uvh https://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm</font>

To install ELRepo 6 is RHEL-, SL- 6 or CentOS- 6:

rpm -Uvh https://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm

ELRepo mirroring system to use, install yum-plugin-fastermirror simultaneously.

  1. Installing the kernel
yum --enablerepo=elrepo-kernel install kernel-ml -y

After the installation is complete, view the installed kernel:

rpm -qa | grep kernel

kernel-tools-3.10.0-957.1.3.el7.x86_64
kernel-3.10.0-957.1.3.el7.x86_64
kernel-3.10.0-957.el7.x86_64
kernel-tools-libs-3.10.0-957.1.3.el7.x86_64
kernel-ml-4.20.0-1.el7.elrepo.x86_64

See similar kernel-ml-4.20.0-1.el7.elrepo.x86_64 in the output, represents a successful installation.

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

CentOS Linux (4.20.0-1.el7.elrepo.x86_64) 7 (Core)
CentOS Linux (3.10.0-957.1.3.el7.x86_64) 7 (Core)
CentOS Linux (3.10.0-957.el7.x86_64) 7 (Core)
CentOS Linux (0-rescue-40b6222317d24a7690053e4070fadddb) 7 (Core)

As the numbers start with 0, set the kernel needs to start entry

grub2-set-default 0  
reboot

After the reboot is complete, log back in and re-run the uname command to verify that you are using the correct kernel:

uname -r

Results are as follows the upgrade was successful:

4.20.0-1.el7.elrepo.x86_64

Open BBR

echo 'net.core.default_qdisc=fq' >> /etc/sysctl.conf  
echo 'net.ipv4.tcp_congestion_control=bbr' >> /etc/sysctl.conf  
sysctl -p

Automatically install script

BBR script link https://raw.githubusercontent.com/teddysun/across/master/bbr.sh

curl -O https://raw.githubusercontent.com/teddysun/across/master/bbr.sh && sh bbr.sh

verification

View congestion control algorithms can be used

sysctl net.ipv4.tcp_available_congestion_control

got the answer

net.ipv4.tcp_available_congestion_control = reno cubic bbr

View congestion control algorithms now in use

sysctl net.ipv4.tcp_congestion_control

got the answer

net.ipv4.tcp_congestion_control = bbr

Check the BBR is operating properly

lsmod | grep tcp_bbr

tcp_bbr 20480 1

Speed ​​Test

Create a file, set up http service

dd if=/dev/zero of=500mb.zip bs=1024k count=500 

Visit http: // [your-server-IP] /500mb.zip to test the download speed ~



Author: Kokoronashi
link: https: //www.jianshu.com/p/62c9b9570c05
Source: Jane book
Jane book copyright reserved by the authors, are reproduced in any form, please contact the author to obtain authorization and indicate the source.

Guess you like

Origin www.cnblogs.com/bluestorm/p/11484503.html