How to Deploy Google BBR on CentOS 7

Published on: Thu, Jan 5, 2017 at 6:34 pm EST

BBR (Bottleneck Bandwidth and RTT) is a new congestion control algorithm which is contributed to the Linux kernel TCP stack by Google. With BBR in place, a Linux server can get significantly increased throughput and reduced latency for connections. Besides, it's easy to deploy BBR because this algorithm requires only updates on the sender side, not in the network or on the receiver side.

In this article, I will show you how to deploy BBR on a Vultr CentOS 7 KVM server instance.

Prerequisites

  • A Vultr CentOS 7 x64 server instance.
  • sudo user.

Step 1: Upgrade the kernel using the ELRepo RPM repository

In order to use BBR, you need to upgrade the kernel of your CentOS 7 machine to 4.9.0. You can easily get that done using the ELRepo RPM repository.

Before the upgrade, you can take a look at the current kernel:

  1. uname -r

This command should output a string which resembles:

  1. 3.10.0-514.2.2.el7.x86_64

As you see, the current kernel is 3.10.0.

Install the ELRepo repo:

  1. sudo rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
  2. sudo rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm

Install the 4.9.0 kernel using the ELRepo repo:

  1. sudo yum --enablerepo=elrepo-kernel install kernel-ml -y

Confirm the result:

  1. rpm -qa | grep kernel

If the installation is successful, you should see kernel-ml-4.9.0-1.el7.elrepo.x86_64 among the output list:

  1. kernel-ml-4.9.0-1.el7.elrepo.x86_64
  2. kernel-3.10.0-514.el7.x86_64
  3. kernel-tools-libs-3.10.0-514.2.2.el7.x86_64
  4. kernel-tools-3.10.0-514.2.2.el7.x86_64
  5. kernel-3.10.0-514.2.2.el7.x86_64

Now, you need to enable the 4.9.0 kernel by setting up the default grub2 boot entry.

Show all entries in the grub2 menu:

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

The result should resemble:

  1. CentOS Linux 7 Rescue a0cbf86a6ef1416a8812657bb4f2b860 (4.9.0-1.el7.elrepo.x86_64)
  2. CentOS Linux (4.9.0-1.el7.elrepo.x86_64) 7 (Core)
  3. CentOS Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)
  4. CentOS Linux (3.10.0-514.el7.x86_64) 7 (Core)
  5. CentOS Linux (0-rescue-bf94f46c6bd04792a6a42c91bae645f7) 7 (Core)

Since the line count starts at 0 and the 4.9.0 kernel entry is on the first line, set the default boot entry as 0:

  1. sudo grub2-set-default 0

Reboot the system:

  1. sudo shutdown -r now

When the server is back online, log back in and rerun the uname command to confirm that you are using the correct Kernel:

  1. uname -r

You should see the result as below:

  1. 4.9.0-1.el7.elrepo.x86_64

Step 2: Enable BBR

In order to enable the BBR algorithm, you need to modify the sysctl configuration as follows:

  1. echo 'net.core.default_qdisc=fq' | sudo tee -a /etc/sysctl.conf
  2. echo 'net.ipv4.tcp_congestion_control=bbr' | sudo tee -a /etc/sysctl.conf
  3. sudo sysctl -p

Now, you can use the following commands to confirm that BBR is enabled:

  1. sudo sysctl net.ipv4.tcp_available_congestion_control

The output should resemble:

  1. net.ipv4.tcp_available_congestion_control = bbr cubic reno

Next, verify with:

  1. sudo sysctl -n net.ipv4.tcp_congestion_control

The output should be:

  1. bbr

Finally, check that the kernel module was loaded:

  1. lsmod | grep bbr

The output will be similar to:

  1. 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.

  1. sudo yum install httpd -y
  2. sudo systemctl start httpd.service
  3. sudo firewall-cmd --zone=public --permanent --add-service=http
  4. sudo firewall-cmd --reload
  5. cd /var/www/html
  6. 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.

That's all. Thank you for reading.

