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 目录索引
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
# ============================================================
|
||||
# RRPP 节点系统级网络优化(LXC / OpenVZ 容器版)
|
||||
# 部署位置:/etc/sysctl.d/99-zz-rrpp-network.conf
|
||||
# ------------------------------------------------------------
|
||||
# 文件名以 99-zz- 开头:sysctl 按文件名字典序加载、后者覆盖前者,
|
||||
# 该命名保证本文件最后生效(避免被其它 99-*.conf 覆盖)。
|
||||
#
|
||||
# 容器差异(实测 2026-09):
|
||||
# net.core.rmem_max / wmem_max → 不存在或只读(宿主机控制)
|
||||
# net.core.default_qdisc → 不存在(sysctl 报 cannot stat)
|
||||
# net.core.netdev_max_backlog → 缺失
|
||||
# eth0 根 qdisc → noqueue,无法设置 fq
|
||||
# /usr/lib/sysctl.d 的 kernel.pid_max、fs.protected_* → permission denied(正常)
|
||||
# 故本文件只写容器内可写且有效的 netns 级项。
|
||||
# ============================================================
|
||||
|
||||
# --- 拥塞控制(qdisc 由宿主机控制,容器内无法设 fq)---
|
||||
net.ipv4.tcp_congestion_control = bbr
|
||||
|
||||
# --- 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
|
||||
|
||||
# --- 队列深度(netns 级,容器内可写)---
|
||||
net.core.somaxconn = 32768
|
||||
net.ipv4.tcp_max_syn_backlog = 32768
|
||||
Reference in New Issue
Block a user