feat(mvp-multinode): AWS dollar cost-model simulator for the run_demo arms - #443
Merged
Merged
Conversation
… 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>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Standalone Python package (
deploy/mvp-multinode/cost_model/) that models theper-component × per-resource cost of the six
run_demo.sharms and pricesthem in USD/month via an editable AWS price book.
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.
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.
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).simulator.py): arm comparison + per-arm breakdown + cold-format andsampling-p config sweeps.
validate.pyreproduces the FINDINGS bandwidthat 0.00% error.
Headline (MVP workload, us-east-1, 30-day retention)
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.rsprice-book idea +mod.rssketch-state sizes, but the Rustoptimizer cost is a planner-internal heuristic (abstract dollars, per-query
candidate ranking) and
tco.rsis 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 breakdownpython3 -m cost_model.simulator --sweep cold/--sweep samplingpython3 -m cost_model.test_cost_model— 10/10 invariant tests pass🤖 Generated with Claude Code