目前套用 BBR 建議不要使用 4.12 內核。
目前 4.12 內核 對於 virtio 網路驅動有嚴重的bug,會導致網路速度緩慢。
該問題會所有影響使用virtio網路虛擬化的KVM VPS。
而目前已經有相關的Patch,但尚未合併:
https://patchwork.kernel.org/patch/9891157/
所以呢还是用4.11.9吧
使用魔改BBR首先要确认能开启BBR,Debian9用户就不用换内核了233
开启BBR
wget --no-check-certificate -qO 'BBR.sh' 'https://moeclub.org/attachment/LinuxShell/BBR.sh' && chmod a+x BBR.sh
安装指定内核版本,以4.11.9为例
bash BBR.sh -f v4.11.9
重启后运行以下命令,结果不为空,则开启BBR成功.
lsmod |grep 'bbr'
一键开启魔改BBR
wget --no-check-certificate -qO 'BBR_POWERED.sh' 'https://moeclub.org/attachment/LinuxShell/BBR_POWERED.sh' && chmod a+x BBR_POWERED.sh && bash BBR_POWERED.sh -f v4.11.9
Debian 7 直接运行上面的一键脚本会提示
The gcc version require gcc-4.9 or higher.
You can try apt-get install -y gcc-4.9 or apt-get install -y gcc-6
Please upgrade it manually!
按照提示来进行安装会提示
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package g++-4.9
E: Couldn't find any package by regex 'g++-4.9'
Reading package lists... Done
Building dependency tree
Reading state information... Done
E: Unable to locate package gcc-6
附上解决办法:
apt-get update
apt-get upgrade
cp /etc/apt/sources.list /etc/apt/sources.list.WHEEZY
nano /etc/apt/sources.list
将/etc/apt/sources.list文件中的wheezy全部替换为jessie,然后
apt-get update
apt-get install gcc-4.9 g++-4.9
重新执行上面的一键脚本即可,然后改回去
cp /etc/apt/sources.list.WHEEZY /etc/apt/sources.list
apt-get update
说明
执行过程中会重新编译模块.
模块默认为开机自动加载.
模块名称:tcp_bbr_powered
可用 modprobe tcp_bbr_powered 命令进行加载模块.
可执行 lsmod |grep 'bbr_powered'
结果不为空,则加载模块成功
可执行 sysctl -w net.ipv4.tcp_congestion_control=bbr_powered 使用此模块.
以上只是说明,直接使用一键脚本即可.
以上代码来源于:
https://moeclub.org/2017/06/06/249/
https://moeclub.org/2017/06/24/278/
感谢