service-capacity-modeling 0.3.80__py3-none-any.whl → 0.3.81__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.
- service_capacity_modeling/models/org/netflix/__init__.py +2 -0
- service_capacity_modeling/models/org/netflix/control.py +146 -0
- {service_capacity_modeling-0.3.80.dist-info → service_capacity_modeling-0.3.81.dist-info}/METADATA +1 -1
- {service_capacity_modeling-0.3.80.dist-info → service_capacity_modeling-0.3.81.dist-info}/RECORD +8 -7
- {service_capacity_modeling-0.3.80.dist-info → service_capacity_modeling-0.3.81.dist-info}/WHEEL +0 -0
- {service_capacity_modeling-0.3.80.dist-info → service_capacity_modeling-0.3.81.dist-info}/entry_points.txt +0 -0
- {service_capacity_modeling-0.3.80.dist-info → service_capacity_modeling-0.3.81.dist-info}/licenses/LICENSE +0 -0
- {service_capacity_modeling-0.3.80.dist-info → service_capacity_modeling-0.3.81.dist-info}/top_level.txt +0 -0
|
@@ -3,6 +3,7 @@ from typing import Dict
|
|
|
3
3
|
|
|
4
4
|
from .aurora import nflx_aurora_capacity_model
|
|
5
5
|
from .cassandra import nflx_cassandra_capacity_model
|
|
6
|
+
from .control import nflx_control_capacity_model
|
|
6
7
|
from .counter import nflx_counter_capacity_model
|
|
7
8
|
from .crdb import nflx_cockroachdb_capacity_model
|
|
8
9
|
from .ddb import nflx_ddb_capacity_model
|
|
@@ -38,6 +39,7 @@ def models() -> Dict[str, Any]:
|
|
|
38
39
|
"org.netflix.elasticsearch.master": nflx_elasticsearch_master_capacity_model,
|
|
39
40
|
"org.netflix.elasticsearch.search": nflx_elasticsearch_search_capacity_model,
|
|
40
41
|
"org.netflix.entity": nflx_entity_capacity_model,
|
|
42
|
+
"org.netflix.control": nflx_control_capacity_model,
|
|
41
43
|
"org.netflix.cockroachdb": nflx_cockroachdb_capacity_model,
|
|
42
44
|
"org.netflix.aurora": nflx_aurora_capacity_model,
|
|
43
45
|
"org.netflix.postgres": nflx_postgres_capacity_model,
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
from typing import Any
|
|
2
|
+
from typing import Callable
|
|
3
|
+
from typing import Dict
|
|
4
|
+
from typing import Optional
|
|
5
|
+
from typing import Tuple
|
|
6
|
+
|
|
7
|
+
from .stateless_java import nflx_java_app_capacity_model
|
|
8
|
+
from service_capacity_modeling.interface import AccessConsistency
|
|
9
|
+
from service_capacity_modeling.interface import AccessPattern
|
|
10
|
+
from service_capacity_modeling.interface import CapacityDesires
|
|
11
|
+
from service_capacity_modeling.interface import CapacityPlan
|
|
12
|
+
from service_capacity_modeling.interface import Consistency
|
|
13
|
+
from service_capacity_modeling.interface import DataShape
|
|
14
|
+
from service_capacity_modeling.interface import Drive
|
|
15
|
+
from service_capacity_modeling.interface import FixedInterval
|
|
16
|
+
from service_capacity_modeling.interface import GlobalConsistency
|
|
17
|
+
from service_capacity_modeling.interface import Instance
|
|
18
|
+
from service_capacity_modeling.interface import Interval
|
|
19
|
+
from service_capacity_modeling.interface import QueryPattern
|
|
20
|
+
from service_capacity_modeling.interface import RegionContext
|
|
21
|
+
from service_capacity_modeling.models import CapacityModel
|
|
22
|
+
from service_capacity_modeling.interface import certain_int
|
|
23
|
+
|
|
24
|
+
|
|
25
|
+
class NflxControlCapacityModel(CapacityModel):
|
|
26
|
+
@staticmethod
|
|
27
|
+
def capacity_plan(
|
|
28
|
+
instance: Instance,
|
|
29
|
+
drive: Drive,
|
|
30
|
+
context: RegionContext,
|
|
31
|
+
desires: CapacityDesires,
|
|
32
|
+
extra_model_arguments: Dict[str, Any],
|
|
33
|
+
) -> Optional[CapacityPlan]:
|
|
34
|
+
# Control wants 20GiB root volumes
|
|
35
|
+
extra_model_arguments.setdefault("root_disk_gib", 20)
|
|
36
|
+
|
|
37
|
+
# Ensure Java app has enough memory to cache the whole dataset
|
|
38
|
+
modified_desires = desires.model_copy(deep=True)
|
|
39
|
+
if modified_desires.data_shape.estimated_state_size_gib:
|
|
40
|
+
# double buffer the cache
|
|
41
|
+
additional_mem = 2 * desires.data_shape.estimated_state_size_gib.mid
|
|
42
|
+
modified_desires.data_shape.reserved_instance_app_mem_gib += additional_mem
|
|
43
|
+
|
|
44
|
+
control_app = nflx_java_app_capacity_model.capacity_plan(
|
|
45
|
+
instance=instance,
|
|
46
|
+
drive=drive,
|
|
47
|
+
context=context,
|
|
48
|
+
desires=modified_desires,
|
|
49
|
+
extra_model_arguments=extra_model_arguments,
|
|
50
|
+
)
|
|
51
|
+
if control_app is None:
|
|
52
|
+
return None
|
|
53
|
+
|
|
54
|
+
for cluster in control_app.candidate_clusters.regional:
|
|
55
|
+
cluster.cluster_type = "dgwcontrol"
|
|
56
|
+
return control_app
|
|
57
|
+
|
|
58
|
+
@staticmethod
|
|
59
|
+
def description() -> str:
|
|
60
|
+
return "Netflix Control Model"
|
|
61
|
+
|
|
62
|
+
@staticmethod
|
|
63
|
+
def extra_model_arguments_schema() -> Dict[str, Any]:
|
|
64
|
+
return nflx_java_app_capacity_model.extra_model_arguments_schema()
|
|
65
|
+
|
|
66
|
+
@staticmethod
|
|
67
|
+
def compose_with(
|
|
68
|
+
user_desires: CapacityDesires, extra_model_arguments: Dict[str, Any]
|
|
69
|
+
) -> Tuple[Tuple[str, Callable[[CapacityDesires], CapacityDesires]], ...]:
|
|
70
|
+
def _modify_aurora_desires(
|
|
71
|
+
user_desires: CapacityDesires,
|
|
72
|
+
) -> CapacityDesires:
|
|
73
|
+
relaxed = user_desires.model_copy(deep=True)
|
|
74
|
+
|
|
75
|
+
# Aurora doesn't support tier 0, so downgrade to tier 1
|
|
76
|
+
if relaxed.service_tier == 0:
|
|
77
|
+
relaxed.service_tier = 1
|
|
78
|
+
|
|
79
|
+
# Control caches reads in memory, only writes go to Aurora
|
|
80
|
+
# Set read QPS to minimal since Aurora only handles writes
|
|
81
|
+
if relaxed.query_pattern.estimated_read_per_second:
|
|
82
|
+
relaxed.query_pattern.estimated_read_per_second = certain_int(1)
|
|
83
|
+
|
|
84
|
+
return relaxed
|
|
85
|
+
|
|
86
|
+
return (("org.netflix.aurora", _modify_aurora_desires),)
|
|
87
|
+
|
|
88
|
+
@staticmethod
|
|
89
|
+
def default_desires(
|
|
90
|
+
user_desires: CapacityDesires, extra_model_arguments: Dict[str, Any]
|
|
91
|
+
) -> CapacityDesires:
|
|
92
|
+
return CapacityDesires(
|
|
93
|
+
query_pattern=QueryPattern(
|
|
94
|
+
access_pattern=AccessPattern.latency,
|
|
95
|
+
access_consistency=GlobalConsistency(
|
|
96
|
+
same_region=Consistency(
|
|
97
|
+
target_consistency=AccessConsistency.read_your_writes,
|
|
98
|
+
),
|
|
99
|
+
cross_region=Consistency(
|
|
100
|
+
target_consistency=AccessConsistency.eventual,
|
|
101
|
+
),
|
|
102
|
+
),
|
|
103
|
+
estimated_mean_read_size_bytes=Interval(
|
|
104
|
+
low=128, mid=1024, high=65536, confidence=0.95
|
|
105
|
+
),
|
|
106
|
+
estimated_mean_write_size_bytes=Interval(
|
|
107
|
+
low=128, mid=1024, high=65536, confidence=0.95
|
|
108
|
+
),
|
|
109
|
+
estimated_mean_read_latency_ms=Interval(
|
|
110
|
+
low=0.2, mid=1, high=2, confidence=0.98
|
|
111
|
+
),
|
|
112
|
+
estimated_mean_write_latency_ms=Interval(
|
|
113
|
+
low=0.2, mid=1, high=2, confidence=0.98
|
|
114
|
+
),
|
|
115
|
+
# "Single digit milliseconds SLO"
|
|
116
|
+
read_latency_slo_ms=FixedInterval(
|
|
117
|
+
minimum_value=0.2,
|
|
118
|
+
maximum_value=10,
|
|
119
|
+
low=1,
|
|
120
|
+
mid=3,
|
|
121
|
+
high=6,
|
|
122
|
+
confidence=0.98,
|
|
123
|
+
),
|
|
124
|
+
write_latency_slo_ms=FixedInterval(
|
|
125
|
+
minimum_value=0.2,
|
|
126
|
+
maximum_value=10,
|
|
127
|
+
low=0.4,
|
|
128
|
+
mid=2,
|
|
129
|
+
high=5,
|
|
130
|
+
confidence=0.98,
|
|
131
|
+
),
|
|
132
|
+
),
|
|
133
|
+
# Most Control clusters are small
|
|
134
|
+
data_shape=DataShape(
|
|
135
|
+
estimated_state_size_gib=Interval(
|
|
136
|
+
low=0.1, mid=1, high=10, confidence=0.98
|
|
137
|
+
),
|
|
138
|
+
estimated_state_item_count=Interval(
|
|
139
|
+
low=100000, mid=1000000, high=10000000, confidence=0.98
|
|
140
|
+
),
|
|
141
|
+
reserved_instance_app_mem_gib=8,
|
|
142
|
+
),
|
|
143
|
+
)
|
|
144
|
+
|
|
145
|
+
|
|
146
|
+
nflx_control_capacity_model = NflxControlCapacityModel()
|
{service_capacity_modeling-0.3.80.dist-info → service_capacity_modeling-0.3.81.dist-info}/RECORD
RENAMED
|
@@ -50,9 +50,10 @@ service_capacity_modeling/models/common.py,sha256=Bs-G1eHrb9qmS9qEWzx0rzN9QjQ419
|
|
|
50
50
|
service_capacity_modeling/models/headroom_strategy.py,sha256=rGo_d7nxkQDjx0_hIAXKKZAWnQDBtqZhc0eTMouVh8s,682
|
|
51
51
|
service_capacity_modeling/models/utils.py,sha256=WosEEg4o1_WSbTb5mL-M1v8JuWJgvS2oWvnDS3qNz3k,2662
|
|
52
52
|
service_capacity_modeling/models/org/__init__.py,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
|
|
53
|
-
service_capacity_modeling/models/org/netflix/__init__.py,sha256=
|
|
53
|
+
service_capacity_modeling/models/org/netflix/__init__.py,sha256=2Ld2NPxiO3vbYtOMqHtrV4f1nEH390Hoxqo3I5NbBDI,2553
|
|
54
54
|
service_capacity_modeling/models/org/netflix/aurora.py,sha256=Js33ZjxCtt34HiDPsWRT9mjKCAsnnCo9du15QArVFMo,13073
|
|
55
55
|
service_capacity_modeling/models/org/netflix/cassandra.py,sha256=Fp37bHtWRJctJYYJhW78YbLeFXoX26QxREP_BMEItNE,39003
|
|
56
|
+
service_capacity_modeling/models/org/netflix/control.py,sha256=wkJnqG7Nn7kQNcKEMzl9LFlA9xTAji2wYxL011VAKPI,5762
|
|
56
57
|
service_capacity_modeling/models/org/netflix/counter.py,sha256=XopKlNMdvO5EbxAggn-KW_q7L3aKtXLXbry4ocl6i5Q,10494
|
|
57
58
|
service_capacity_modeling/models/org/netflix/crdb.py,sha256=iW7tyG8jpXhHIdXrw3DPYSHRAknPN42MlCRLJO4o9C8,20826
|
|
58
59
|
service_capacity_modeling/models/org/netflix/ddb.py,sha256=9qRiuTqWev9zbYFFzewyowU7M41uALsuLklYx20yAXw,26502
|
|
@@ -75,9 +76,9 @@ service_capacity_modeling/tools/auto_shape.py,sha256=Jx9H2ay9-H_kUDjtB141owQNxGF
|
|
|
75
76
|
service_capacity_modeling/tools/fetch_pricing.py,sha256=Qp-XMymkY1dvtyS51RufmEpfgOHv-IQ-XyzS8wp2-qM,4021
|
|
76
77
|
service_capacity_modeling/tools/generate_missing.py,sha256=F7YqvMJAV4nZc20GNrlIsnQSF8_77sLgwYZqc5k4LDg,3099
|
|
77
78
|
service_capacity_modeling/tools/instance_families.py,sha256=e5RuYkCLUITvsAazDH12B6KjX_PaBsv6Ne3mj0HK_sQ,9223
|
|
78
|
-
service_capacity_modeling-0.3.
|
|
79
|
-
service_capacity_modeling-0.3.
|
|
80
|
-
service_capacity_modeling-0.3.
|
|
81
|
-
service_capacity_modeling-0.3.
|
|
82
|
-
service_capacity_modeling-0.3.
|
|
83
|
-
service_capacity_modeling-0.3.
|
|
79
|
+
service_capacity_modeling-0.3.81.dist-info/licenses/LICENSE,sha256=nl_Lt5v9VvJ-5lWJDT4ddKAG-VZ-2IaLmbzpgYDz2hU,11343
|
|
80
|
+
service_capacity_modeling-0.3.81.dist-info/METADATA,sha256=g1x4TGRElgvLbJiQZ_D_H5wN-Mhiynf4nPhOEVbkIEg,10361
|
|
81
|
+
service_capacity_modeling-0.3.81.dist-info/WHEEL,sha256=_zCd3N1l69ArxyTb8rzEoP9TpbYXkqRFSNOD5OuxnTs,91
|
|
82
|
+
service_capacity_modeling-0.3.81.dist-info/entry_points.txt,sha256=ZsjzpG5SomWpT1zCE19n1uSXKH2gTI_yc33sdl0vmJg,146
|
|
83
|
+
service_capacity_modeling-0.3.81.dist-info/top_level.txt,sha256=H8XjTCLgR3enHq5t3bIbxt9SeUkUT8HT_SDv2dgIT_A,26
|
|
84
|
+
service_capacity_modeling-0.3.81.dist-info/RECORD,,
|
{service_capacity_modeling-0.3.80.dist-info → service_capacity_modeling-0.3.81.dist-info}/WHEEL
RENAMED
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|