Skip to content

Commit

Permalink
required cluster type parameter is now per zone
Browse files Browse the repository at this point in the history
  • Loading branch information
ramsrivatsak committed Oct 16, 2023
1 parent 0ce2064 commit 82dd4c5
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion service_capacity_modeling/models/org/netflix/cassandra.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ def _estimate_cassandra_requirement(
"""
# Keep half of the cores free for background work (compaction, backup, repair)
if max_cpu_utilization is not None and current_instance is not None and required_cluster_size is not None:
needed_cores = (current_instance.cpu * required_cluster_size) * (max_cpu_utilization / 20)
needed_cores = (current_instance.cpu * required_cluster_size * zones_per_region) * (max_cpu_utilization / 20)
else:
needed_cores = sqrt_staffed_cores(desires) * 2
# Keep half of the bandwidth available for backup
Expand Down
6 changes: 3 additions & 3 deletions tests/netflix/test_cassandra.py
Original file line number Diff line number Diff line change
Expand Up @@ -339,11 +339,11 @@ def test_plan_certain():
num_regions=4,
desires=worn_desire,
extra_model_arguments={
"required_cluster_size": 24,
"required_cluster_size": 8,
"max_cpu_utilization": 14.194801291058118,
},
)

lr_clusters = cap_plan[0].candidate_clusters.zonal[0]
assert lr_clusters.count == 24
assert lr_clusters.instance.cpu == 8
assert lr_clusters.count == 8
assert lr_clusters.instance.cpu == 16

0 comments on commit 82dd4c5

Please sign in to comment.