Skip to content

investigate: CPU/memory load over time + parallelism sweet spot on the sandbox VM #7011

Open

Description

@dezren39

Execution issue for tracked goal CPU/memory load over time + parallelism efficiency (goal_8c75ed164542). Filed 2026-11-07 on Drew's ruling that the census "dead" goals were dormant because the fleet never ran work against them.

Question

What concurrency level makes the sandbox VM (and the laptop executors) finish the most work per credit? Drew's framing: CPU near 99% because it's performing at peak is the target — 95% while 35 things complete beats 8-vs-6 things grinding the whole box to a halt. Find the concurrency sweet spot empirically, then fold the answer into delegation/orchestration practice.

Plan

  • Baseline: load profile snapshot (done — first comment on this issue, 2026-11-07 18:49 CST)
  • Sampled profile over time: load average, run-queue depth, CPU user/sys/idle/iowait/steal, memory + swap pressure, sampled across busy and quiet windows (not just one evening snapshot)
  • Concurrency sweep: run controlled parallel work at several lane/agent concurrency levels and measure completed-work throughput + latency degradation per level
  • Identify the noisy-neighbor cliff: the level where context-switch / iowait / steal growth eats the gains
  • Write the delegation battle plan: who orchestrates, how work is tracked, concurrency defaults per machine, coordination-chatter budget
  • Fold the defaults into the orchestration / lane runbooks so the finding changes behavior, not just this issue

Acceptance

  • A measured sweet-spot number (per machine class) with the data behind it
  • Runbook/orchestration defaults updated to the measured number
  • The swarm delegation battle plan recorded and linked from the goal

