支持 CentOS 6/7 · Debian 8+ · Ubuntu 16+ · 内核自动升级 · 参数立即生效
bash <(curl -fsSL https://vpszdm.com/bbr.sh)
curl -fsSL https://vpszdm.com/bbr.sh -o bbr.sh && chmod +x bbr.sh && bash bbr.sh
wget -qO bbr.sh https://vpszdm.com/bbr.sh && chmod +x bbr.sh && bash bbr.sh
| 参数 | 优化值 | 说明 |
|---|---|---|
| tcp_congestion_control | bbr | Google BBR 拥塞控制算法 |
| default_qdisc | fq | 公平队列,配合 BBR 效果最佳 |
| tcp_tw_reuse | 1 | TIME_WAIT 连接复用,减少端口耗尽 |
| tcp_max_tw_buckets | 20000 | 最大 TIME_WAIT 连接数 |
| tcp_keepalive_time | 60s | 空闲 60s 后开始保活探测(默认 7200s) |
| tcp_mtu_probing | 1 | MTU 路径探测,减少分片 |
| rmem_max / wmem_max | 32 MB | 最大收发缓冲区,提升大带宽利用率 |
| ip_local_port_range | 1024–65535 | 扩展本地端口范围,支持更多并发连接 |
| tcp_syncookies | 1 | 防 SYN Flood,高并发下保持稳定 |
| fs.file-max | 1,000,000 | 系统最大文件描述符,避免连接数瓶颈 |
sysctl net.ipv4.tcp_congestion_control
net.ipv4.tcp_congestion_control = bbrlsmod | grep bbr
sysctl net.core.default_qdisc net.ipv4.tcp_congestion_control net.ipv4.tcp_tw_reuse
/etc/sysctl.d/99-bbr.conf 和
/etc/sysctl.d/99-tcp-tune.conf,删除文件后重启即可完全恢复系统默认值。
rm -f /etc/sysctl.d/99-bbr.conf
rm -f /etc/sysctl.d/99-tcp-tune.conf
sysctl --system