在centos7 部署bbr的更多相关文章

  1. [原]CentOS7部署osm2pgsql

    转载请注明原作者(think8848)和出处(http://think8848.cnblogs.com) 部署Postgresql和部署PostGis请参考前两篇文章 本文主要参考GitHub上osm ...

  2. centos7 部署ssserver

    centos7 部署shadowsocks服务端 为什么要选centos7? 以后centos7 肯定是主流,在不重要的环境还是尽量使用新系统吧 centos7 的坑 默认可能会有firewall 或 ...

  3. centos7安装bbr

    centos7安装bbr 安装 sudo wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.s ...

  4. centos7 部署 docker compose

    =============================================== 2019/4/10_第1次修改                       ccb_warlock == ...

  5. centos7 部署 docker ce

    =============================================== 2019/4/9_第1次修改                       ccb_warlock === ...

  6. centos7 部署 open-falcon 0.2.0

    =============================================== 2019/4/29_第3次修改                       ccb_warlock 更新 ...

  7. centos7 部署 docker、shipyard

    =============================================== 2019/4/9_第3次修改                       ccb_warlock 更新说 ...

  8. centos7 部署 docker swarm

    =============================================== 2019/4/9_第3次修改                       ccb_warlock 更新说 ...

  9. CentOS7部署Nginx

    CentOS7部署Nginx 1.准备工作 Nginx的安装依赖于以下三个包,意思就是在安装Nginx之前首先必须安装一下的三个包,注意安装顺序如下: 1 SSL功能需要openssl库,直接通过yu ...

随机推荐

  1. 羊车门问题(Python)

    羊车门问题(结对作业) 在完成本题之前,请仔细阅读下面内容: 题目描述:有3扇关闭的门,一扇门后面停着汽车,其余门后是山羊,只有主持人知道每扇门后面是什么.参赛者可以选择一扇门,在开启它之前,主持人会 ...

  2. Linux下查看tomcat版本

    进入到tomcat的bin目录下,再执行./version.sh tomcat版本:7.0

  3. 全球DDOS安全防护

    转:http://www.safecdn.cn/ https://www.safeidc.cn/llqx.html 全球可视化的DDoS攻击地图:Digital Attack Map 这个项目是源于G ...

  4. 《python编程快速上手》

    第一部分 编程基础 @表达式 ** % // @ >>> int(3.4) 3 >>>round(3.555,2)3.56 @判断条件时:0和0.0和‘’都是Fal ...

  5. reg 和wire 区别

    reg相当于存储单元,wire相当于物理连线 Verilog 中变量的物理数据分为线型和寄存器型.这两种类型的变量在定义时要设置位宽,缺省为1位.变量的每一位可以是0,1,X,Z.其中x代表一个未被预 ...

  6. Exp2 后门原理与实践 - 20164304 姜奥

    实验内容  (1)使用netcat获取主机操作Shell,cron启动 (2)使用socat获取主机操作Shell, 任务计划启动 (3)使用MSF meterpreter(或其他软件)生成可执行文件 ...

  7. javascript基础知识笔记-自用

    笔记内容根据个人基础知识不足不明白之处做的记录.主要看的:https://developer.mozilla.org/zh-CN/docs/Web/JavaScript 1.变量,变量的名字又叫标识符 ...

  8. java中Method.invoke方法参数解析

    通过发射的机制,可以通过invoke方法来调用类的函数.invoke函数的第一个参数是调用该方法的实例,如果该方法是静态方法,那么可以用null或者用类来代替,第二个参数是变长的,是调用该方法的参数. ...

  9. [Torch]提示torch.inverse错误

    来源:https://blog.csdn.net/zziahgf/article/details/72548128 当执行官方第二个例子时,提示xs = torch.inverse(A)*b错误 是因 ...

  10. 在Linux机器上安装MySQL

    在Linux机器上安装MySQL,仔细认真些就没有问题. CentOS 7下MySQL 5.7安装.配置与应用_数据库技术_Linux公社-Linux系统门户网站 搞不定的话,直接删掉这个MySQL, ...