[GH-ISSUE #3950] 0.1.48 engine: random 10-80s TTFT spikes on short chat requests (not in 0.1.44.1) #1690

Closed
opened 2026-11-04 01:53:13 +07:00 by bsakaguchi · 3 comments
Owner

Originally created by @flamesugar on GitHub (Oct 24, 2026).
Original GitHub issue: https://github.com/Niko1221/Strata/issues/3950

Summary

Upgrading the engine from 0.1.44.1 (local build) to the prebuilt 0.1.48 release (strata-engine-0.1.48-linux-x86_64-cuda-cuda13.tar.gz) introduced large, random time-to-first-token (TTFT) spikes on short chat requests that did not exist on 0.1.44.1. Throughput (tok/s) is roughly the same or slightly lower; the problem is tail latency.

System

  • GPU: RTX 3090 24 GB, driver 610.57.04 (a community GPU-unlock kernel module is loaded on this box; same GPU/config for both engine versions, so it is not a variable between the two runs)
  • CUDA: 13.0 (prebuilt package)
  • OS: Linux, kernel 7.2.5-3-omarchy (Arch-based)
  • Model: Qwen3.8-Flash-Next, IQ3_S pack, --kv int8 --spec 4 --spec-min-p 0.70 --vram-reserve-mib 1024 --expert-cache auto, --parallel 1
  • Both engines tested back-to-back on the same machine, same model pack, same router config (only exe/BUILD.json swapped), using tools/strata_bench.py --runs 5 --long

What changed between the two runs

Only the engine binary + its bundled CUDA libs (strata, strata-vision, libstrata_kq.so, libcudart.so.13, libcublas.so.13, libcublasLt.so.13) were swapped for the official 0.1.48 prebuilt. Router config, model pack, GPU, and bench script were identical.

Results

Throughput (median over 5 runs)

metric 0.1.44.1 0.1.48 change
4K prompt tok/s 1177–1183 1156.8 -1.8%
16K prompt tok/s 2262–2270 2238.9 -1.3%
32K prompt tok/s 2294–2300 2241.9 -2.4%
chat decode tok/s 88.0–95.5 71.4 -14 to -25%
agent decode tok/s 94.0–98.1 88.6 -6 to -10%
agent cache hit % 68.8–68.9 69.7 ~unchanged

Chat TTFT — 15 identical short requests (85-93 prompt tokens)

0.1.44.1, all 15 requests:

range: 0.534s – 0.599s   (tight, no outliers)

0.1.48, same 15 requests, same prompts, in order:

17.973s, 19.423s, 9.263s, 21.798s, 0.649s, 62.512s, 0.628s,
0.565s, 0.545s, 0.570s, 76.075s, 8.978s, 12.840s, 0.652s, 3.850s

9 of 15 requests are >8s; the worst is 76s for an 85-token prompt. Normal and anomalous values are interleaved randomly, not a one-time cold-start cost.

Agent turns (25 turns, 5 sessions x 5 turns, ~10K+ context)

  • median TTFT: 3.41s (matches 0.1.44.1's 3.37-3.39s)
  • max TTFT: 82.83s

32K prompt TTFT (5 runs)

  • 0.1.44.1: ~14.5s range
  • 0.1.48: median 21.88s, max 31.13s

Ruled out as the cause

  • Not the bench script: Suite.run() is sequential (run_chat -> run_prompt(4K) -> run_prompt(16K) -> run_agent -> run_prompt(32K)); run_clients (the only concurrent path in the script) was not invoked.
  • Not external concurrent traffic: router logs for the whole bench window (~15 min) show exactly one external request (request for unknown model None -> FN_3s, 11:43:10), which with --parallel 1 could only ever delay one in-flight request. It cannot explain 9/15 chat anomalies plus the agent and 32K spikes.
  • Not a GPU/config difference: identical router config, model pack, and hardware; only the engine binary changed.

Suspected area

0.1.48's startup log shows a new feature not present in 0.1.44.1:

strata serve: conversation cache sized from the free RAM: 8192 MiB for up to 4 parked conversations, so an agent's next turn reuses its prompt (--conversation-cache-mib N sets it, 0 turns it off)
strata serve: conversation cache: parked 139366 tokens in 125.1 ms; parked=4 bytes=6148736940 evictions=35 snapshot_bytes=2995787416 reused_kv_bytes=2108202624
strata serve: conversation cache: restored 139366 tokens (live) in 248.8 ms; parked=4 bytes=6163084120

Each individual park/restore event only takes 100-250ms in the log, which doesn't by itself explain the 10-80s stalls, but the timing coincides with when the stalls start appearing — this smells like a lock/queue interaction between conversation-cache eviction and the adaptive-tier expert swap-in, rather than the cache operations themselves.

Repro

# install the prebuilt engine
curl -L -o strata-engine-0.1.48.tar.gz \
  https://github.com/Niko1221/Strata/releases/latest/download/strata-engine-0.1.48-linux-x86_64-cuda-cuda13.tar.gz
# sha256 matched the feed's manifest (3e11a82e325cf4968a1734446e8945d7918a5657e964c6c5d2c262aa59258f57)
tar -xzf strata-engine-0.1.48.tar.gz -C engine/
python3 tools/strata_bench.py --url http://127.0.0.1:18080 --runs 5 --long

Compare chat-request TTFT distribution against the same bench on 0.1.44.1 with the same model pack and router config.

Workaround

Rolled back to the locally-built 0.1.44.1 engine, which does not exhibit this issue. Would like to know whether --conversation-cache-mib 0 on 0.1.48 removes the stalls before filing this as a confirmed regression in that feature specifically — happy to run that A/B and report back if useful.

Originally created by @flamesugar on GitHub (Oct 24, 2026). Original GitHub issue: https://github.com/Niko1221/Strata/issues/3950 ## Summary Upgrading the engine from 0.1.44.1 (local build) to the prebuilt 0.1.48 release (`strata-engine-0.1.48-linux-x86_64-cuda-cuda13.tar.gz`) introduced large, random time-to-first-token (TTFT) spikes on short chat requests that did not exist on 0.1.44.1. Throughput (tok/s) is roughly the same or slightly lower; the problem is tail latency. ## System - GPU: RTX 3090 24 GB, driver 610.57.04 (a community GPU-unlock kernel module is loaded on this box; same GPU/config for both engine versions, so it is not a variable between the two runs) - CUDA: 13.0 (prebuilt package) - OS: Linux, kernel 7.2.5-3-omarchy (Arch-based) - Model: Qwen3.8-Flash-Next, IQ3_S pack, `--kv int8 --spec 4 --spec-min-p 0.70 --vram-reserve-mib 1024 --expert-cache auto`, `--parallel 1` - Both engines tested back-to-back on the same machine, same model pack, same router config (only `exe`/`BUILD.json` swapped), using `tools/strata_bench.py --runs 5 --long` ## What changed between the two runs Only the engine binary + its bundled CUDA libs (`strata`, `strata-vision`, `libstrata_kq.so`, `libcudart.so.13`, `libcublas.so.13`, `libcublasLt.so.13`) were swapped for the official 0.1.48 prebuilt. Router config, model pack, GPU, and bench script were identical. ## Results ### Throughput (median over 5 runs) | metric | 0.1.44.1 | 0.1.48 | change | |---|---:|---:|---:| | 4K prompt tok/s | 1177–1183 | 1156.8 | -1.8% | | 16K prompt tok/s | 2262–2270 | 2238.9 | -1.3% | | 32K prompt tok/s | 2294–2300 | 2241.9 | -2.4% | | chat decode tok/s | 88.0–95.5 | 71.4 | -14 to -25% | | agent decode tok/s | 94.0–98.1 | 88.6 | -6 to -10% | | agent cache hit % | 68.8–68.9 | 69.7 | ~unchanged | ### Chat TTFT — 15 identical short requests (85-93 prompt tokens) 0.1.44.1, all 15 requests: ``` range: 0.534s – 0.599s (tight, no outliers) ``` 0.1.48, same 15 requests, same prompts, in order: ``` 17.973s, 19.423s, 9.263s, 21.798s, 0.649s, 62.512s, 0.628s, 0.565s, 0.545s, 0.570s, 76.075s, 8.978s, 12.840s, 0.652s, 3.850s ``` 9 of 15 requests are >8s; the worst is 76s for an 85-token prompt. Normal and anomalous values are interleaved randomly, not a one-time cold-start cost. ### Agent turns (25 turns, 5 sessions x 5 turns, ~10K+ context) - median TTFT: 3.41s (matches 0.1.44.1's 3.37-3.39s) - max TTFT: **82.83s** ### 32K prompt TTFT (5 runs) - 0.1.44.1: ~14.5s range - 0.1.48: median 21.88s, max 31.13s ## Ruled out as the cause - **Not the bench script**: `Suite.run()` is sequential (`run_chat` -> `run_prompt(4K)` -> `run_prompt(16K)` -> `run_agent` -> `run_prompt(32K)`); `run_clients` (the only concurrent path in the script) was not invoked. - **Not external concurrent traffic**: router logs for the whole bench window (~15 min) show exactly one external request (`request for unknown model None -> FN_3s`, 11:43:10), which with `--parallel 1` could only ever delay one in-flight request. It cannot explain 9/15 chat anomalies plus the agent and 32K spikes. - **Not a GPU/config difference**: identical router config, model pack, and hardware; only the engine binary changed. ## Suspected area 0.1.48's startup log shows a new feature not present in 0.1.44.1: ``` strata serve: conversation cache sized from the free RAM: 8192 MiB for up to 4 parked conversations, so an agent's next turn reuses its prompt (--conversation-cache-mib N sets it, 0 turns it off) strata serve: conversation cache: parked 139366 tokens in 125.1 ms; parked=4 bytes=6148736940 evictions=35 snapshot_bytes=2995787416 reused_kv_bytes=2108202624 strata serve: conversation cache: restored 139366 tokens (live) in 248.8 ms; parked=4 bytes=6163084120 ``` Each individual park/restore event only takes 100-250ms in the log, which doesn't by itself explain the 10-80s stalls, but the timing coincides with when the stalls start appearing — this smells like a lock/queue interaction between conversation-cache eviction and the adaptive-tier expert swap-in, rather than the cache operations themselves. ## Repro ``` # install the prebuilt engine curl -L -o strata-engine-0.1.48.tar.gz \ https://github.com/Niko1221/Strata/releases/latest/download/strata-engine-0.1.48-linux-x86_64-cuda-cuda13.tar.gz # sha256 matched the feed's manifest (3e11a82e325cf4968a1734446e8945d7918a5657e964c6c5d2c262aa59258f57) tar -xzf strata-engine-0.1.48.tar.gz -C engine/ python3 tools/strata_bench.py --url http://127.0.0.1:18080 --runs 5 --long ``` Compare chat-request TTFT distribution against the same bench on 0.1.44.1 with the same model pack and router config. ## Workaround Rolled back to the locally-built 0.1.44.1 engine, which does not exhibit this issue. Would like to know whether `--conversation-cache-mib 0` on 0.1.48 removes the stalls before filing this as a confirmed regression in that feature specifically — happy to run that A/B and report back if useful.
bsakaguchi 2026-11-04 01:53:13 +07:00
Author
Owner

@github-actions[bot] commented on GitHub (Oct 24, 2026):

Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing:

  • Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes".

Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment /reopen.

Details: CONTRIBUTING.md

<!-- gh-comment-id:6383111771 --> @github-actions[bot] commented on GitHub (Oct 24, 2026): Thanks for the issue. To keep the tracker readable, every item needs an area prefix in the title and the parts of the issue form filled in. This one is missing: - [ ] Start the title with its area: [Engine], [GUI], [TUI], [Benchmark], [Docs] or [Other], then a short description. Example: "[Engine] decode stops after 2 minutes". Edit the issue (title and description) and this note goes away on its own. If it is still missing parts in 5 days it will be closed, which is not a rejection: fix it and comment `/reopen`. Details: [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md)
Author
Owner

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

Please retest on 0.2.7.1 with --conversation-cache-mib 0 and with the default, and send the engine log around one slow chat request.

<!-- gh-comment-id:6492028982 --> @Niko1221 commented on GitHub (Oct 29, 2026): Please retest on 0.2.7.1 with `--conversation-cache-mib 0` and with the default, and send the engine log around one slow chat request.
Author
Owner

@github-actions[bot] commented on GitHub (Oct 29, 2026):

Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection.

To bring it back: fix the title (area prefix) and the missing parts, then comment /reopen. A check runs and reopens it, or tells you what is still missing. See CONTRIBUTING.md.

<!-- gh-comment-id:6494794989 --> @github-actions[bot] commented on GitHub (Oct 29, 2026): Closing this issue because it still did not follow the format after 5 days. That is housekeeping, not a rejection. To bring it back: fix the title (area prefix) and the missing parts, then comment `/reopen`. A check runs and reopens it, or tells you what is still missing. See [CONTRIBUTING.md](https://github.com/Niko1221/Strata/blob/main/CONTRIBUTING.md).
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#1690
No description provided.