Repository navigation
[Performance] Web UI: an active session tab keeps burning 1+ CPU core and its memory grows unbounded #9679
lumanlight
started this conversation in
General
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
TL;DR (English)
On DSH 0.2.1-alpha.2 (Chrome 155, Ubuntu 24.04, i7-8650U 4C/8T), a Web UI tab that has an
agent turn in flight keeps a Chrome renderer at 82–165% CPU (≈1–1.6 cores), while the very
same page freshly loaded and idle costs only 4.9%. Renderer RSS grows unbounded:
675MB → 970MB within ~4 minutes on a new tab, and 908MB on a 24h-old tab
(176 min CPU accumulated). The cost is paid even when the tab is not being viewed
(Chrome only stops painting and throttles timers for hidden tabs; DSH is WebSocket-driven,
so every message still triggers parse + re-render).
session/listreturns949 sessions / 1,326,496 bytes in one response, so every page load/refresh re-fetches and
rebuilds the whole list. With 6 sessions running concurrently the machine saturates and the UI
(including the "thinking" spinner) visibly janks. Raw measurements and repro commands are in
Appendix A below.
1. 摘要
在同一台机器、同一个 DSH 服务上做 A/B 对比:
即:一个正在跑任务的会话页面 ≈ 1~1.6 个 CPU 核,而同一页面空闲时只要 5%。在 4 核 8 线程笔记本上同时开多个会话时,机器被订满,UI(包括"思考中"的进度圈)明显掉帧。
另有两个独立现象:
session/list一次返回 949 个会话 / 1,326,496 字节,每次打开或刷新页面都要重新拉取并重建列表,刷新耗时明显(且刷新并不能降低负载)。2. 环境
@deepseek-ai/dsh、dsh-web、dsh-web-frontend、dsh-client-ui-conversation、dsh-agent-loop同版本)systemctl --user常驻服务,dsh web监听127.0.0.1:3080running(1 个主会话 + 3 个 teammate 的 Agent Teams 项目 + 2 个独立会话),但只有 1 个前端连接3. 关键观察
setInterval:dsh-client-ui-conversation/lib/client.js里setInterval出现 0 次,requestAnimationFrame出现 7 次。session/list返回 949 项 / 1.3MB;页面打开/刷新要全量拉取。附录 A:复现与测量方法
A.1 找出 DSH 页面的渲染进程并测 CPU(无需 root)
A.2 确认某个渲染进程承载的是哪个页面(内存指纹)
渲染进程命令行里没有 URL,可用内存指纹判定(实测:DSH 页面命中
127.0.0.1:308018 次、DeepSeek Harness7 次;对照的普通网页标签命中其站点域名 24 次、3080 命中 0 次):A.3 干净页面对照实验(无头 Chrome,独立 profile)
A.4 会话列表规模与运行中会话数
A.5 前端 bundle 里的定时器/动画统计
附录 B:实测时的其他负载
load average 4.23,8 线程:running;近 3 分钟 22 个沙箱子进程tracker-miner-fs-3已索引 377,787 文件 / 写盘 16.9GB / 2,434 条失败,平均 17% CPU(6.8 小时)i915 ... Atomic update failure on pipe A反复出现(当日 5 次)All reactions