静看光阴荏苒
不管不顾不问不说也不念

编译Google BBR v2 Alpha 2019-11-17

我大概几个月前编译过一个旧版本的,最近又更新了,不过还是预览版,没有正式发布。

上次那个版本的kernel已经飙到5.2了,这次的更是直接到5.4了,要是正式版放出来我估摸着怎么着也得上5.0。。

上次是随便撸了个脚本没把编译步骤写出来,这次想到如果大家都在自己的机器上编译的话,就可以用自己机器旧内核的配置,这样炸的概率会小很多,当然编译kernel对机器硬件配置要求较高,一般的VPS就别费劲了,浪费时间。。

另外这次的版本编译起来有几个坑。。第一次编译几分钟报了个错,解决了再来跑一遍竟然后面又报个缺少rsync。。我寻思你要rsync干啥??

以下步骤在Debian10上测试通过。

apt -y install build-essential libncurses-dev libssl-dev libelf-dev bison bc flex rsync git screen

编译要花很长时间,建议开个screen守护一下:

screen -S kernel

下载源码:

git clone -b v2alpha https://github.com/google/bbr.git
cd bbr

使用当前机器的旧内核配置,并自动帮你把新内核上的新功能选项以默认值进行配置:

make olddefconfig

打开图形化菜单:

make menuconfig

选择Networking support:

选择Networking options:

选择TCP: advanced…:

然后在里面你可以看到BBR2的新选项,这里有两种编译方式,M是构建为模块,*是直接构建到内核:

如果这里选为*的话,你可以在下面的Default TCP…内把默认的拥塞控制协议直接设置为BBR2:

这样安装好这个内核后就不需要去动sysctl.conf了,默认就开启BBR2。

当然你用模块也可以,就是需要自己加载模块罢了。设置好了后SAVE一下退出这个界面即可。

下面是我踩过的坑,解决办法,手动编辑.config:

nano .config

把里面的这一行注释掉或者留空里面的值:

CONFIG_SYSTEM_TRUSTED_KEYS="debian/certs/debian-uefi-certs.pem"

为节省编译时间,关闭DEBUG:

CONFIG_DEBUG_INFO=n

做好上面这些后,现在就可以开始编译了:

make deb-pkg LOCALVERSION=-imlala -j$(nproc)

编译时间视你的机器性能而定,看看片锻炼下身体,回来应该就编译好了,在上级目录有可用的deb包,使用dpkg安装然后重启:

cd ..
dpkg -i linux-image-5.4.0-rc6-imlala_5.4.0-rc6-imlala-1_amd64.deb
dpkg -i linux-headers-5.4.0-rc6-imlala_5.4.0-rc6-imlala-1_amd64.deb
reboot

直接编译到内核的使用下面的方法查看BBR2算法是否已经生效:

sysctl net.ipv4.tcp_congestion_control

正常的话会回显:

net.ipv4.tcp_congestion_control = bbr2

编译为模块的需要自己手动加载模块再配置sysctl.conf使其生效:

modprobe tcp_bbr2
echo "tcp_bbr2" >> /etc/modules
echo "net.ipv4.tcp_congestion_control = bbr2" >> /etc/sysctl.conf
sysctl -p
赞(7)
未经允许不得转载:荒岛 » 编译Google BBR v2 Alpha 2019-11-17
分享到: 更多 (0)

评论 12

  • 昵称 (必填)
  • 邮箱 (必填)
  • 网址
  1. #1

    网速+1kb :smile:

    橘子4年前 (2019-11-22) Google Chrome 76.0.3809.98 Google Chrome 76.0.3809.98 Windows 8 x64 Edition Windows 8 x64 Edition回复
    • 网速-1kb :neutral:

      LALA4年前 (2019-11-23) Google Chrome 74.0.3729.169 Google Chrome 74.0.3729.169 Windows 10 x64 Edition Windows 10 x64 Edition回复
  2. #2

    现在墙是升级了么 用一会就阻断几分钟 就又好了

    哇咔咔4年前 (2019-11-23) Google Chrome 69.0.3497.100 Google Chrome 69.0.3497.100 Windows 7 x64 Edition Windows 7 x64 Edition回复
    • 我这边也差不多吧,跑大流量的东西,比如看4K视频之类的连一会就阻断,但是用来玩外服游戏的话也还好没怎么断过。。

      LALA4年前 (2019-11-23) Google Chrome 74.0.3729.169 Google Chrome 74.0.3729.169 Windows 10 x64 Edition Windows 10 x64 Edition回复
      • tls 的都不阻断

        哇咔咔4年前 (2019-11-24) Google Chrome 69.0.3497.100 Google Chrome 69.0.3497.100 Windows 7 x64 Edition Windows 7 x64 Edition回复
  3. #3

    大佬,编好的文件传一下儿呗

    https://github.com/xiya233/bbr2 :lol: :lol: :lol:

    114年前 (2020-01-17) Google Chrome 78.0.3904.108 Google Chrome 78.0.3904.108 Windows 10 x64 Edition Windows 10 x64 Edition回复
  4. #4

    debian的,传哪儿都行,别百度网盘就完了,那个下不动…… :eek: :eek: :eek:

    114年前 (2020-01-17) Google Chrome 78.0.3904.108 Google Chrome 78.0.3904.108 Windows 10 x64 Edition Windows 10 x64 Edition回复
  5. #5

    用大佬github上那个内核5.2.0-rc3 bbr2和我之前5.3.0-0.bpo.2-cloud-amd64 bbr来回切了两次,做了各种速度测试,cn2gia,夜里不堵车,怎么感觉这个版本bbr2没以前稳,浮动大,avg和max都比bbr差一些?幻觉了吗?期待大佬的新内核测试……我把vps生成个snapshots去,来回切内核改配置太麻烦…

    114年前 (2020-01-17) Google Chrome 78.0.3904.108 Google Chrome 78.0.3904.108 Windows 10 x64 Edition Windows 10 x64 Edition回复
  6. #6

    感谢大佬,照着你得说明我编译好了一个 :oops: 下一步我准备试试搞cloud这种精简试试 :grin:

    114年前 (2020-01-18) Google Chrome 78.0.3904.108 Google Chrome 78.0.3904.108 Windows 10 x64 Edition Windows 10 x64 Edition回复

分享创造快乐

广告合作资源投稿