Skip to content

workdir-gc only cleans node_modules; build artifacts in dist/tmp/.tmp have no TTL and piled up 56G, blowing out the disk. | workdir-gc 只清 node_modules,dist/tmp/.tmp 构建产物无 TTL 堆积 56G 撑爆磁盘 #17

Open

Description

@ranxianglei

🤖 Powered by ework

来源: dog/ework-aio#3(https://github.com/ranxianglei/billion-context 相关运维)分析「磁盘快满了 spawn refused: only 988MB free」时发现

现象:2026-10-04 VM 磁盘 100%(144G/145G),spawn 因 <1024MB watermark 被拒。

根因:workdir-gc 的 TTL 清理只覆盖 node_modules(WORK_NODE_MODULES_TTL_DAYS=1,实测 0 个超 1 天残留,工作正常),但 agent 构建/临时产物 <issue>/ework-daemon/{dist,tmp,.tmp} 无任何 TTL——本次清点出 1245 个目录、57.6G(单目录最大 2.1G),全部 mtime>1 天,纯垃圾。配合缓存(npm/bun/journal)另 11G。

影响:重度舰队活动下 ~2 天即可堆积 50G+,周期性触发磁盘 watermark 拒绝 spawn(本次 2b8b7cf0-1ddf-480f-9063-73a0782c213d)。

建议修法:workdir-gc 扩一类清理:issue workdir 下 dist/tmp/.tmp 目录 mtime 超过 TTL(建议 1 天,与 node_modules 对齐)即删;保留 .git 与源码。可直接在现有 workdir-gc 日志点旁扩展。

已做止血(运维手动):清除全部 1245 目录 + npm/bun/journal 缓存,恢复至 78G/145G。本 issue 立项的是防复发。


Mirrored from ework issue #17

Activity

  1. ranxianglei commented on Oct 9, 2026

    @ranxianglei
    OwnerAuthor

    🤖 Powered by ework

    [bot] 🏷 来源: dog/ework-aio#3 分析 VM 磁盘再次 100%(2026-10-09)

    量化实证(本轮 5 天内 86G→119G,又触发 spawn 拒绝水位):

    • issue workdir 总量 119G,其中 ~85G 落在 ~400 个 72h 内活跃的 issue 目录,单个 b-c 目录 ~1.2G(node_modules 为主)
    • 当前 issue 产出速度 ~60+/天 × ~1.2G/目录 ≈ 72G/天增量;workdir-gc 7 天保留 → 稳态需求 ~500G,145G 盘结构性装不下——这不是清理频率问题,是 per-issue node_modules 复制的架构问题
    • bare stores(.refs.git)全部仓库合计仅 962M,不是问题;闲置 >72h 的 870 个目录也只占 30G

    建议根修方向(按性价比):

    1. workdir 引导时用共享安装存储(pnpm/bun global store + 硬链接),把单目录成本从 ~1.2G 压到 ~50-100M
    2. 或 per-repo 共享 node_modules,issue workdir 软链引用
    3. workdir TTL 7d→2d 作为辅助(治标)

    临时止血已做:闲置 >72h 目录整删 + >6h 闲置 node_modules 清扫,释放 58G(现 59%)。若根修上线前再次触顶,按同法清扫即可。请接手实现方向 1 或 2。

  2. changed the title [-]workdir-gc 只清 node_modules,dist/tmp/.tmp 构建产物无 TTL 堆积 56G 撑爆磁盘[/-] [+]workdir-gc only cleans node_modules; build artifacts in dist/tmp/.tmp have no TTL, accumulating to 56G and blowing out the disk. | workdir-gc 只清 node_modules,dist/tmp/.tmp 构建产物无 TTL 堆积 56G 撑爆磁盘[/+] on Oct 16, 2026
  3. changed the title [-]workdir-gc only cleans node_modules; build artifacts in dist/tmp/.tmp have no TTL, accumulating to 56G and blowing out the disk. | workdir-gc 只清 node_modules,dist/tmp/.tmp 构建产物无 TTL 堆积 56G 撑爆磁盘[/-] [+]workdir-gc only cleans node_modules; build artifacts in dist/tmp/.tmp have no TTL and piled up 56G, blowing out the disk. | workdir-gc 只清 node_modules,dist/tmp/.tmp 构建产物无 TTL 堆积 56G 撑爆磁盘[/+] on Oct 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions