[GH-ISSUE #874] A lot of disk write when vision is on. #382

Closed
opened 2026-11-04 01:42:30 +07:00 by bsakaguchi · 2 comments
Owner

Originally created by @HouZoengLo on GitHub (Oct 5, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/874

During a single agent task there is a lot of disk write of the python process with "--vision yes". When I turn off vision there is no disk write any more.

Originally created by @HouZoengLo on GitHub (Oct 5, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/874 During a single agent task there is a lot of disk write of the python process with "--vision yes". When I turn off vision there is no disk write any more.
Author
Owner

@talisp commented on GitHub (Oct 5, 2026):

This matches the code. With vision on, every request that contains images writes a combined embeddings file for all the images in the prompt: serve/server.py, combined = self.vision.dir / f"req-{uuid…}.sve", the bytes of each image's cached .sve concatenated, deleted after the request.

Each image's embeddings are ~9–10 MB here (1024 image tokens). An agent that keeps its screenshots in the conversation re-sends them every turn, so with N images in the history every turn writes ~N × 9–10 MB, even though each image is encoded only once. The per-image cache (<hash>.sve, at most 64, the oldest are deleted) is written once per new image.

Workarounds (opinion):

  • Keep fewer images in the history, if your agent can drop old screenshots. Ours sends images only in short side requests, so the combined files stay small.
  • Point the server's temp dir to RAM, e.g. TMPDIR=/dev/shm for the server process. Then those writes never hit the disk. The cost is RAM: up to ~64 × 10 MB per server run, plus one combined file at a time. Note #914: old strata-vision-* dirs are not removed between runs.

A real fix would be to pass the per-image files to the engine instead of concatenating them per request.

<!-- gh-comment-id:6002042910 --> @talisp commented on GitHub (Oct 5, 2026): This matches the code. With vision on, every request that contains images writes a **combined embeddings file** for *all* the images in the prompt: `serve/server.py`, `combined = self.vision.dir / f"req-{uuid…}.sve"`, the bytes of each image's cached `.sve` concatenated, deleted after the request. Each image's embeddings are ~9–10 MB here (1024 image tokens). An agent that keeps its screenshots in the conversation re-sends them every turn, so with N images in the history every turn writes ~N × 9–10 MB, even though each image is encoded only once. The per-image cache (`<hash>.sve`, at most 64, the oldest are deleted) is written once per new image. **Workarounds (opinion):** - Keep fewer images in the history, if your agent can drop old screenshots. Ours sends images only in short side requests, so the combined files stay small. - Point the server's temp dir to RAM, e.g. `TMPDIR=/dev/shm` for the server process. Then those writes never hit the disk. The cost is RAM: up to ~64 × 10 MB per server run, plus one combined file at a time. Note #914: old `strata-vision-*` dirs are not removed between runs. A real fix would be to pass the per-image files to the engine instead of concatenating them per request.
Author
Owner

@Niko1221 commented on GitHub (Oct 6, 2026):

Fixed in 0.1.40: the per-request combined embeddings file goes to /dev/shm on Linux when it has room and is a short-lived temporary file on Windows, so images no longer cause heavy steady disk writes. Reading the cached per-image files directly is a later step.

<!-- gh-comment-id:6010914494 --> @Niko1221 commented on GitHub (Oct 6, 2026): Fixed in 0.1.40: the per-request combined embeddings file goes to /dev/shm on Linux when it has room and is a short-lived temporary file on Windows, so images no longer cause heavy steady disk writes. Reading the cached per-image files directly is a later step.
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
Niko1221/Strata#382
No description provided.