Skip to content

Add drive cost to stateless Java app clusters#215

Merged
homatthew merged 1 commit intomainfrom
mho/drive-cost-fix
Jan 27, 2026
Merged

Add drive cost to stateless Java app clusters#215
homatthew merged 1 commit intomainfrom
mho/drive-cost-fix

Conversation

@homatthew
Copy link
Contributor

Summary

The root EBS volume (gp2) attached to Java app instances was not being included in the cluster's annual_cost. This caused underreporting of ~$949/year for the dgwkv layer in Key-Value deployments.

Fix

After compute_stateless_region(), add the attached drive cost to the cluster's annual_cost:

# Add drive cost (root volume is EBS and costs money)
drive_cost = sum(d.annual_cost for d in attached_drives) * cluster.count
cluster.annual_cost = cluster.annual_cost + drive_cost

Impact

~0.9% cost increase for Java app clusters:

Metric Before After
nflx-java-app.regional-clusters $107,484 $108,433
kv_with_cache total $362,408 $363,357

Test plan

  • tox -e pre-commit passes
  • Baseline updated with correct costs

🤖 Generated with Claude Code

The root EBS volume (gp2) attached to Java app instances was not being
included in the cluster's annual_cost. This caused underreporting of
~$949/year for the dgwkv layer in Key-Value deployments.

Fix: After compute_stateless_region(), add the attached drive cost to
the cluster's annual_cost.

Impact: ~0.9% cost increase for Java app clusters.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
],
"cluster_type": "dgwkv",
"count": 78,
"count": 39,
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All things equal, we are now preferring less instances to have slightly less drive cost

@homatthew homatthew merged commit 2b66402 into main Jan 27, 2026
4 checks passed
@homatthew homatthew deleted the mho/drive-cost-fix branch February 18, 2026 17:39
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

Comments