In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-28 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/01 Report--
This article mainly introduces the example analysis of CentOS7 enabling BBR for VPS acceleration, which has a certain reference value. Interested friends can refer to it. I hope you will learn a lot after reading this article. Let's take a look at it.
What is BBR?
TCP BBR is a TCP congestion control algorithm produced by Google. The purpose of BBR is to run as much bandwidth as possible and avoid queuing as much as possible. BBR can accelerate the TCP connection unilaterally. It's a perfect alternative to sharp speed. after all, it's free.
Google is a TCP-BBR congestion control algorithm submitted to the Linux mainline and published in ACM queue journals. It inherits Google's research tradition of "first deploying in production environment, then open source and publishing papers". TCP-BBR has been deployed on the YouTube server and Google on the internal wide area network (B4) across the data center. This shows the future of the algorithm.
The goal of TCP-BBR is to maximize the bandwidth of bottleneck links on the network. A network link is like a water pipe, and the best way to make the best use of it is to fill it with water.
BBR solves two problems:
And then make full use of the bandwidth on the network link with a certain packet loss rate. It is very suitable for network links with high latency and high bandwidth.
Reduce latency by reducing buffer occupancy on network links. It is very suitable for users who have slow access to the network.
Project address: https://github.com/google/bbr
Google opened up their optimized network congestion algorithm BBR in September 2016, which has been integrated into the latest version of the Linux kernel (4.9-rc8).
Not everyone is familiar with TCP unilateral acceleration, but there is another famous commercial software called Ruishuo, which many people know. Especially for people who use foreign servers or VPS, the effect is better.
There are many tutorials to enable BBR on Debian and Ubuntu systems, so I won't paste them. I have been using CentOS myself. This article introduces how to turn on BBR on 64-bit CentOS 7 systems.
Upgrade the kernel
The first step is to upgrade the kernel to a version that supports BBR:
# download the deb package of linux kernel 4.9-rc8
Wget http://mirrors.kernel.org/debian/pool/main/l/linux/linux-image-4.9.0-rc8-amd64-unsigned_4.9~rc8-1~exp1_amd64.deb
# add compressed downloaded deb package
Ar x linux-image-4.9.0-rc8-amd64-unsigned_4.9~rc8-1~exp1_amd64.deb
# after executing the above command, you will get three files: * control.tar.gz*, * data.tar.xz*, * debian-binary*
# continue to extract * data.tar.xz* file
Tar-Jxf data.tar.xz
# after executing the command in this step, you will get three folders: * boot*, * lib*, * usr*
# install a bootable kernel image
Install-m644 boot/vmlinuz-4.9.0-rc8-amd64 / boot/vmlinuz-4.9.0-rc8-amd64
# copy kernel module
Cp-Rav lib/modules/4.9.0-rc8-amd64 / lib/modules/
# analyze the dependencies of loadable modules and generate module dependent mapping files
Depmod-a 4.9.0-rc8-amd64
# centos 6 and above execute this command
Dracut-f-v-- hostonly-k'/ lib/modules/4.9.0-rc8-amd64' / boot/initramfs-4.9.0-rc8-amd64.img 4.9.0-rc8-amd64
# Update the configuration file of grub2
Grub2-mkconfig-o / boot/grub2/grub.cfg
Adjust the GRUB startup order
After installing the new version of the kernel, you should first boot the system with the newly installed kernel to see if it can boot properly. Here are the commands to directly adjust the boot order of GRUB2:
# View available startup items
Cat / boot/grub2/grub.cfg | grep CentOS
After executing this command, you can see several items that begin with menuentry, each of which is a kernel boot option, immediately after menuentry, and the "title" of the startup item is enclosed in single quotation marks, such as mine:
Menuentry 'CentOS Linux (4.9.0-rc8-amd64) 7 (Core)'-- class rhel fedora-- class gnu-linux....
Menuentry 'CentOS Linux (3.10.0-327.36.3.el7.x86_64) 7 (Core)'-- class rhel fedora-- class gnu-linux.
Menuentry 'CentOS Linux (0-rescue-731edbf944d54068a3249dee56ed3727) 7 (Core)'-class rhel fedora-class gnu-linux-class gnu.
What you can see in the first single quotation mark is our newly installed 4.9-rc8 kernel, which we will use to boot.
# set the boot entry of the default 4.9-rc8 to the default boot entry
Grub2-set-default "CentOS Linux (4.9.0-rc8-amd64) 7 (Core)"
# verify that if the previous command is executed successfully, you should see `saved_entry=CentOS Linux (4.9.0-rc8-amd64) 7 (Core) `by executing the following command
Grub2-editenv list
# regenerate the configuration file of grub2
Grub2-mkconfig-o / boot/grub2/grub.cfg
# restart the system
Reboot
Modify sysctl to enable BBR
After rebooting the system, we can see that our kernel is already 4.9.0-rc8-amd64 through uname-an or other commands, then turn on BBR.
Echo "net.core.default_qdisc=fq" > > / etc/sysctl.conf
Echo "net.ipv4.tcp_congestion_control=bbr" > > / etc/sysctl.conf
# load the parameters in the / etc/sysctl.conf file and display them, mainly to see if there are any wrong settings (the results displayed are related to the contents of your configuration file)
Sysctl-p
# verify whether bbr is enabled. If successful, you should see net.ipv4.tcp_congestion_control = bbr
Sysctl net.ipv4.tcp_available_congestion_control
# is still verification, and if successful, you should see text like tcp_bbr 16384 3
Lsmod | grep bbr
Thank you for reading this article carefully. I hope the article "CentOS7 opens BBR for VPS accelerated sample Analysis" shared by the editor will be helpful to everyone. At the same time, I also hope that you will support and follow the industry information channel. More related knowledge is waiting for you to learn!
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 0
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.