Skip to content
/
Suscribirse Subscribe

Detrás del telón hay sistemas, no magia. Arquitectura de software, IA y computación de bajo nivel para las trincheras de producción.

Behind the curtain there are systems, not magic. Software architecture, AI, and systems engineering from the production trenches.

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

Uncompressed JSON logs, metrics or document volume
Fast NVMe storage for active writes & frequent searches
Read-only historical data (set 0 if single tier)
1 replica provides N+1 node fault tolerance

2. Node Hardware & Lucene Architecture

Recommended: 30-50 GB for logs/search
50% allocated to JVM Heap, capped at 31 GB
Local NVMe SSD recommended for primary ingest
Cluster locks writes at high watermark (85-90%)

Production Sizing Architecture & Topology

Recommended Data Nodes
3
Quorum HA requirement
Total NVMe Storage Required
10.0 TB
Includes 1.15x Lucene & 15% Watermark
Total Active Shards
214
Primaries + Replicas
JVM Heap Allocation
31 GB
✓ 32-bit Compressed OOPs Active

Cluster Resource Breakdown & Memory Layout

Primary Data Volume (Retention): 4.255 GB
Total Data Volume with Replicas: 8.510 GB
Raw NVMe Needed (Watermark Buffer): 10.012 GB
Primary Shards Count: 107
Average Shards per Data Node: 72 / nodo
Shard Density Ratio: 2,3 shards/GB
OS Lucene Page Cache (mmapfs): 33 GB / nodo
Dedicated Master Nodes: Collocated (3 Master-eligible)
Balanced Production Architecture Optimal JVM Heap and shard distribution calculated.

Elasticsearch / OpenSearch Production Tiers Comparison

Architecture Tier Daily Ingestion Topology JVM Heap Config Active Shards Target Workload
Dev / POC Single-Node < 20 GB/día 1 nodo 8 - 16 GB < 20 shards Local development, sandbox, CI/CD
Production Small Cluster 20 - 150 GB/día 3 nodos datos 31 GB 50 - 250 shards Application logs, microservice metrics
Medium Enterprise Cluster 150 - 600 GB/día 6 datos + 3 masters 31 GB / 4 GB master 300 - 800 shards Centralized security SIEM, full-text e-commerce
Multi-Tier Hot/Warm/Frozen > 1 TB/día Hot/Warm/Frozen + 3 masters 31 GB Hot / 16 GB Warm ILM / ISM automático Petabyte-scale observability, multi-tenant SaaS

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).

Syncroma Engineering Utilities // Elasticsearch & OpenSearch Production Sizing Engine
Suscribirse Subscribe