Activity

  1. added
    task/triageQueue packet kind: verify, reproduce, and route this item
    source/creatorFiled by the new-issue-creator job
    priority/normalOrdinary priority (the default)
    on Nov 8, 2026
  2. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor
  3. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    Baseline snapshot — sandbox VM, 2026-11-07 18:49 CST (00:49:45Z)

    First empirical data point, taken while the evening fleet was running hot (post-registry-fix claim surge). This is the baseline the investigation compares against.

    Machine: 4 vCPU, 7,934 MB RAM, 1,023 MB swap (350 MB used).

    Load: load average 11.84 / 9.20 / 7.85 on 4 cores — roughly 2–3× oversubscribed.

    vmstat (2s × 6 samples):

    • Run queue r: 15, 15, 16, 4, 12, 8 — deep queues against 4 cores
    • CPU: user 56–69%, sys 18–25%, idle only 7–11%, iowait 5–9%, steal 1–3%
    • Context switches: 25k–53k per interval — heavy churn
    • Memory: 3,650 MB used, 4,284 MB available, ~4.6–4.8 GB page cache; no swap-in/out during the window

    Top consumers at snapshot:

    • hatch daemon (the agent runtime): 47% CPU, 684 MB RSS — the single largest consumer
    • hatch-execd: 7% CPU, 62 MB RSS
    • A du -sb /home/hatch/nix-persist scan: ~6% CPU
    • Multiple concurrent lane execs visible in flight via laptop-agent (research-workflow reads, an mcpx conformance commit/push, gh API calls)

    Read: the box already runs near Drew's "CPU busy" target, but with run queues 2–4× core count and sys% at 18–25%, a real share of that busy is coordination overhead rather than completed work — exactly the noisy-neighbor question this goal exists to answer with a controlled sweep rather than one snapshot.

  4. dezren39 commented on Nov 8, 2026

    @dezren39
    MemberAuthor

    agent-note:v1
    state: filed + enqueued
    Agent: dead-goals-kickoff lane (Drew ruling 2026-11-07 18:47 CST — the census 'dead' goals were dormant, not dead; this is the CPU/memory + parallelism investigation goal's first execution work order)
    Queue: repo-health-code-pilot task 11420
    Baseline at filing (18:49 CST): load 11.84/9.20/7.85 on 4 vCPU, idle 7–11%, sys 18–25% — box busy but coordination-heavy.

  5. developing-today commented on Nov 8, 2026

    @developing-today
    Contributor

    Agent note - handed off. Agent: queue worker repo-worker-code, lane code-w. Session/ID: task 11420. Found via: queue claim. Task: task 11420 triage for issue #7011 claimed by lane code-w and revalidated fresh via gh: issue #7011 OPEN, no hard-stop labels. Execution-lane assignment returned assigned_lane=opencode, so per instruction 1b this task is handed off to the opencode claimant; parked 1200s pending claimant launch. Expectation: claimant launches the bound opencode session and drives task 11420 to a terminal state; if no launch before park expiry, task 11420 returns to the queue. Links: issue #7011. agent-note:v1 agent=repo-worker-code lane=code-w state=handed-off task=11420

  6. added
    work/assignedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed on Nov 8, 2026
  7. removed
    status/parkedDeliberately paused with a recorded resume condition
    on Nov 8, 2026
  8. 209 remaining items

  9. added
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    queue/claimedQueue worker lifecycle state
    on Nov 22, 2026
  10. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · parked task 14822 for #7011

    • Reason: no direct sandbox-VM status path is available from this laptop; ssh sandbox failed DNS resolution. The laptop is not a valid proxy for sandbox load/memory, and no load was generated.
    • Completed: freshly revalidated investigate: CPU/memory load over time + parallelism sweet spot on the sandbox VM #7011 OPEN; PR docs: set provisional sandbox resource defaults #12388 is merged at 7466c4e50839ea67a062d5c425f077ee06889e39; provisional defaults/runbook work and per-cell measurements are already recorded.
    • Resume condition: direct read-only sandbox access becomes available; verify >1h uptime, sustained load below core count, and MemAvailable in the recorded steady-state band before any remaining representative lane-level check.
  11. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    agent-note:v1 — pickup by lane oc-code-08, task 14822, 2026-11-22T12:43Z. Fresh verification: #7011 OPEN; #12388 merged as 7466c4e. Existing per-cell measurement and reversible runbook defaults are complete. This laptop has no direct sandbox status route (ssh sandbox fails DNS resolution); laptop load is not a proxy. No load was generated. I am re-parking on direct sandbox-read access, not an owner decision.

  12. added
    queue/claimedQueue worker lifecycle state
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    status/parkedDeliberately paused with a recorded resume condition
    and removed
    status/parkedDeliberately paused with a recorded resume condition
    queue/parkedQueue task is parked (waiting on CI, time, or an event)
    queue/claimedQueue worker lifecycle state
    on Nov 22, 2026
  13. dezren39 commented on Nov 22, 2026

    @dezren39
    MemberAuthor

    🤖 Agent note · quiet-window gate NOT met again — passive sampling only, no sweep run (task 14822, issue #7011)

    • Agent: fleet seat xaltha; task 14822 claimed from queue repo-health-code-pilot. Issue investigate: CPU/memory load over time + parallelism sweet spot on the sandbox VM #7011 OPEN, no hard-stop labels, no PRs attached. Per-cell measurement program remains complete (four corroborating windows); no synthetic sweep re-run, no load generated this shift.
    • New data point — sandbox VM, read directly from /proc, 2026-11-22 13:51:20–13:53:00Z (4 vCPU / 7934 MiB total; VM uptime 8,854 → 8,945 s, ~2h28m — no restart in the preceding hour):
      • Series 1 (7 samples, 15 s apart): load1 0.60, 0.61, 0.54, 0.50, 0.46, 0.36, 1.25. MemAvailable 1,101,352 → 945,180 kB (1.05 → 0.90 GiB), falling through the whole series.
      • Series 2 (7 overlapping independent samples + vmstat): load1 0.67, 0.59, 0.46, 0.50, 0.39, 1.18, 1.45. MemAvailable 1,092,544 → 906,696 kB (1.04 → 0.86 GiB), falling. SwapFree ~660–683 MB, stable, no swap-in/out. vmstat (2 s × 6): run queue 0–1, idle 62–93%, sys 2–9%, iowait 2–20%, steal 0–1%.
      • Both series corroborate each other (raw logs kept in the session, /tmp/load-series1.log and /tmp/load-series2.log).
    • Gate reading: uptime leg PASSES, load leg PASSES (sustained <4, mostly <1.5), memory leg FAILS decisively — MemAvailable crossed below the sweep design's 1 GiB abort threshold during the window and sits far below the 1.5 GiB admission gate now on main. A spot read minutes later recovered to ~1.17 GiB, still below the gate.
    • New sharpening of the memory finding: this is the first window where load is QUIET (load1 0.36–1.45) while memory still drains ~200 MB over two minutes. The MemAvailable gate catches what load alone would miss — again, and now at low load, so the pressure is not load-driven. No single hog: largest RSS is the hatch daemon at ~288 MB (down from 684 MB in the 2026-11-07 baseline); tailscaled ~35 MB; fleet daemons a few MB each. The drain is aggregate across lanes plus ~1.3 GB page cache — consistent with memory being the VM-level constraint while CPU is not the binding limit here.
    • Verification done this shift — one acceptance item is already met: the runbook defaults are on main. doc/agents/owner-preferences.md carries "Resource defaults (provisional, 2026-11-22; evidence: investigate: CPU/memory load over time + parallelism sweet spot on the sandbox VM #7011)": sandbox exec cell ≤2 CPU-bound workers, MemAvailable admission gate 1.5 GiB, laptop ≤ logical-core count — committed 2026-11-21 by Drewry Pope (e25c374d0 sandbox defaults, 9314e6dcc laptop guidance). The issue's "runbook/orchestration defaults updated" checkbox can be ticked on that basis.
    • Remaining acceptance unchanged: representative lane-level sweep + noisy-neighbor cliff (needs a genuinely quiet steady-state window — load <4 sustained AND MemAvailable at steady-state levels, not ~1 GiB — or a Drew-approved window; a single lane cannot vary fleet-wide lane concurrency alone), and the swarm delegation battle plan (draft in comment 6815969433) linked from goal goal_8c75ed164542 — the goal record lives in the PM system, not the repo, so that link needs a lane with goal access.
    • Resume condition: on park expiry, re-test the quiet-window gate passively; resume for the lane-level sweep only if the gate passes cleanly or a Drew-approved window exists.
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

    priority/normalOrdinary priority (the default)queue/parkedQueue task is parked (waiting on CI, time, or an event)source/creatorFiled by the new-issue-creator jobstatus/parkedDeliberately paused with a recorded resume conditiontask/triageQueue packet kind: verify, reproduce, and route this itemwork/assignedQueue worker lifecycle state

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions