mirror of
https://gitee.com/xmz7891/ykxmz.git
synced 2026-10-18 16:00:43 +00:00
test_net_tune.py 原来断言 net-tune.sh 里写着 mtu 1500, 依据是更早一次实测「接口 MTU 降到 1400 会掉到 50%」。 那个结论后来被推翻了 —— 当时漏了一件事: **MSS 钳制只管 TCP,QUIC 走 UDP 完全不受保护。** 路径 MTU 实测 1472(1500 的包不通),QUIC 默认发 ~1452 的包会被 中间设备静默丢掉,而 UDP 丢了不回 ICMP,只能等超时。 把接口 MTU 压到 1400 之后,QUIC 建齐 10 条连接从 28 秒缩到 12 秒。 所以现在是**故意**设 1400。断言跟着改, 不然它会永久假失败,还会诱导后人把真正的改进改回 1500。 顺带记录:全量回归 38 个阶段全部通过。 新增的三个阶段(局域网优化 / 手表局域网切换 / 编码与换行 / 管理页设备控制)都是这轮加的。
49 lines
1.4 KiB
Python
49 lines
1.4 KiB
Python
# -*- coding: utf-8 -*-
|
|
r'''等 2 小时长测跑完,中途定期报告进度。
|
|
|
|
用法: python _build/rp_wait.py [总等待秒数] [检查间隔秒数]
|
|
'''
|
|
from __future__ import annotations
|
|
|
|
import sys
|
|
import time
|
|
from pathlib import Path
|
|
|
|
sys.path.insert(0, str(Path(__file__).parent))
|
|
|
|
from devssh import run # noqa: E402
|
|
|
|
|
|
def once(label: str) -> None:
|
|
out = run("bash /root/rppg.sh 2>&1", timeout=300)[1]
|
|
print(" ────── %s ──────" % label)
|
|
# 只留关键行
|
|
for line in out.splitlines():
|
|
s = line.strip()
|
|
if not s:
|
|
continue
|
|
if any(k in s for k in ("样本数", "已完成", "状态码", "最近 3 条",
|
|
"非 200", "时间", "测试进程", "rp_long2h",
|
|
"rpp30", "200", "000", "502", "530",
|
|
"quic=", "http2=", "明细", "输出日志")):
|
|
print(" " + s)
|
|
print()
|
|
|
|
|
|
def main() -> int:
|
|
total = int(sys.argv[1]) if len(sys.argv) > 1 else 3600
|
|
every = int(sys.argv[2]) if len(sys.argv) > 2 else 900
|
|
waited = 0
|
|
n = 0
|
|
while waited < total:
|
|
step = min(every, total - waited)
|
|
time.sleep(step)
|
|
waited += step
|
|
n += 1
|
|
once("检查点 %d(已等 %d 分钟)" % (n, waited // 60))
|
|
return 0
|
|
|
|
|
|
if __name__ == "__main__":
|
|
sys.exit(main())
|