美文网首页
Centos7 开启bbr加速

Centos7 开启bbr加速

作者: broeeee | 来源:发表于2020-05-29 17:54 被阅读0次
首先我们要知道BBR是什么?

BBR 是 Google 提出的一种新型拥塞控制算法,可以使 Linux 服务器显著地提高吞吐量和减少 TCP 连接的延迟。从 4.9 开始,Linux 内核已经用上了该算法。

查看自己机器内核

uname -r
  1. 手动开启
导入公钥
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org

可能会遇到这类问题

curl: (35) Peer reports incompatible or unsupported protocol version.

curl不兼容,更新一下

yum update -y nss curl libcurl

Centos 7

yum install https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm

安装内核

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

查看已安装的内核列表

rpm -qa | grep kernel

如果有大于4.9的说明没问题,但是要应用最新的内核。

查看默认启动内核

grub2-editenv list

应该是3.0左右的版本

查看所有内核

cat /boot/grub2/grub.cfg | grep menuentry

找出大于4.9的内核复制全名

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
  menuentry_id_option=""
export menuentry_id_option
menuentry 'CentOS Linux (5.7.0-1.el7.elrepo.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.26.2.el7.x86_64-advanced-dac97e83-6855-4927-a60f-2923f304e4d0' {
menuentry 'CentOS Linux (3.10.0-1127.10.1.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.26.2.el7.x86_64-advanced-dac97e83-6855-4927-a60f-2923f304e4d0' {
menuentry 'CentOS Linux (3.10.0-514.26.2.el7.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-514.26.2.el7.x86_64-advanced-dac97e83-6855-4927-a60f-2923f304e4d0' {
menuentry 'CentOS Linux (0-rescue-2b7d4e5421b745138f5bedc3e9233da3) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-2b7d4e5421b745138f5bedc3e9233da3-advanced-dac97e83-6855-4927-a60f-2923f304e4d0' {

修改默认启动内核

grub2-set-default 'CentOS Linux (5.7.0-1.el7.elrepo.x86_64) 7 (Core)'

重启

reboot

再连接上,复验一下默认启动内核

grub2-editenv list

内核要求满足了,可以开启bbr了。

加入下面两句

echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf

加载参数

sysctl -p

查看是否开启成功

sysctl net.ipv4.tcp_available_congestion_control

显示

net.ipv4.tcp_available_congestion_control = reno cubic bbr
或者
net.ipv4.tcp_available_congestion_control = bbr cubic reno
sysctl net.ipv4.tcp_congestion_control

显示

net.ipv4.tcp_congestion_control = bbr
  • 检查BBR是否正常运行
lsmod | grep bbr

显示

tcp_bbr                20480  7
  1. 自动开启

脚本出自作者:秋水逸冰

  • 脚本适用环境

系统支持:CentOS 6+,Debian 7+,Ubuntu 12+
虚拟技术:OpenVZ 以外的,比如 KVM、Xen、VMware 等
内存要求:≥128M
日期  :2018 年 12 月 14 日

root登录

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

安装完成后,脚本会提示需要重启 VPS,输入 y 并回车后重启。

验证是否开启参看上面验证方法。

相关文章

  • CentOS 上开启 BBR 加速 2020-07-26

    CentOS 上开启 BBR 加速(基于centos7) BBR 算法需要 Linux 4.9 及以上的内核支持,...

  • Centos7 开启bbr加速

    首先我们要知道BBR是什么? BBR 是 Google 提出的一种新型拥塞控制算法,可以使 Linux 服务器显著...

  • centos7开启bbr加速

    起因 之前用了默认开bbr的vps,发现看视频的时候快得飞起,刚打开没多久缓冲条就缓冲了一段了。而某些大厂的vps...

  • CentOS7 开启BBR 加速

    先查看系统内核版本,低于4.10的需要先更换内核版本 uname -r 更换内核版本 1 导入公钥 rpm --i...

  • 019-BBR加速脚本集合。包含BBR Plus/BBR原版/B

    BBR加速脚本锦集 下面所有脚本请自行安装Curl、Wget等,代码如下: Debian 9 开启自带BBR加速 ...

  • ubuntu开启BBR加速

    BBR是google的TCP阻塞控制算法,可以最大程度的利用带宽,提升网络传输速率。 Linux kernel 4...

  • CentOS7开启BBR

    系统 CentOS 7.9 开启BBR 安装ELRepo源 升级内核 配置GRUB 开启BBR 重启生效 验证

  • CentOS7配置远程离线下载

    尝试新vps,安装了centos7。开始折腾离线远程下载,少不了emule和bt两个渠道。1、安装BBR加速查看内...

  • BBR 加速

    BBR 加速真是个好东西,显著提高了tcp、带宽利用率

  • bbr加速

网友评论

      本文标题:Centos7 开启bbr加速

      本文链接:https://www.haomeiwen.com/subject/zdkfzhtx.html