RousselTMLEARNING

Article · Elasticsearch: from discovery to expertise

Performance and capacity planning

1. Shards #

The first factor.

Sizing #

Recommended shard size
  • Aim for 10 to 50 GB per primary shard for logs; rollover by max_primary_shard_size guarantees it.
  • Too many small shards: heavy cluster state, wasted memory and queries. Default limit: 1,000 shards per node (cluster.max_shards_per_node).
  • Number of primaries for a high-throughput index: around the number of hot data nodes, to spread writes.

2. Memory and indexing #

The settings that matter.

Settings #

SettingRecommendation
JVM heap≤ 50% of RAM (the rest is used by the file system cache, essential to Lucene) and under ~31 GB
refresh_interval30 s or more for logs (1 s by default): fewer segments, faster indexing
Initial loadnumber_of_replicas: 0 and refresh_interval: -1, then restore
Bulk5 to 15 MB per request, several clients in parallel, watch for rejections
FieldsNo unnecessary text fields; index: false on fields never searched
DisksLocal SSDs for the hot tier

3. Measuring #

Capacity planning.

Benchmark #

pip install esrally
esrally race --track=http_logs --target-hosts=es01:9200 --pipeline=benchmark-only \
  --client-options="use_ssl:true,verify_certs:false,basic_auth_user:'elastic',basic_auth_password:'$ES_PASSWORD'"
  1. Measure indexing throughput and search latency on one node with your data (or a similar Rally track).
  2. Derive the number of hot nodes for the target throughput, with a 30% margin.
  3. Compute storage: daily volume × (1 + replicas) × retention per tier × index factor (often 1.1 to 1.5 compared with raw data).
  4. Revalidate at each major version or mapping change.
Common mistake: Never run a Rally benchmark on a production cluster: it creates its own indices and saturates the cluster.

📄 Elasticsearch performance and capacity planning: shards, heap, indexing and benchmarks →

My progress

  • ⏱ Estimated time : ≈ 3 min

Sign in to track your progress and take notes. Sign in

⭐ Rate this lesson

5.0 initial rating from the teaching team

Sign in to rate this lesson →

💬 Recent discussions about this course

Ask a question about this lesson →See all discussions about this course

Course Glossary

RBAC (Role-Based Access Control)

An access control method where permissions are assigned to specific roles (e.g., admin, reader) rather than directly to individual users.

Authentication

The process of verifying the identity of a user or system (e.g., login/password, tokens, biometrics).

Authorization

The process that occurs after authentication to determine if the entity has the necessary rights and privileges to access a resource.

API Key

A unique alphanumeric code used to identify, authenticate, and authorize access to an Application Programming Interface (API).

Architecture

The overall structural design of an IT system, defining its various components, their relationships, and the principles guiding its evolution.

Repository

A centralized storage location. This can refer to a source code repository (e.g., Git) or an artifact and binary repository (e.g., Harbor, Nexus, Arti...

Elasticsearch

A distributed, RESTful search and analytics engine capable of addressing a growing number of use cases, built on Apache Lucene.

Recommended Articles

Elasticsearch monitoring and troubleshooting: health, unassigned shards, JVM, hot threads and slow logs

Diagnose an Elasticsearch cluster: cluster health and CAT APIs, unassigned shards and allocation ...

Elasticsearch best practices: mappings, shards, lifecycle and operations

Elasticsearch best practices: shard sizing, explicit mappings, templates, ILM, JVM memory, securi...

OpenSearch performance, sizing and troubleshooting

Sizing and optimizing an OpenSearch cluster: shard size and count, bulk indexing, refresh and tra...

Elasticsearch distributed architecture: node roles, shards, replicas and allocation

Understand how Elasticsearch works as a distributed system: node roles, master nodes and quorum, ...

The OpenSearch cluster in depth: nodes, shards and replication

Understanding how an OpenSearch cluster works inside: node roles, cluster manager election, shard...

Cross-cluster search and cross-cluster replication: multi-cluster Elasticsearch architectures

Design multi-cluster Elasticsearch architectures: remote clusters, cross-cluster search, cross-cl...

Grafana Loki vs Elasticsearch: the battle of log storage

A comparison between Loki, the Prometheus-inspired log system, and Elasticsearch, the reference f...

Automation and infrastructure as code for Elasticsearch: API, Terraform, Ansible and CI/CD

Automate Elasticsearch administration: REST API and clients, the elasticstack Terraform provider ...

OpenSearch: concepts, architecture and differences with Elasticsearch

Understanding OpenSearch: project origin, license, differences with Elasticsearch, indexes, shard...

Support us

♥ SUPPORT US

Support RousselTM Learning

Courses, articles, labs and certificates stay free with no intrusive ads. A voluntary contribution, of any amount you choose, pays for hosting, lab environments and new content.

Contribute with PayPal Any amount · card or PayPal accountLearn more
QR code PayPal
Or scan this QR code with your phone

Thank you, every contribution counts!