Files
Private-Proxy/server_config/sysctl/99-zz-rrpp-network.kvm.conf
T
RoyirinRosmontis 375153b810 server_config: 系统级网络优化规范(KVM/LXC 差异 + qdisc 持久化 + sysctl.conf 覆盖坑)
- 新增 sysctl/99-zz-rrpp-network.{kvm,lxc}.conf 两套模板(99-zz- 前缀保证最后生效)
- 新增 systemd/rrpp-qdisc.service + scripts/rrpp-qdisc.sh(default_qdisc 只对新建网卡生效,需显式 replace)
- README §2.6:如实记录实测差异
  * KVM/完整VM:rmem/wmem、netdev_max_backlog、default_qdisc、qdisc 均可写
  * LXC/OpenVZ:上述项缺失或只读、eth0 为 noqueue、/usr/lib/sysctl.d 的 pid_max/fs.protected_* 报 permission denied(正常)
  * 坑:sysctl --system 会在 sysctl.d 之后加载 /etc/sysctl.conf,实测某节点旧文件把 tcp_mtu_probing 覆盖回 0
- 记录 UDP 策略:节点不部署 UDP 传输,UDP 需求统一走 UoT v2(§5.5)
- 更新 §9 服务表、§10 验证清单、§11 目录索引
2026-09-20 21:50:13 +08:00

44 lines
1.8 KiB
Plaintext
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# ============================================================
# RRPP 节点系统级网络优化(KVM / 完整虚拟机版,含 Azure 等)
# 部署位置:/etc/sysctl.d/99-zz-rrpp-network.conf
# 配套:systemd/rrpp-qdisc.service + scripts/rrpp-qdisc.sh(见 README §2.6)
# ------------------------------------------------------------
# 文件名以 99-zz- 开头:sysctl 按文件名字典序加载、后者覆盖前者,
# 该命名保证本文件最后生效(避免被其它 99-*.conf 覆盖)。
#
# ⚠ 仍有一个坑:`sysctl --system` 会在所有 sysctl.d 之后**再次加载
# /etc/sysctl.conf**(实测某节点 2022 年的 /etc/sysctl.conf 把
# tcp_mtu_probing 覆盖回 0)。若目标机器上该文件含网络键,
# 必须同步注释掉冲突行,否则本文件不生效。
#
# 容器(LXC/OpenVZ)请改用 99-zz-rrpp-network.lxc.conf
# ============================================================
# --- 拥塞控制与队列(BBR 需配 fq,否则易 bufferbloat)---
net.ipv4.tcp_congestion_control = bbr
net.core.default_qdisc = fq
# --- PMTUD 黑洞缓解(跨境链路 TLS 握手稳定超时的常见元凶)---
net.ipv4.tcp_mtu_probing = 1
# --- 握手 / 时延 ---
net.ipv4.tcp_fastopen = 3
net.ipv4.tcp_slow_start_after_idle = 0
# --- 连接生命周期(代理长连接 + 大量短连接)---
net.ipv4.tcp_tw_reuse = 2
net.ipv4.tcp_fin_timeout = 15
net.ipv4.tcp_keepalive_time = 300
net.ipv4.tcp_keepalive_intvl = 30
net.ipv4.tcp_keepalive_probes = 5
net.ipv4.ip_local_port_range = 10240 65000
# --- 队列深度与缓冲(高并发 / 大 BDP)---
net.core.somaxconn = 32768
net.ipv4.tcp_max_syn_backlog = 32768
net.core.netdev_max_backlog = 32768
net.core.rmem_max = 33554432
net.core.wmem_max = 33554432
net.ipv4.tcp_rmem = 4096 131072 33554432
net.ipv4.tcp_wmem = 4096 16384 33554432