在 Debian 和 CentOS 上启用 BBR 加速网络
在 Linux 系统上,通过启用 BBR(Bottleneck Bandwidth and Round-trip propagation time)可以显著提升网络性能。BBR 是由 Google 开发的一种拥塞控制算法,它通过更智能地管理网络流量,提高了带宽利用率和减少了网络延迟。本文将介绍在 Debian 和 CentOS 系统上启用 BBR 的步骤。
在 Debian 上启用 BBR
- 打开终端并以 root 用户身份登录。
- 执行以下命令更新系统软件包:
apt update && apt upgrade -y
- 安装必要的工具:
apt install -y wget
- 下载 BBR 安装脚本:
wget --no-check-certificate https://github.com/teddysun/across/raw/master/bbr.sh
- 给脚本添加执行权限:
chmod +x bbr.sh
- 运行脚本安装 BBR:
./bbr.sh
- 安装完成后,重启系统:
reboot
在 CentOS 上启用 BBR
- 打开终端并以 root 用户身份登录。
- 执行以下命令安装 elrepo 源:
yum install -y https://www.elrepo.org/elrepo-release-7.el7.elrepo.noarch.rpm
- 安装新内核和 BBR 模块:
yum --enablerepo=elrepo-kernel install kernel-ml -y
yum --enablerepo=elrepo-kernel install kmod-tcp_bbr -y
- 更新 GRUB 配置:
grub2-mkconfig -o /boot/grub2/grub.cfg
- 设置默认启动项为新内核:
grub2-set-default 0
- 重启系统:
reboot
BBR 已成功启用,你的系统网络性能应该有所提升。
请记得在执行这些步骤前备份重要数据,并在生产环境中谨慎操作。
版权声明:
作者:Geeker
链接:https://www.vpsgeeker.com/2024/01/21/debian-centos-bbr.html
文章版权归作者所有,未经允许请勿转载。
THE END