Created
August 29, 2021 09:12
-
-
Save ohanetz/319268506b3109aca00c1e5da6407f05 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
from math import ceil | |
############################ | |
# CONSTANTS - DO NOT ALTER # | |
############################ | |
DISK_WATERMARK = 0.15 | |
DISK_MARGIN_OF_ERROR = 0.1 | |
HOT_ZONE_MEMORY_DATA_RATIO = 30 | |
WARM_ZONE_MEMORY_DATA_RATIO = 160 | |
############################## | |
# CLUSTER CONFIG - MAY ALTER # | |
############################## | |
CLUSTER_NODE_MEMORY = 64 | |
HOT_ZONE_REPLICAS = 1 | |
WARM_ZONE_REPLICAS = 1 | |
############################## | |
# USER CONFIG - SHOULD ALTER # | |
############################## | |
DATA_PER_DAY = 0 | |
HOT_ZONE_DAYS = 0 | |
WARM_ZONE_DAYS = 0 | |
############################### | |
# CALCULATIONS - DO NOT ALTER # | |
############################### | |
HOT_ZONE_TOTAL_DATA = HOT_ZONE_DAYS * DATA_PER_DAY * (HOT_ZONE_REPLICAS + 1) | |
HOT_ZONE_TOTAL_STORAGE = HOT_ZONE_TOTAL_DATA * (1 + DISK_WATERMARK + DISK_MARGIN_OF_ERROR) | |
HOT_ZONE_NODES = ceil(HOT_ZONE_TOTAL_STORAGE / CLUSTER_NODE_MEMORY / HOT_ZONE_MEMORY_DATA_RATIO) + 1 | |
WARM_ZONE_TOTAL_DATA = WARM_ZONE_DAYS * DATA_PER_DAY * (WARM_ZONE_REPLICAS + 1) | |
WARM_ZONE_TOTAL_STORAGE = WARM_ZONE_TOTAL_DATA * (1 + DISK_WATERMARK + DISK_MARGIN_OF_ERROR) | |
WARM_ZONE_NODES = ceil(WARM_ZONE_TOTAL_STORAGE / CLUSTER_NODE_MEMORY / WARM_ZONE_MEMORY_DATA_RATIO) + 1 | |
print('Hot Zone Data:', HOT_ZONE_TOTAL_DATA) | |
print('Hot Zone Storage:', HOT_ZONE_TOTAL_STORAGE) | |
print('Hot Zone Nodes:', HOT_ZONE_NODES) | |
print() | |
print('Warm Zone Data:', WARM_ZONE_TOTAL_DATA) | |
print('Warm Zone Storage:', WARM_ZONE_TOTAL_STORAGE) | |
print('Warm Zone Nodes:', WARM_ZONE_NODES) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment