centos、ubuntu下开启BBR
BBR 目的是要尽量跑满带宽, 并且尽量不要有排队的情况, 效果并不比速锐差
BBR算法科普:http://blog.csdn.net/dog250/article/details/52830576
最新 4.9.0-rc8 内核已支持 tcp_bbr 下面简单讲述如何开启
VPS主机必须为KVM类型
魔改BBR可以参考:
https://github.com/tcp-nanqinlang/wiki/wiki/general
魔改BBR一键脚本:
wget https://raw.githubusercontent.com/tcp-nanqinlang/general/master/General/CentOS/bash/tcp_nanqinlang-1.3.2.sh
bash tcp_nanqinlang-1.3.2.sh
centos:
1、一键安装脚本(支持centos6、7)
#wget -O- http://iytc.net/tools/install_bbr_centos.sh | bash
Now I will replace the system kernel to 4.9.0-rc8...
Start installing
Retrieving http://soft.wellphp.com/kernels/x86_64/kernel-ml-4.9.0-rc8.el6.x86_64.rpm
Preparing... ########################################### [100%]
1:kernel-ml ########################################### [100%]
//此处时间较长,请耐心等待
Checking if the installtion is ok
//centos 6下出现此信息为正常
ls: cannot access /etc/grub2.cfg: No such file or directory
Installation is completed, now you can reboot the system.
You should check BBR after the rebooting using command:
sysctl -a|grep congestion_control
安装结束之后,重启:
reboot
重启之后验证是否已经成功:
# uname -a
Linux iytc 4.9.0-rc8.el6.x86_64 #1 SMP Fri Dec 9 08:15:49 CST 2016 x86_64 x86_64 x86_64 GNU/Linux
# sysctl -a|grep tcp_congestion_control
net.ipv4.tcp_congestion_control = bbr
如果不幸失败,可以通过VNC修改启动项到老的内核。
2、分步安装
查看当前内核
#rpm -qa|grep kernel
dracut-kernel-004-388.el6.noarch
kernel-2.6.32-573.3.1.el6.x86_64
kernel-2.6.32-573.el6.x86_64
kernel-firmware-2.6.32-573.3.1.el6.noarch
使用rpm -e 包全名 --nodeps 进行强制删除
然后rpm -ivh 地址 进行安装:
(Centos6/RedHat6) : http://elrepo.org/people/ajb/devel/kernel-ml/el6/x86_64/RPMS/kernel-ml-4.9.0-0.rc8.el6.elrepo.x86_64.rpm
(Centos7/RedHat7) : http://elrepo.org/people/ajb/devel/kernel-ml/el7/x86_64/RPMS/kernel-ml-4.9.0-0.rc8.el7.elrepo.x86_64.rpm
#rpm -ivh http://elrepo.org/people/ajb/devel/kernel-ml/el6/x86_64/RPMS/kernel-ml-4.9.0-0.rc8.el6.elrepo.x86_64.rpm --force
Ubuntu:
1、下载最新内核,最新内核查看这里
wget http://kernel.ubuntu.com/~kernel-ppa/mainline/v4.9-rc8/linux-image-4.9.0-040900rc8-generic_4.9.0-040900rc8.201612051443_amd64.deb
2、安装内核
dpkg -i linux-image-4.9.0*.deb
3、删除其余内核
dpkg -l|grep linux-image
apt-get purge 旧内核
4、更新 grub 系统引导文件并重启
update-grub
reboot
5、开启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
如果结果中有bbr, 则证明你的内核已开启bbr
执行lsmod | grep bbr, 看到有 tcp_bbr 模块即说明bbr已启动
发表评论