0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

tcp bbr

0
Posted at

BBR 专门为这种“长肥管道”(Long Fat Network)设计,能让连接在有丢包的情况下依然保持高吞吐。

sysctl net.ipv4.tcp_congestion_control net.core.default_qdisc net.ipv4.tcp_available_congestion_control
# 设置默认队列调度算法为 fq (BBR 的最佳搭档)
sudo sysctl -w net.core.default_qdisc=fq

# 切换拥塞控制算法为 bbr
sudo sysctl -w net.ipv4.tcp_congestion_control=bbr

# 使配置立即生效并保存
sudo sysctl -p

如果担心对生产环境有极端影响,可以先观察一段时间。如果发现其他服务出现异常(极罕见),可以随时一行命令切回去:

# 1. 恢复队列调度算法
sudo sysctl -w net.core.default_qdisc=fq_codel

# 2. 恢复拥塞控制算法 (之前是 westwood)
sudo sysctl -w net.ipv4.tcp_congestion_control=westwood

# 3. 刷新并生效
sudo sysctl -p

持久化网络配置

# 将配置写入一个新的优化文件,避免污染主配置文件
echo "net.core.default_qdisc = fq" | sudo tee /etc/sysctl.d/99-solana-network.conf
echo "net.ipv4.tcp_congestion_control = bbr" | sudo tee -a /etc/sysctl.d/99-solana-network.conf
echo "net.ipv4.tcp_fastopen = 3" | sudo tee -a /etc/sysctl.d/99-solana-network.conf
echo "net.ipv4.tcp_slow_start_after_idle = 0" | sudo tee -a /etc/sysctl.d/99-solana-network.conf

# 重新加载配置使其生效
sudo sysctl -p /etc/sysctl.d/99-solana-network.conf
0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?