Skip to content

feat(mvp-multinode): AWS dollar cost-model simulator for the run_demo arms - #443

Merged
zzylol merged 1 commit into
mainfrom
feat/cost-model-sim-v2
May 26, 2026
Merged

zzylol merged 1 commit into
mainfrom
feat/cost-model-sim-v2

Conversation

@zzylol

@zzylol zzylol commented May 26, 2026

Copy link
Copy Markdown
Contributor

Summary

Standalone Python package (deploy/mvp-multinode/cost_model/) that models the
per-component × per-resource cost of the six run_demo.sh arms and prices
them in USD/month via an editable AWS price book.

  • Resource model (model.py): per component (edge agent, data-plane,
    gorilla-merger, MinIO, Thanos query/store/compact, controller; raw_agent,
    serf_gateway, VM) × per resource (CPU vCPU, memory GB, egress GB/mo, EBS GB,
    S3 storage GB, S3 PUT/GET counts), as functions of workload + ASAP config.
  • AWS price book (pricing.py, single editable module): us-east-1 on-demand
    — EC2 decomposed to $0.0264/vCPU-hr + $0.0054/GB-RAM-hr (m6i.large reference),
    S3 $0.023/GB-mo + $0.005/1k PUT + $0.0004/1k GET, EBS gp3 $0.08/GB-mo, egress
    $0.09/GB internet / $0.01/GB cross-AZ.
  • Calibration (coefficients.py): every constant tagged measured/derived/
    design/assumed with a citation (FINDINGS wire sweep; the 0510 container-summary
    CPU/mem CSVs; holistic-compression intchunk 2.33× ratio + perf(asapedgeprocessor): accumulate intchunk cold parts per block_duration #442; processor
    config.go defaults). Assumed-pending-live coefficients carry # TODO(live).
  • CLI (simulator.py): arm comparison + per-arm breakdown + cold-format and
    sampling-p config sweeps. validate.py reproduces the FINDINGS bandwidth
    at 0.00% error.

Headline (MVP workload, us-east-1, 30-day retention)

arm wire Mbps total $/mo dominant term
b0 18.59 131.9 egress
b1 1.50 76.6 storage
b2 3.03 81.5 storage
b3 9.10 101.9 storage
asap 0.98 67.4 compute
asap-gzip 0.14 64.7 compute

ASAP is ~2× cheaper than raw b0 and beats every baseline: it spends more on edge
EC2 CPU (aggregation) but saves big on egress + S3/EBS storage. The cold-format
sweep shows intchunk+batched (#442) ~190k PUTs/mo ($1) vs the pre-#442 tiny-part
path ~11M PUTs/mo ($57) — the ~60× request saving in dollars.

Why standalone vs the control_plane optimizer cost model

Reuses the tco.rs price-book idea + mod.rs sketch-state sizes, but the Rust
optimizer cost is a planner-internal heuristic (abstract dollars, per-query
candidate ranking) and tco.rs is a 2-way before/after Grafana-Cloud TCO.
Neither models the deployed component set, the six arms, the cold PUT-count
economics, or calibrates to FINDINGS. This is an eval artifact next to the
run_demo harness, calibrated to the same runs.

Test plan

  • python3 -m cost_model.validate — reproduces FINDINGS Mbps at 0.00% error (exit 0)
  • python3 -m cost_model.simulator — prints the MVP arm comparison in $ + per-component breakdown
  • python3 -m cost_model.simulator --sweep cold / --sweep sampling
  • python3 -m cost_model.test_cost_model — 10/10 invariant tests pass
  • stdlib-only (tabulate/pytest optional, fallbacks verified absent on box)

🤖 Generated with Claude Code

… arms

Adds a standalone Python package under deploy/mvp-multinode/cost_model that
models per-component x per-resource usage (edge/backend CPU, memory, egress GB,
EBS GB, S3 storage GB + PUT/GET counts) for the six run_demo arms (b0/b1/b2/b3/
asap/asap-gzip) and prices them in USD/month via an editable us-east-1 AWS price
book (EC2 vCPU+RAM-hr, S3 storage + per-1k PUT/GET, EBS gp3, egress/cross-AZ).

Coefficients are calibrated to measured data (FINDINGS wire sweep; the
container-summary per-container CPU/mem CSVs) and tagged measured/derived/design/
assumed with citations. validate.py reproduces the FINDINGS bandwidth at 0.00%
error. simulator.py is a CLI: arm comparison, per-arm breakdown, and cold-format
+ sampling-p config sweeps. The cold path models intchunk-vs-fragment storage
and the batched-part PUT-count economics so the request-cost tradeoff shows in $.

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@zzylol
zzylol merged commit 1077f1d into main May 26, 2026
@zzylol
zzylol deleted the feat/cost-model-sim-v2 branch May 26, 2026 11:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant