Centos7手动升级最新版内核并开启BBR - 开发说
当前位置: 主页 » Centos » Centos7手动升级最新版内核并开启BBR

Centos7手动升级最新版内核并开启BBR

      2019年08月31日   阅读 2,538 次     0 评论   Tags: · ·

网上有很多一键开启BBR的教程,还有很多魔改bbr和bbr plus,趁着今天买了ruvds的3元小鸡,并在Centos7手动升级最新版内核并开启BBR记录一下,其实在最新版4.19.x以上内核是继承了BBR模块的 只是没有开启而已(我也不是很确定)

VPS安装Google BBR加速,享受如丝般润滑
Centos7设置内核启动顺序并删除多余内核

1、准备工作,安装ELREPO源


#设置内核源:

Centos7    rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm  
Centos6    rpm -Uvh http://www.elrepo.org/elrepo-release-6-8.el6.elrepo.noarch.rpm

2、升级内核


[root@localhost ~]# yum --enablerepo=elrepo-kernel -y install kernel-ml kernel-ml-devel kernel-ml-headers

3、设置内核启动顺序


#查看当前系统有几个内核:
[root@localhost ~]# cat /boot/grub2/grub.cfg |grep menuentry

if [ x"${feature_menuentry_id}" = xy ]; then
  menuentry_id_option="--id"
  menuentry_id_option=""
export menuentry_id_option
menuentry 'CentOS Linux (5.2.11-1.el7.elrepo.x86_64) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-3.10.0-957.el7.x86_64-advanced-ad1530fe-f286-4adf-b8ad-d0bf6232f031' {
menuentry 'CentOS Linux (0-rescue-b1d13815939d4bd2811250047163675b) 7 (Core)' --class centos --class gnu-linux --class gnu --class os --unrestricted $menuentry_id_option 'gnulinux-0-rescue-b1d13815939d4bd2811250047163675b-advanced-ad1530fe-f286-4adf-b8ad-d0bf6232f031' {

###可以看到这个是最新的内核CentOS Linux (5.2.11-1.el7.elrepo.x86_64) 7 (Core)

4、把CentOS Linux (5.2.11-1.el7.elrepo.x86_64) 7 (Core) 设置为第一启动项


###第一种方式:

[root@localhost ~]#  grub2-set-default "CentOS Linux (4.14.6-1.el7.elrepo.x86_64) 7 (Core)"

###还有另外一种方式设置第一启动项:" set grub2-set-default 0 " 这个命令也可以设置最新内核为第一启动项,但是在某些情况下,重启以后还是原来的旧的内核,所以推荐第一种方式。

5、手动开启BBR


[root@localhost ~]# vi /etc/sysctl.conf
添加如下内容

net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr

6、重启VPS即可 命令为 init 6

7、验证bbr是否已经开启


a.若

sysctl net.ipv4.tcp_available_congestion_control

返回

net.ipv4.tcp_available_congestion_control = bbr cubic reno
则成功

b.若

lsmod | grep bbr
返回形如如下形式的信息即成功。

tcp_bbr                16384  1

至此Centos7升级最新版内核并手动开启BBR教程完毕。

  • 版权声明:本文版权归开发说和原作者所有,未经许可不得转载。文章部分来源于网络仅代表作者看法,如有不同观点,欢迎进行交流。除非注明,文章均由 开发说 整理发布,欢迎转载,转载请带版权。

  • 来源:开发说 ( https://www.kaifashuo.com/ ),提供主机优惠信息深度测评和服务器运维编程技术。
  • 链接:https://www.kaifashuo.com/1184.html
  • 评论(0

    1. 还没有任何评论,你来说两句吧

    发表回复

    您的电子邮箱地址不会被公开。 必填项已用 * 标注