centos 内核升级与开启bbr模块

一、下载内核文件

[root@host ~]# uname -sr #查看内核版本
[root@host ~]# rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org #安装秘钥文件
[root@host ~]# rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-3.el7.elrepo.noarch.rpm #下载elrepo包
[root@host ~]# yum --enablerepo=elrepo-kernel install kernel-ml -y #安装内核

二、修改默认启动内核版本,将启动时内核选择为最新版内核

  • 第一种方式:
[root@host ~]# sed -i s/saved/0/g /etc/default/grub
[root@host ~]# grub2-mkconfig -o /boot/grub2/grub.cfg
  • 第二种方式:

显示开机时显示的所有选项

[root@host ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
0 : CentOS Linux 7 (Core), with Linux 3.10.0-229.14.1.el7.x86_64
1 : CentOS Linux 7 (Core), with Linux 3.10.0-229.4.2.el7.x86_64
2 : CentOS Linux 7 (Core), with Linux 3.10.0-229.el7.x86_64
3 : CentOS Linux 7 (Core), with Linux 0-rescue-605f01abef434fb98dd1309e774b72ba

如果没有grub.cfg,生成他:

[root@host ~]# grub2-mkconfig -o /boot/grub2/grub.cfg

查看default:

[root@host ~]# grub2-editenv list

#设置default

[root@host ~]# grub2-set-default "CentOS Linux 7 (Core), with Linux 3.10.0-229.14.1.el7.x86_64"

安装BBR模块,bbr算法,提高系统吞吐量。

运行 lsmod | grep bbr,如果结果为空,则需先加载BBR模块并设置自动加载:

[root@host ~]# modprobe tcp_bbr
[root@host ~]# echo "tcp_bbr" >> /etc/modules-load.d/modules.conf

在sysctl.conf中配置BBR,在 /etc/sysctl.conf文件末尾添加两行

[root@host ~]# vi /etc/sysctl.conf
net.core.default_qdisc=fq
net.ipv4.tcp_congestion_control=bbr

然后执行 sysctl -p让配置生效。

 

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值