Skip to content

Add large_instance_bias for Cassandra model#210

Draft
homatthew wants to merge 1 commit intoNetflix-Skunkworks:mainfrom
homatthew:mho/cassandra-large-instance-regret
Draft

Add large_instance_bias for Cassandra model#210
homatthew wants to merge 1 commit intoNetflix-Skunkworks:mainfrom
homatthew:mho/cassandra-large-instance-regret

Conversation

@homatthew
Copy link
Contributor

Summary

  • Adds large_instance_bias parameter that penalizes selecting the largest instance in a family
  • Reserves max-size instances for emergency scale-ups (e.g., avoid i3.4xlarge so it's available if we need to scale up quickly)
  • Max instance size per family is computed dynamically from hardware catalog at runtime

Implementation

  • Added large_instance_bias field to NflxCassandraArguments
  • Added helper _compute_max_instance_size_per_family() in capacity_planner.py
  • Applied rank penalty in plan_certain() sort key for largest instances
  • Annotated plans with is_largest_in_family metadata in cluster_params
  • Override regret() in Cassandra model to add regret for largest instances (supports both plan_certain() and plan() uncertainty planning paths)

Usage

planner.plan_certain(
    model_name="org.netflix.cassandra",
    region="us-east-1",
    desires=desires,
    extra_model_arguments={
        "large_instance_bias": 5.0,  # Adds rank penalty for largest instances
    },
)

Test plan

  • Added unit tests for argument acceptance and default values
  • Added test verifying largest instances get rank penalty
  • Added test verifying metadata stored in cluster_params
  • All 378 existing tests pass

🤖 Generated with Claude Code

Adds a `large_instance_bias` parameter that penalizes selecting the
largest instance in a family. This reserves max-size instances for
emergency scale-ups (e.g., avoid selecting i3.4xlarge so i3.4xlarge
is available if we need to scale up quickly).

Implementation:
- Added `large_instance_bias` field to NflxCassandraArguments
- Added helper to compute max instance size per family from hardware
- Applied rank penalty in plan_certain() sort key for largest instances
- Annotated plans with is_largest_in_family metadata in cluster_params
- Override regret() in Cassandra model to add regret for largest instances
  (supports both plan_certain() and plan() uncertainty planning paths)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
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