Skip to content

Instantly share code, notes, and snippets.

@ernestas-poskus
Created January 10, 2018 10:46
Show Gist options
  • Save ernestas-poskus/28345869380cb6cdf63a790aa129ce64 to your computer and use it in GitHub Desktop.
Save ernestas-poskus/28345869380cb6cdf63a790aa129ce64 to your computer and use it in GitHub Desktop.
Elasticsearch capacity planner
DATA_NODES_COUNT = 96
DATA_NODE_PER_SERVER = 4
SHARDS_PER_DATA_NODE = 2 * 1000 * 1000
REPLICA_COUNT = 2
def servers(s, r = REPLICA_COUNT)
s * r + s
end
s = 4
puts 'Elasticsearch capacity planner'
while servers(s) <= DATA_NODES_COUNT
ss = servers(s)
puts "#{ss / DATA_NODE_PER_SERVER} physical servers lets #{ss} data with total possible capacity - #{SHARDS_PER_DATA_NODE * s}"
s += 4
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment