Elasticsearch & OpenSearch Cluster Sizing Calculator: Shard Capacity, 31GB JVM Heap & Nodes
Dimension your production Elasticsearch and OpenSearch clusters with architectural accuracy. Calculate recommended data nodes, primary and replica shards, storage requirements with Lucene indexing overhead (1.15x) and disk watermarks (85%), and optimal JVM Heap allocation strictly capped at 31 GB to preserve 32-bit Compressed OOPs while reserving remaining physical RAM for Lucene OS page cache.
1. Workload Ingestion & Retention Tiers
2. Node Hardware & Lucene Architecture
Production Sizing Architecture & Topology
Cluster Resource Breakdown & Memory Layout
Elasticsearch / OpenSearch Production Tiers Comparison
Frequently Asked Questions: Elasticsearch & OpenSearch Production Sizing
Why must JVM Heap NEVER exceed 31 GB in Elasticsearch and OpenSearch?
The HotSpot JVM uses 32-bit Compressed Ordinary Object Pointers (Compressed OOPs) when heap sizes remain below ~32 GB (in practice, 30.5 to 31 GB). This allows 64-bit JVMs to address up to 32 GB of memory using 32-bit references by shifting bits. If you assign 32 GB or more (e.g., 34 GB), Compressed OOPs are deactivated: every pointer instantly expands to 64 bits, wasting up to 40% of your heap purely on memory pointers, causing increased garbage collection pause times and degrading overall cluster performance.
What is the ideal shard size for logs, metrics, and search indices?
The official Elastic and OpenSearch recommendation is to maintain primary shard sizes between 30 GB and 50 GB for time-series logs and metrics, and between 10 GB and 30 GB for latency-sensitive full-text search applications. Shards smaller than 10 GB introduce severe oversharding overhead, wasting heap on segment metadata. Conversely, shards exceeding 65 GB lead to painful network rebalancing times, cluster recovery delays during node restarts, and slow index relocation.
How does Lucene use the remaining 50% of node RAM outside the JVM Heap?
Apache Lucene (the underlying storage engine) relies heavily on the operating system filesystem page cache via memory-mapped files (mmapfs). Storing doc values, term dictionaries, postings lists, and inverted indices in the OS kernel buffer cache eliminates costly disk I/O reads. If you starve the operating system of RAM by allocating 90% of memory to the JVM heap, search queries will experience severe latency spikes as the OS struggles to cache active index segments.
What happens when disk usage hits the Elasticsearch watermark thresholds?
Elasticsearch enforces three automatic safety watermarks: (1) Low Watermark (default 85%): new shard allocations are blocked from landing on the node; (2) High Watermark (default 90%): the cluster initiates automatic relocation of existing shards to other nodes; (3) Flood Stage Watermark (default 95%): the cluster enforces a read-only index block (index.blocks.read_only_allow_delete), halting all incoming write operations across all indices to prevent data corruption. Always provision storage with at least a 15-20% watermark buffer.
When should a cluster deploy dedicated Master-eligible nodes?
When a cluster grows beyond 5 or 6 data nodes, or when indexing throughput exceeds 100-200 GB/day, master node duties (maintaining the cluster state, index mappings, shard routing table, and node discovery) should be strictly separated from data nodes. Running collocated master/data nodes in large clusters risks split-brain or master dropouts if heavy query aggregations trigger high JVM garbage collection pauses on a data node. A dedicated master tier requires 3 nodes for Raft/quorum consensus with small resource profiles (e.g., 4-8 GB RAM and 2-4 GB Heap).