M9: parking (scale) #10

Open
opened 2026-10-02 00:16:05 +00:00 by jhgaylor · 0 comments
Owner

Depends on: #3

Trigger: Panes with real history still blow the memory budget after step 1 (rerun the S9 benchmark).

Step 1 (cheap memory wins) is split out as a separate issue and comes first.

From PLAN.md, section "M9".


Superlogical's server numbers are about 400KB per terminal against 5MB for
tmux, and unparking takes about 200µs.

  • Trigger: any one of these:

    • geek's daemon holds more than about 50 panes;
    • an agent fleet runs;
    • RSS per idle pane is measured above 2MB.

    Measure first. The milestone starts with a benchmark (RSS per pane at
    empty, full screen and 10k scrollback; per attached client) committed as a
    test.

  • Step 2: parking, only if panes with real history still blow the budget.
    S9 found nothing that argues for PTY or client-buffer parking. Parking
    can't save the shells and shims either (0.75–0.87 GB at 500 panes).

  • Stalled clients: a client that stops reading cost about 28 MB in one
    burst, and up to about 64 MB per client from the 1,024-frame queue. Cap the
    queue in bytes, not frames.

  • CI benchmark: S9's bench.py at 50 idle panes (3.07–3.11 MB per pane
    over four runs) is the regression test M9 wants. Leave headroom.

  • Terminal parking.

    • After 60s with no PTY reads, write the VT state as a GHOSTSNP checkpoint,
      using the M2 path and S5's format, and free the engine.
    • Typing doesn't unpark it.
    • Attaching streams the parked snapshot from disk.
    • Parked state is encrypted with the key decided for M4c.
  • PTY parking. Idle or unwatched PTYs move off their own read tasks onto
    one shared epoll task.

  • Client buffer parking. Free an idle client's per-pane buffers.

  • Done when:

    • 500 idle shells on geek cost under 1MB each in daemon RSS;
    • attaching to a parked pane draws it in under 50ms;
    • the benchmark guards against regressions in CI.
**Depends on:** #3 **Trigger:** Panes with real history still blow the memory budget after step 1 (rerun the S9 benchmark). Step 1 (cheap memory wins) is split out as a separate issue and comes first. _From PLAN.md, section "M9"._ --- Superlogical's server numbers are about 400KB per terminal against 5MB for tmux, and unparking takes about 200µs. - **Trigger:** any one of these: - geek's daemon holds more than about 50 panes; - an agent fleet runs; - RSS per idle pane is measured above 2MB. Measure first. The milestone starts with a benchmark (RSS per pane at empty, full screen and 10k scrollback; per attached client) committed as a test. - **Step 2: parking, only if panes with real history still blow the budget.** S9 found nothing that argues for PTY or client-buffer parking. Parking can't save the shells and shims either (0.75–0.87 GB at 500 panes). - **Stalled clients:** a client that stops reading cost about 28 MB in one burst, and up to about 64 MB per client from the 1,024-frame queue. Cap the queue in bytes, not frames. - **CI benchmark:** S9's `bench.py` at 50 idle panes (3.07–3.11 MB per pane over four runs) is the regression test M9 wants. Leave headroom. - **Terminal parking.** - After 60s with no PTY reads, write the VT state as a GHOSTSNP checkpoint, using the M2 path and S5's format, and free the engine. - Typing doesn't unpark it. - Attaching streams the parked snapshot from disk. - Parked state is encrypted with the key decided for M4c. - **PTY parking.** Idle or unwatched PTYs move off their own read tasks onto one shared epoll task. - **Client buffer parking.** Free an idle client's per-pane buffers. - **Done when:** - 500 idle shells on geek cost under 1MB each in daemon RSS; - attaching to a parked pane draws it in under 50ms; - the benchmark guards against regressions in CI.
Sign in to join this conversation.
No description provided.