说明
BBR
是Google
开源的TCP BBR
拥塞控制算法,用于提升网络连接速度,提升空间巨大,优化效果非常明显;BBR
仅支持4.9以上内核Ubuntu 18.04
CentOS 8
Debian 9
均为4.9以上内核无需更换内核可以直接开启BBR;
脚本安装
如果不想手动更换可以使用以下一键脚本
BBR 一键脚本:https://suntl.com/39.html
BBR2 一键脚本:https://suntl.com/621.html
BBR BBRplus BBR魔改 一键脚本:https://suntl.com/37.html
内核版本查询:https://kernel.ubuntu.com/~kernel-ppa/mainline
安装内核
更新系统软件包到最新版
apt update && apt upgrade -y
查看系统位数
uname -m
执行后返回x86_64
那就是64位系统;如果返回i386或386
或i686或686
那就是32位系统;
下载内核
## 64位系统:
## 4.17.0
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.17/linux-headers-4.17.0-041700_4.17.0-041700.201806041953_all.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.17/linux-headers-4.17.0-041700-generic_4.17.0-041700.201806041953_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.17/linux-image-unsigned-4.17.0-041700-generic_4.17.0-041700.201806041953_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v4.17/linux-modules-4.17.0-041700-generic_4.17.0-041700.201806041953_amd64.deb
## 4.19.0
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-headers-4.19.0-041900_4.19.0-041900.201810221809_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-headers-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-image-unsigned-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-modules-4.19.0-041900-generic_4.19.0-041900.201810221809_amd64.deb
## 5.2.4
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.2.4/linux-headers-5.2.4-050204_5.2.4-050204.201907280731_all.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.2.4/linux-headers-5.2.4-050204-generic_5.2.4-050204.201907280731_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.2.4/linux-image-unsigned-5.2.4-050204-generic_5.2.4-050204.201907280731_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.2.4/linux-modules-5.2.4-050204-generic_5.2.4-050204.201907280731_amd64.deb
## 5.6.0
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.6/linux-headers-5.6.0-050600_5.6.0-050600.202003292333_all.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.6/linux-headers-5.6.0-050600-generic_5.6.0-050600.202003292333_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.6/linux-image-unsigned-5.6.0-050600-generic_5.6.0-050600.202003292333_amd64.deb
wget https://kernel.ubuntu.com/~kernel-ppa/mainline/v5.6/linux-modules-5.6.0-050600-generic_5.6.0-050600.202003292333_amd64.deb
## 32位系统:
## 4.19.0
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-headers-4.19.0-041900_4.19.0-041900.201810221809_all.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-headers-4.19.0-041900-generic_4.19.0-041900.201810221809_i386.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-image-4.19.0-041900-generic_4.19.0-041900.201810221809_i386.deb
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.19/linux-modules-4.19.0-041900-generic_4.19.0-041900.201810221809_i386.deb
安装内核
dpkg -i *.deb
更新grub系统引导文件
update-grub
重启服务器
reboot
重启后查看系统内核版本,确认是否安装成功
uname -r
CentOS
更换内核
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 -y
查看内核是否安装成功
rpm -qa | grep kernel
更新grub系统引导文件
egrep ^menuentry /etc/grub2.cfg | cut -f 2 -d \'
grub2-set-default 0 #default 0表示第一个内核设置为默认运行, 选择最新内核就对了
重启服务器
reboot
开启BBR
删除BBR
为了避免升级内核重复添加BBR开启代码,可以使用以下命令先删除一遍
sed -i '/net\.core\.default_qdisc=fq/d' /etc/sysctl.conf
sed -i '/net\.ipv4\.tcp_congestion_control=bbr/d' /etc/sysctl.conf
开启BBR
echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
使其生效
sysctl -p
查看BBR是否开启成功
执行如下命令,如果返回值中有bbr即说明开启成功
sysctl net.ipv4.tcp_congestion_control
执行如下命令,如果返回值中有tcp_bbr模块,即说明开启成功
lsmod | grep bbr
版权声明:本文为原创文章,版权归 suntl.com 所有,转载请注明出处!
本文链接:https://suntl.com/820.html
友情提示:如果博客出现404或链接失效,请留言或者联系博主修复!
博主,问个问题,阿里新加坡的服务器用国际版的还是轻量的?
阿里云国际和国内都是一样的,不一样的是ECS服务器和轻量服务器,ECS服务器的线路是三网直连,轻量服务器的线路绕路并不好,国际版主要是因为有新手套餐2.0,新手套餐是ECS服务器,价格便宜,国内版没有这款套餐
原来如厕,多谢博主
原来如此,。。。不好意思字打错了
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.17-rc1/linux-image-4.17.0-041700rc1-generic_4.17.0-041700rc1.201804152230_amd64.deb --no-check-certificate
需要加这个,要不下载不了博主现在用的是4.几的?我现在用的4.14的BBRplus,目前测试是相对最好的一个版本。
我感觉内核版本区别并不大,没必要追求新的,能开BBR就行
做站BBR,科学上网BBRplus