What are Elasticsearch hardware tuning best practices?
Answer
Key hardware and JVM tuning rules for Elasticsearch: Heap size — set the JVM heap to 50% of available RAM, with a maximum of 30–31 GB (above this, the JVM switches from compressed object pointers to full 64-bit pointers, wasting memory). The remaining 50% is used by the OS for the Lucene file system cache, which is critical for performance. Storage — use SSDs for hot data; spinning disks cause severe latency for random I/O. Disable swap — swapping Elasticsearch heap to disk causes extreme latency; use bootstrap.memory_lock: true and set ulimit -l unlimited. File descriptors — set to at least 65536. Virtual memory — set vm.max_map_count=262144 for Lucene's use of memory-mapped files.
Previous
How do script_score and function_score work for custom relevance?
Next
How do you optimize Elasticsearch indexing throughput?
More Elasticsearch Questions
View all →- Advanced What are cluster health states in Elasticsearch and what causes each?
- Advanced What is hot-warm-cold architecture in Elasticsearch?
- Advanced What is Index Lifecycle Management (ILM) in Elasticsearch?
- Advanced What is Cross-Cluster Replication (CCR) and Cross-Cluster Search (CCS)?
- Advanced How do script_score and function_score work for custom relevance?