title: Centos7开启BBR加速
tags:
- Linux
categories: -
软件·服务器
date: 2017-07-14 20:14:08
网上找了个一键开启BBR脚本,结果导致开机出问题了,以前用过没问题的,可能是部分资源失效了导致的吧;所以只能自己手动老老实实不偷懒给Centos7系统更新内核开启BBR
第一步:更新系统
yum update -y
感觉没啥必要,网上别人都说更新那就更新吧
第二步:安装内核
rpm --import https://www.elrepo.org/RPM-GPG-KEY-elrepo.org
rpm -Uvh http://www.elrepo.org/elrepo-release-7.0-2.el7.elrepo.noarch.rpm
yum --enablerepo=elrepo-kernel install kernel-ml
第三步:检查最新内核安装成功没有
安装完成后使用下面命令查看当前已安装的内核
awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
返回信息
[root@VM_91_140_centos ~]# awk -F\' '$1=="menuentry " {print i++ " : " $2}' /etc/grub2.cfg
>0 : CentOS Linux (4.12.1-1.el7.elrepo.x86_64) 7 (Core)
>1 : CentOS Linux (3.10.0-514.2.2.el7.x86_64) 7 (Core)
>2 : CentOS Linux (3.10.0-327.36.3.el7.x86_64) 7 (Core)
>3 : CentOS Linux (3.10.0-327.28.2.el7.x86_64) 7 (Core)
>4 : CentOS Linux (3.10.0-327.10.1.el7.x86_64) 7 (Core)
>5 : CentOS Linux, with Linux 3.10.0-123.el7.x86_64
>6 : CentOS Linux, with Linux 0-rescue-3f57f163dfaf1ec9ed891518d1d2fafe
把第一个内核也就4.12.1-1这个内核设为默认内核
grub2-set-default 0
设置完成后重启服务器:reboot
第四步:启动BBR
首先查看内核是不是最新的,命令:uname -r ,应该返回4.12.1-1.el7.elrepo.x86_64
#检查内核命令
uname -r
然后编辑/etc/sysctl.conf加入或修改这两行
net.core.default_qdisc = fq
net.ipv4.tcp_congestion_control = bbr
让BBR生效命令
sysctl -p
检查命令
lsmod | grep bbr
显示tcp_bbr说明BBR已正常启动。
© 版权声明
文章版权归作者所有,未经允许请勿转载。
THE END