v2.8.0 清空历史真正物理删除 + 请求超时可配修复慢接口被掐断
1. 清空历史=真正清空(不再只是删行留痕): - 清空前先停止所有运行中测试线程,避免其继续写入孤儿数据 - DELETE 后重置自增序列(sqlite_sequence),新测试 ID 从 1 开始 - WAL checkpoint(TRUNCATE) + VACUUM 物理回收文件空间,数据不可恢复 - 单条删除删光时同样重置自增序列 2. 慢接口被掐断修复(预处理/首字耗时过长 Read timed out): - 读取超时默认 300s→1800s(30分钟),连接 60s - 「速度测试配置」新增 请求超时(秒) 输入框(默认1800),测试连接+速度采样共用,按次可调(如3600) - 超时错误改为友好提示:等待响应超时(超过N秒未收到数据),引导调大请求超时,不再裸抛 Read timed out - 测试启动日志打印当前超时配置 - 修复案例: 18008 Qwen3.8-FP8 131072 长上下文预填充被 300s 掐断
This commit is contained in:
@@ -77,6 +77,9 @@ class TestRunner(threading.Thread):
|
||||
% (" / ".join(str(x) for x in lengths), max_tokens,
|
||||
" / ".join(str(x) for x in concurrency_levels), n,
|
||||
"开" if warmup else "关", "开" if avoid_cache else "关"))
|
||||
to = self.gen.get("read_timeout") or "默认(1800)"
|
||||
self.log("INFO", "请求超时: 连接 %s s | 等待首字/预处理 %s s(接口慢可在左侧调大)"
|
||||
% (self.gen.get("connect_timeout") or 60, to))
|
||||
|
||||
ratio = self._calibrate()
|
||||
self.ratio = ratio
|
||||
@@ -157,7 +160,9 @@ class TestRunner(threading.Thread):
|
||||
"""
|
||||
from concurrent.futures import ThreadPoolExecutor
|
||||
|
||||
gen_opt = {"max_tokens": max_tokens, "avoid_cache": avoid_cache}
|
||||
gen_opt = {"max_tokens": max_tokens, "avoid_cache": avoid_cache,
|
||||
"connect_timeout": self.gen.get("connect_timeout"),
|
||||
"read_timeout": self.gen.get("read_timeout")}
|
||||
|
||||
def worker(idx):
|
||||
prompt = self._finalize_prompt(base_prompt) # 每流独立随机前缀,避免共享缓存
|
||||
@@ -240,7 +245,9 @@ class TestRunner(threading.Thread):
|
||||
self.log("INFO", "正在校准 token/字符 比例(发送小探测请求)...")
|
||||
try:
|
||||
m = lp.call_stream(self.cfg, probe,
|
||||
{"max_tokens": 8, "avoid_cache": False},
|
||||
{"max_tokens": 8, "avoid_cache": False,
|
||||
"connect_timeout": self.gen.get("connect_timeout"),
|
||||
"read_timeout": self.gen.get("read_timeout")},
|
||||
log=lambda lv, msg: self.log(lv, msg),
|
||||
should_stop=self.should_stop)
|
||||
pt = m.get("prompt_tokens") or 0
|
||||
|
||||
Reference in New Issue
Block a user