service-capacity-modeling 0.3.56__py3-none-any.whl → 0.3.58__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -206,8 +206,34 @@ def _estimate_cassandra_requirement( # pylint: disable=too-many-positional-argu
206
206
  )
207
207
  rps_working_set = min(1.0, disk_rps / max_rps_to_disk)
208
208
 
209
- if memory_preserve:
210
- needed_memory = capacity_requirement.mem_gib.mid
209
+ # Cassandra can defer writes either by buffering in memory or by
210
+ # waiting longer before recompacting (the min-threshold on the
211
+ # L0 compactions or STCS compactions)
212
+ min_threshold = 4
213
+ write_buffer_gib = _write_buffer_gib_zone(
214
+ desires=desires,
215
+ zones_per_region=zones_per_region,
216
+ flushes_before_compaction=min_threshold,
217
+ )
218
+
219
+ while write_buffer_gib > 12 and min_threshold < 16:
220
+ min_threshold *= 2
221
+ write_buffer_gib = _write_buffer_gib_zone(
222
+ desires=desires,
223
+ zones_per_region=zones_per_region,
224
+ flushes_before_compaction=min_threshold,
225
+ )
226
+
227
+ if current_capacity and current_capacity.cluster_instance and memory_preserve:
228
+ # remove base memory and heap from per node ram and then
229
+ # multiply by number of nodes in a zone to compute the zonal requirement.
230
+ reserve_memory = _get_base_memory(desires) + _cass_heap(
231
+ current_capacity.cluster_instance.ram_gib
232
+ )
233
+ needed_memory = (
234
+ current_capacity.cluster_instance.ram_gib - reserve_memory
235
+ ) * current_capacity.cluster_instance_count.mid
236
+ write_buffer_gib = 0
211
237
  else:
212
238
  # If disk RPS will be smaller than our target because there are no
213
239
  # reads, we don't need to hold as much data in memory.
@@ -227,24 +253,6 @@ def _estimate_cassandra_requirement( # pylint: disable=too-many-positional-argu
227
253
  working_set,
228
254
  )
229
255
 
