跳至内容
Hshh's Cosmos
用户工具
登录
站点工具
搜索
工具
显示页面
过去修订
反向链接
最近更改
媒体管理器
网站地图
登录
>
最近更改
媒体管理器
网站地图
您在这里:
Hshh's Cosmos
»
freebsd
»
轻松在现代 FreeBSD 中启用 BBR 功能
您的足迹:
freebsd:freebsd_bbr
本页面只读。您可以查看源文件,但不能更改它。如果您觉得这是系统错误,请联系管理员。
====== 轻松在现代 FreeBSD 中启用 BBR 功能 ====== 从 14.1 开始 tcphpts, tcp_rack, tcp_bbr 都已经默认编译为模块, 需要用直接加载就可以了, 不需要重新编译内核. ==== 加载模块 ==== <code> kldload tcphpts kldload tcp_bbr </code> ==== 系统启动自动加载模块 ==== 可以在 /etc/rc.conf 加入以下内容 <code> kld_list="tcphpts tcp_bbr" </code> ==== 检查模块加载成功 ==== 运行以下命令, 看到有 BBR 一行, 并且有使用情况 <code> sysctl net.inet.tcp.functions_available </code> ==== 切换 TCP 默认实现方式为 BBR ==== 运行以下命令 <code> sysctl net.inet.tcp.functions_default=bbr </code> ==== 过早启动的程序使用 BBR ==== 默认在切换前启动的程序并不会使用到切换后的 bbr, 一种方法是重启程序 另一种是使用特定设置, 15.1 以前使用 sysctl <code> sysctl net.inet.tcp.functions_inherit_listen_socket_stack=0 </code> 15.1 及以后运行以下命令 <code>tcpsso -S freebsd TCP_FUNCTION_BLK bbr</code> ==== 一些优化参数 ==== == 20241205 == 关闭 net.inet.tcp.bbr.measure.use_google 后, 大多数情况不会出现断流<del>, 极小概率在某个系统出现极低速(该问题是接收端其他bug导致)</del> <code> net.inet.tcp.bbr.measure.use_google=0 </code> == 20260719 == 可以通过优化 net.inet.tcp.bbr.cwnd.highspeed_min net.inet.tcp.bbr.cwnd.max_target_limit net.inet.tcp.bbr.probertt.cwnd, 使其在快速网络中接近 linux 的水平, 但是还是没 linux 能打 * 1Gbps <code> # 1Gbps net.inet.tcp.bbr.cwnd.highspeed_min=128 net.inet.tcp.bbr.cwnd.max_target_limit=16 net.inet.tcp.bbr.probertt.cwnd=16 net.inet.tcp.sendbuf_inc=262144 net.inet.tcp.sendbuf_max=16777216 net.inet.tcp.sendspace=4194304 </code> * 2.5Gbps <code> # 1Gbps kern.ipc.maxsockbuf=33554432 net.inet.tcp.bbr.cwnd.highspeed_min=256 net.inet.tcp.bbr.cwnd.max_target_limit=16 net.inet.tcp.bbr.probertt.cwnd=32 net.inet.tcp.sendbuf_inc=524288 net.inet.tcp.sendbuf_max=33554432 net.inet.tcp.sendspace=2097152 </code> * 10Gbps <code> # 10Gbps kern.ipc.maxsockbuf=67108864 net.inet.tcp.bbr.cwnd.highspeed_min=512 net.inet.tcp.bbr.cwnd.max_target_limit=32 net.inet.tcp.bbr.probertt.cwnd=128 net.inet.tcp.sendbuf_inc=1048576 net.inet.tcp.sendbuf_max=67108864 net.inet.tcp.sendspace=4194304 </code> == 20260807 == 关于这个参数 net.inet.tcp.bbr.cwnd.tar_rtt, 测试出来有些争议, 移除了. {{tag>freebsd bbr rack}}
freebsd/freebsd_bbr.txt
· 最后更改:
2026/08/07 02:27
由
Hshh
页面工具
显示页面
过去修订
反向链接
回到顶部