230
- # Cassandra can defer writes either by buffering in memory or by
231
- # waiting longer before recompacting (the min-threshold on the
232
- # L0 compactions or STCS compactions)
233
- min_threshold = 4
234
- write_buffer_gib = _write_buffer_gib_zone(
235
- desires=desires,
236
- zones_per_region=zones_per_region,
237
- flushes_before_compaction=min_threshold,
238
- )
239
-
240
- while write_buffer_gib > 12 and min_threshold < 16:
241
- min_threshold *= 2
242
- write_buffer_gib = _write_buffer_gib_zone(
243
- desires=desires,
244
- zones_per_region=zones_per_region,
245
- flushes_before_compaction=min_threshold,
246
- )
247
-
248
256
  return CapacityRequirement(
249
257
  requirement_type="cassandra-zonal",
250
258
  reference_shape=reference_shape,
@@ -358,10 +366,7 @@ def _estimate_cassandra_cluster_zonal( # pylint: disable=too-many-positional-ar
358
366
  if desires.service_tier <= 1:
359
367
  min_count = 2
360
368
 
361
- base_mem = (
362
- desires.data_shape.reserved_instance_app_mem_gib
363
- + desires.data_shape.reserved_instance_system_mem_gib
364
- )
369
+ base_mem = _get_base_memory(desires)
365
370
 
366
371
  heap_fn = _cass_heap_for_write_buffer(
367
372
  instance=instance,
@@ -484,6 +489,13 @@ def _cass_io_per_read(node_size_gib, sstable_size_mb=160):
484
489
  return 2 * levels
485
490
 
486
491
 
492
+ def _get_base_memory(desires: CapacityDesires):
493
+ return (
494
+ desires.data_shape.reserved_instance_app_mem_gib
495
+ + desires.data_shape.reserved_instance_system_mem_gib
496
+ )
497
+
498
+
487
499
  def _cass_heap_for_write_buffer(
488
500
  instance: Instance,
489
501
  write_buffer_gib: float,
@@ -40,7 +40,7 @@ def build_command(family: str, params: Dict[str, Any], output_path: Path) -> lis
40
40
  return cmd
41
41
 
42
42
 
43
- def main(debug: bool = True, execute: bool = False):
43
+ def main(debug: bool = True, execute: bool = False, force: bool = False):
44
44
  expected_path = (
45
45
  Path(__file__).resolve().parent.parent / "hardware/profiles/shapes/aws"
46
46
  )
@@ -51,7 +51,7 @@ def main(debug: bool = True, execute: bool = False):
51
51
  missing_families = {
52
52
  family: params
53
53
  for family, params in INSTANCE_TYPES.items()
54
- if not (expected_path / f"auto_{family}.json").exists()
54
+ if force or not (expected_path / f"auto_{family}.json").exists()
55
55
  }
56
56
 
57
57
  if not missing_families:
@@ -87,5 +87,6 @@ if __name__ == "__main__":
87
87
  # Parse arguments to determine whether to execute commands
88
88
  execute_mode = "--execute" in sys.argv
89
89
  debug_mode = "--debug" in sys.argv or not execute_mode
90
+ force_mode = "--force" in sys.argv
90
91
 
91
- main(debug=debug_mode, execute=execute_mode)
92
+ main(debug=debug_mode, execute=execute_mode, force=force_mode)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: service-capacity-modeling
3
- Version: 0.3.56
3
+ Version: 0.3.58
4
4
  Summary: Contains utilities for modeling capacity for pluggable workloads
5
5
  Author: Joseph Lynch
6
6
  Author-email: josephl@netflix.com
@@ -46,7 +46,7 @@ service_capacity_modeling/models/utils.py,sha256=0F__wz9KAGhPIQfvNp-FTtTANW6-sO4
46
46
  service_capacity_modeling/models/org/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
47
47
  service_capacity_modeling/models/org/netflix/__init__.py,sha256=m7IaQbo85NEbDvfoPJREIznpzg0YHTCrKP5C1GvnOYM,2378
48
48
  service_capacity_modeling/models/org/netflix/aurora.py,sha256=Mi9zd48k64GkKIjAs3J1S2qThguNvyWIy2dUmhwrVhc,12883
49
- service_capacity_modeling/models/org/netflix/cassandra.py,sha256=mglxXmEFF_ge8_HD02mHuFp4leLEA4JF3xDAS1h7bW4,32896
49
+ service_capacity_modeling/models/org/netflix/cassandra.py,sha256=47R0jgdyL1kxekJ-2UvW-GC018qYG-iU_c8SZzcHQZk,33443
50
50
  service_capacity_modeling/models/org/netflix/counter.py,sha256=hOVRRCgCPU-A5TdLKQXc_mWTQpkKOWRNjOeECdDP7kA,9205
51
51
  service_capacity_modeling/models/org/netflix/crdb.py,sha256=2rD4Io0yT7o0NR4lNferXXOSTDe0SkT1LbSChvNgRrQ,19698
52
52
  service_capacity_modeling/models/org/netflix/ddb.py,sha256=2jxMFz31xckJvymvVlu1yWm0X4dGYlqxDo0bftU1B9M,26307
@@ -67,11 +67,11 @@ service_capacity_modeling/models/org/netflix/zookeeper.py,sha256=buYv400R8_KCF4Y
67
67
  service_capacity_modeling/tools/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
68
68
  service_capacity_modeling/tools/auto_shape.py,sha256=Rk5Fjrw2susVL8It_J2KUADoMGBN6N394fcThdl62Ng,14672
69
69
  service_capacity_modeling/tools/fetch_pricing.py,sha256=SHOtFaPr61op2bnY9i_g_1-d-Nz2rV8c7Jwsye2R49s,3763
70
- service_capacity_modeling/tools/generate_missing.py,sha256=WN7Y0iPjelJu9d2Yq5dcu_EBIQPX2VxKgOou4NMNOM4,2860
70
+ service_capacity_modeling/tools/generate_missing.py,sha256=uvr9fQanx3bm4KTneH-x7EOQvO7cVV0i9gdQvArPCuY,2947
71
71
  service_capacity_modeling/tools/instance_families.py,sha256=e9JWSIdljSmHI8Nb2MI5Ld9JqQ7WdOtPtV7g3oR7ZiU,7764
72
- service_capacity_modeling-0.3.56.dist-info/licenses/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
73
- service_capacity_modeling-0.3.56.dist-info/METADATA,sha256=5AqRh2xiWGZihb6rzg_KzuICQgA7Gd_Xd5Q15f0SW38,9590
74
- service_capacity_modeling-0.3.56.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
75
- service_capacity_modeling-0.3.56.dist-info/entry_points.txt,sha256=ZsjzpG5SomWpT1zCE19n1uSXKH2gTI_yc33sdl0vmJg,146
76
- service_capacity_modeling-0.3.56.dist-info/top_level.txt,sha256=H8XjTCLgR3enHq5t3bIbxt9SeUkUT8HT_SDv2dgIT_A,26
77
- service_capacity_modeling-0.3.56.dist-info/RECORD,,
72
+ service_capacity_modeling-0.3.58.dist-info/licenses/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
73
+ service_capacity_modeling-0.3.58.dist-info/METADATA,sha256=I7I4UO18FYRZ-LP5hGDhVFP_4w_zQrEKKh-WphQroKE,9590
74
+ service_capacity_modeling-0.3.58.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
75
+ service_capacity_modeling-0.3.58.dist-info/entry_points.txt,sha256=ZsjzpG5SomWpT1zCE19n1uSXKH2gTI_yc33sdl0vmJg,146
76
+ service_capacity_modeling-0.3.58.dist-info/top_level.txt,sha256=H8XjTCLgR3enHq5t3bIbxt9SeUkUT8HT_SDv2dgIT_A,26
77
+ service_capacity_modeling-0.3.58.dist-info/RECORD,,