Autoscaling in Elasticsearch

Autoscaling in Elasticsearch

How Elasticsearch works out, on its own, how much storage and memory your cluster needs next, and how the platform running your nodes grows the cluster before you run out of room.

Imagine an online shop that stores every product, order and customer search in an Elasticsearch cluster. For months, the cluster runs happily with plenty of free disk space. Then a big holiday sale begins. Orders, logs and events pour in at ten times the usual speed. Disks fill up faster than anyone expected. At some point, Elasticsearch protects itself by refusing new writes. Search still works, but new orders cannot be indexed, and the team spends the middle of the night adding servers by hand.

Now imagine a second company that did the opposite. Fearing that very night, they bought servers big enough for the busiest day of the year. On ordinary days, most of that hardware sits idle, and the monthly bill is far larger than it needs to be. One team ran out of room. The other paid for room it rarely used.

Autoscaling is Elasticsearch’s answer to both problems. It watches how much room your data and workloads need, calculates how much capacity the cluster should have, and lets the platform running your nodes add or remove capacity to match. This guide explains autoscaling from zero. Every new word is explained the first time it appears, and each idea builds on the last. By the end, you will know what autoscaling is, how it decides, what it can and cannot do, and how to use it safely.

1What Is Autoscaling in Elasticsearch?

We begin with the everyday meaning of the word, and then look at the special way Elasticsearch splits the job into two parts.

Scaling in Plain Words

A cluster is a group of Elasticsearch servers, called nodes, that work together to store and search data. Capacity is how much work and data the cluster can hold, measured in things like disk space and memory. Scaling means changing that capacity: making it larger when the workload grows, or smaller when it shrinks. Autoscaling means the changes happen automatically, without a person watching graphs and clicking buttons.

Two Jobs, Two Owners

In Elasticsearch, autoscaling is really two jobs. The first job is deciding how much capacity is needed. Elasticsearch itself does this. It knows better than anyone how many shards it holds, how full its disks are, how fast data is arriving, and how much memory its machine learning jobs need. From this knowledge, it produces a recommendation: “for this group of nodes, you need at least this much storage and this much memory.”

The second job is acting on that recommendation: starting new servers, making servers larger, or removing servers. Elasticsearch does not do this part directly, because it does not own the machines. Instead, a separate program called an orchestrator, such as Elastic Cloud or the Kubernetes operator for Elastic, reads the recommendation and changes the cluster to match.

Everyday Analogy

Think of a busy restaurant with a staff planner and a staffing agency. The planner watches bookings, the size of the queue and the time of night, and writes on a board: “Tonight we need six waiters and two extra cooks.” The planner cannot hire anyone. The agency reads the board and sends the people. Elasticsearch is the planner. The orchestrator is the agency. Both are needed for the restaurant to be staffed correctly.

i
Definition

Autoscaling in Elasticsearch is a feature in which the cluster calculates the storage and memory capacity that each group of nodes requires, based on policies you define, and exposes that calculation so an orchestrator can automatically add or remove capacity to match.

2
parts: Elasticsearch calculates, the platform acts
Storage
and memory are the main things autoscaling reasons about
Minutes
the usual order of magnitude for a scaling change, not milliseconds

What Autoscaling Is Not

Autoscaling is not an instant response to a sudden burst of search traffic. Adding a node takes minutes, and moving data onto it takes longer. It is not a magic fix for a badly designed index or an overloaded query. It is not free, since every node it adds has a price. And, importantly, it does not simply watch processor usage the way some web server autoscalers do. We will come back to this last point in its own chapter, because it is the most common misunderstanding.

2Why Fixed-Size Clusters Struggle

To see why autoscaling exists, we look at what goes wrong when a cluster is built at one fixed size and left alone.

Guessing the Future

When a team builds a cluster, someone has to guess how much data it will hold in six months or a year. That guess is hard to get right. Data volumes depend on how many customers arrive, how verbose the logs become, how many new features are launched and how long data must be kept. A small change in any of these can double the storage need.

Two Ways to Be Wrong

If the guess is too high, you over-provision: you pay for servers and disks that stay empty. If the guess is too low, you under-provision: the cluster runs out of room, and problems begin. Both mistakes cost money, one through waste and the other through outages.

Waste

Paying for Empty Space

A cluster sized for the busiest day of the year sits mostly idle the rest of the time, and the bill arrives every month.

Risk

Running Out of Disk

Elasticsearch has safety limits on disk use. When a node crosses them, shards stop being placed on it and eventually writes are blocked.

Effort

Constant Capacity Planning

Engineers must check graphs, update spreadsheets and schedule upgrades. This work never ends and steals time from real projects.

Delay

Slow Human Reaction

A person needs to notice the problem, decide what to do and make the change. Data can grow faster than that chain of steps.

Spikes

Incidents Create Data

When something breaks, systems often log much more than usual, at exactly the moment the team is busiest.

Mixed Loads

Different Tiers, Different Needs

Hot, warm and cold data grow at different speeds, so one fixed plan for all nodes fits none of them well.

Everyday Analogy

Buying shoes for a growing child is a good picture. If you buy shoes that fit perfectly today, they are too small in three months. If you buy shoes two sizes too big, the child trips and the money is wasted for a year. The best approach is to check often and buy the next size when it is needed. Autoscaling is that habit of checking and buying the next size, done by a system that never forgets.

!
Watch Out

When disks get too full, Elasticsearch does not simply slow down. It first stops placing new shards on the full node, then tries to move shards away, and at the last limit it marks affected indices as read-only for writes. From the application’s point of view, indexing suddenly fails. This is the moment autoscaling tries to prevent.

A fixed-size cluster is a bet on the future. Autoscaling lets you stop betting and start measuring.

3Core Concepts You Need First

A handful of words appear in every autoscaling discussion. Learn them here and the later chapters will feel simple.

Word 1

Node Role

A label that says what a node does, such as holding hot data, warm data, cold data or running machine learning jobs. Autoscaling works on groups of nodes that share roles.

Word 2

Data Tier

A group of nodes that holds data of a certain age or importance. Fresh, busy data lives in the hot tier, and older data moves to cheaper tiers.

Word 3

Autoscaling Policy

A named set of rules for one group of node roles. It says which deciders to use and how they should behave.

Word 4

Decider

A small piece of logic that looks at one kind of need, such as storage or machine learning memory, and answers “how much capacity is required?”

Word 5

Required Capacity

The amount of storage and memory that a policy says its nodes must have in total, and per node, to do their job properly.

Word 6

Current Capacity

What the group of nodes has right now. The gap between required and current capacity is what triggers a scaling change.

Word 7

Orchestrator

The program that owns the machines, such as Elastic Cloud or the Kubernetes operator. It reads the recommendation and carries out the change.

Word 8

Watermark

A disk-usage limit, given as a percentage, at which Elasticsearch changes how it treats a node. Autoscaling aims to stay well under the first limit.

Word 9

Scale Up and Scale Down

Making capacity larger or smaller. In this guide, “up” means more capacity and “down” means less, whether by size or by number of nodes.

Word 10

Shard

One piece of an index, stored and searched independently. Moving shards between nodes is the slow part of many scaling changes.

The Simple Chain of Ideas

Here is how these words fit together in one sentence. A policy is attached to a group of nodes with certain roles. The policy uses one or more deciders. Each decider calculates a required capacity. Elasticsearch compares it with the current capacity, and shares the result. The orchestrator reads it and changes the number or size of nodes. Read that chain twice, and the rest of the guide becomes much easier.

Everyday Analogy

Consider a school that has separate classrooms for different age groups. Each classroom, like a data tier, has its own needs. A teacher, like a decider, counts the pupils and says how many desks each room needs. The head teacher’s list, like a policy, collects those needs. The caretaker, like the orchestrator, then brings in or removes desks. Nobody expects the reception classroom to need the same number of desks as the final-year classroom.

*
Good to Know

Autoscaling reasons about groups of nodes, not individual nodes. It never says “node 7 is too small.” It says “the hot tier as a whole needs this much storage.” This design lets the orchestrator choose whether to make nodes larger or to add more of them.

4Styles of Scaling

There is more than one way to add capacity, and more than one way to decide when to add it. Knowing the options explains many design choices in Elasticsearch.

Vertical or Horizontal

Vertical scaling means making each node bigger, with more memory, more disk or a faster processor. Horizontal scaling means adding more nodes of the same kind. Vertical scaling is simple, but every machine has a maximum size, and one huge node is a bigger risk if it fails. Horizontal scaling can grow much further and spreads risk, but it needs Elasticsearch to move shards onto the new nodes, which takes time.

Everyday Analogy

A delivery company can buy one bigger truck or buy more trucks. A bigger truck is easy to manage, but there is a limit to how big a truck can be, and if it breaks down, all deliveries stop. More trucks need more drivers and more planning, but the company can keep growing and one breakdown hurts less. Vertical and horizontal scaling follow exactly this trade.

Reactive or Proactive

A reactive approach waits until the need is real. It looks at what data exists right now and makes sure there is room for it. A proactive approach looks ahead. It notices how quickly data has been arriving lately and adds room for what is about to arrive. Elasticsearch offers both styles, in separate deciders, and they are often used together.

StyleHow It DecidesStrengthWeakness
VerticalMakes existing nodes largerSimple to reason aboutHits a ceiling, and one big node is a bigger single risk
HorizontalAdds or removes whole nodesGrows further and spreads riskNeeds shards to move, so it takes longer
ReactiveSizes for the data that exists nowNever over-estimates future growthCan be late during a fast surge of new data
ProactiveSizes for expected near-future dataAdds room before it is neededA wrong forecast can add more than needed

Up Is Easy, Down Is Hard

Growing is usually safer than shrinking. When you add capacity, nothing has to be evacuated. When you remove capacity, the data on those nodes must first be moved elsewhere, and every move puts load on the cluster. For this reason, automatic scale-down is handled much more carefully than scale-up, and in some cases platforms are conservative about doing it at all. We look at this in detail later.

*
Good to Know

Whether a platform makes nodes bigger, adds more nodes, or does a mix of both is decided by the orchestrator and its settings, not by the Elasticsearch calculation. Elasticsearch simply says how much total and per-node capacity is required. The platform chooses how to reach it.

5Architecture and Components

Let us look at the parts that work together during autoscaling, from users at the top to the machines at the bottom.

The Parts of the System

Front Door

API Gateway and Load Balancer

The gateway is the single entrance for requests, handling identity checks and rate limits. The load balancer spreads requests over application servers, and over nodes, so that new nodes start receiving work once they join.

Application

Indexing and Search Services

Your own code. It writes data into the cluster and searches it. Its behavior, such as how much it writes and keeps, creates the demand that autoscaling reacts to.

Cluster

Master Node and Data Nodes

The elected master node manages cluster state and runs the autoscaling calculation. Data nodes hold shards, grouped by role into tiers such as hot, warm and cold.

Brain

Autoscaling Policies and Deciders

Stored inside the cluster. Deciders inspect shards, disk use and memory needs, and produce the required capacity for each policy.

Interface

Capacity API

A read-only interface that returns, for every policy, the required capacity, the current capacity and the reasons behind the numbers.

Hands

Orchestrator and Platform

Elastic Cloud, Elastic Cloud Enterprise or the Kubernetes operator. It polls the capacity interface and creates, resizes or removes nodes on the underlying infrastructure.

flowchart TD
    U["Users on web and mobile"] --> G["API Gateway"]
    G --> LB["Load Balancer"]
    LB --> IS["Indexing Service"]
    LB --> SS["Search Service"]
    IS --> CN["Coordinating node"]
    SS --> CN
    CN --> HOT["Hot tier data nodes"]
    CN --> WARM["Warm tier data nodes"]
    CN --> COLD["Cold tier data nodes"]
    M["Elected master node with autoscaling deciders"] --> API["Capacity API: required and current capacity"]
    HOT --> M
    WARM --> M
    COLD --> M
    ORCH["Orchestrator: Elastic Cloud or Kubernetes operator"] --> API
    ORCH --> INFRA["Infrastructure: virtual machines and disks"]
    INFRA --> HOT
    INFRA --> WARM
    INFRA --> COLD
    MON["Monitoring and alerts"] --> M
    MON --> ORCH
Figure 1: Components of autoscaling. The master node calculates, the capacity interface publishes, and the orchestrator changes the infrastructure.

Reading the Diagram

Start at the top. Users reach the gateway and load balancer, which hand requests to the indexing and search services. These call the cluster through a coordinating node, which routes work to data nodes in the hot, warm and cold tiers. That is the everyday path of data.

Now follow the autoscaling loop. Data nodes report their state, such as how full their disks are, to the elected master node. The master node runs the deciders and publishes their results through the capacity interface. The orchestrator polls this interface regularly. When the required capacity is larger than the current capacity, it changes the infrastructure underneath, and new or larger nodes join the tiers. Monitoring watches both sides, so people know when decisions are made and when the platform has acted.

i
Design Note

Because the calculation lives in the cluster and the action lives outside it, the two can fail independently. The cluster can say “I need more” while the orchestrator is down or blocked by a limit. Good monitoring checks that recommendations are actually turning into new capacity.

6Internal Working: Life of One Scaling Decision

Follow one decision from the moment data starts growing to the moment new capacity is serving it.

sequenceDiagram
    participant App as Applications
    participant DN as Hot data nodes
    participant MN as Master node with deciders
    participant OR as Orchestrator
    participant PL as Platform infrastructure
    App->>DN: Write a growing stream of data
    DN->>MN: Report disk use and shard sizes
    MN->>MN: Deciders calculate required capacity
    OR->>MN: Ask for capacity recommendation
    MN-->>OR: Required capacity is larger than current
    OR->>PL: Add or enlarge hot nodes
    PL-->>DN: New capacity joins the cluster
    DN->>DN: Shards are placed or moved onto new capacity
    OR->>MN: Ask again later
    MN-->>OR: Required capacity now matches current
Figure 2: One scaling decision. The orchestrator keeps asking until the required capacity and the current capacity match.
1

Data grows

Applications keep writing. Shards on the hot tier grow, and new indices or backing indices of data streams are created. Free disk space shrinks bit by bit.

2

The cluster keeps its books

The master node always knows where every shard lives and how big it is, because it manages the cluster state. It also knows how much disk each node has and how full it is.

3

Deciders calculate

When asked, each decider in the policy computes the capacity it thinks is required. A reactive storage decider sizes for the shards that exist now. A proactive one adds room for the data expected soon.

4

The largest answer wins

The results of all deciders in a policy are combined by taking the largest requirement, because the group of nodes must satisfy every need at once. The policy’s required capacity is published through the capacity interface.

5

The orchestrator compares

At regular intervals, the orchestrator reads the recommendation and compares required capacity with current capacity. If the requirement is higher, it plans a scale-up within any limits you have set.

6

The platform changes the cluster

The orchestrator asks the infrastructure to create larger nodes or more nodes. New nodes start, join the cluster, and announce their roles.

7

Shards settle in

Elasticsearch places new shards on the new capacity and, if needed, rebalances existing shards. Disk pressure drops, and the next comparison shows that required and current capacity match.

Why Decisions Are Repeated

The decision is not made once. The orchestrator keeps asking, again and again, because data keeps changing. Each answer is a fresh snapshot of what the cluster needs at that moment. This makes the system self-correcting: if a forecast was too generous or a burst ends, later answers reflect that.

!
Watch Out

The time between “capacity is required” and “capacity is serving traffic” is not zero. New machines must start, join and receive shards. If your data grows faster than that whole process takes, autoscaling can be late. This is why proactive sizing and sensible safety margins matter.

7Autoscaling Policies

Policies are how you tell Elasticsearch what to watch and how. They are the main thing you configure.

What a Policy Contains

An autoscaling policy has three parts. The first is a name, which is how you refer to it. The second is a list of roles, which decides which nodes the policy applies to, such as the nodes that hold hot data. The third is a set of deciders, each with its own optional settings. Together, they say: “For nodes with these roles, use these methods to work out how much capacity is needed.”

Everyday Analogy

A policy is like a job description for a capacity planner. It names the team the planner looks after, such as the night-shift kitchen staff, and lists the checks the planner performs: count the bookings, check the stock, look at the weather forecast. Different teams get different job descriptions, because a kitchen and a delivery team need different checks.

One Policy Per Group of Roles

Each group of node roles can have one policy. Typical setups have a policy for the hot tier, one for warm, one for cold, one for frozen and one for machine learning nodes. Nodes that have no matching policy are not autoscaled. This is deliberate: you decide which parts of the cluster are managed automatically and which stay under manual control.

Policy ForApplies To Nodes With RoleTypical DecidersWhat It Protects
Hot tierHot data nodesReactive and proactive storageRoom for fresh, busy data as it arrives
Warm tierWarm data nodesReactive storageRoom for data that has aged and moved from hot
Cold tierCold data nodesReactive storageRoom for rarely searched data on cheaper disks
Frozen tierFrozen data nodesFrozen storage, shards and existence decidersCache and memory for searchable snapshot data
Machine learningMachine learning nodesMachine learning deciderMemory for anomaly jobs and deployed models

Who Writes Policies

On Elastic Cloud and similar platforms, the platform creates and manages the policies for you when you switch autoscaling on, and you mostly set limits such as a maximum size for each tier. When you run the pieces yourself, for instance with your own orchestrator, you create policies through Elasticsearch’s autoscaling interface. In either case, understanding what the policy says helps you understand why the cluster grew.

*
Practical Tip

Treat policies like code. Keep a record of what each policy contains, why it was chosen and when it was changed. A cluster that grows unexpectedly is much easier to explain if you can see that a policy was changed last Tuesday.

8The Deciders in Detail

Deciders are the small brains of autoscaling. Each one watches for one kind of need. Here is what each of them does, in plain language.

Storage

Reactive Storage Decider

Looks at the shards that exist right now and works out how much disk is needed so that all of them can live comfortably below the disk safety limits. It answers: “Do we have room for what we already hold?”

Storage

Proactive Storage Decider

Does the same, and then adds room for data expected soon, using recent growth of data streams and indices as a guide. It answers: “Will we have room for what is about to arrive?”

Frozen

Frozen Storage, Shards and Existence

Three deciders for the frozen tier. One sizes local cache storage, one sizes memory based on how many shards must be served, and one makes sure at least one frozen node exists when frozen data is present.

Machine Learning

Machine Learning Decider

Adds up the memory needed by anomaly detection jobs, analytics jobs and deployed models, and requires enough machine learning node memory to run them.

Testing

Fixed Decider

Requires a fixed amount of capacity that you choose. It is mostly used for testing, and to make sure a minimum number of nodes exists.

Reactive Storage: Making Room for the Present

The reactive storage decider is the workhorse. It knows how big every shard is, and it knows the rule that Elasticsearch stops putting shards on nodes whose disks are too full. It therefore calculates the minimum total storage so that every shard can be placed while keeping nodes below that limit. If the shards you have today would not fit, this decider says so.

The key word is “today”. It uses only the data that already exists. It does not guess about tomorrow. That makes it accurate and conservative, and it also means it can be a little late when data arrives very fast.

Proactive Storage: Making Room for the Near Future

The proactive storage decider adds a forecast. It looks at how fast data streams and their backing indices have been growing recently and estimates how much more data will arrive within a short window of time. It then requires enough storage for both the present data and this expected new data. The length of the forecast window is a setting, and it is kept short on purpose, since forecasts get less trustworthy the further ahead they look.

Think of the proactive decider as a driver who watches the speed of the car ahead and starts to slow down before the brake lights come on. The reactive decider is the driver who only brakes when the car ahead is very close.

Everyday Analogy

A water tank in a village has a pump that fills it from a river. The reactive rule says, “Make sure the tank is big enough for the water we hold right now.” The proactive rule says, “Also make sure it is big enough for the water that will flow in during the next half hour at the current speed.” If a flood makes the river rush, the proactive rule notices the change of speed early and calls for a bigger tank sooner.

Frozen Deciders

The frozen tier holds data as searchable snapshots, which are indices whose real data lives in cheap object storage while the frozen nodes keep a small local cache. Because the data is not fully on local disks, the sizing rules differ. Frozen deciders look at how much data must be served and how many shards are involved, and they ask for enough local cache and memory to serve them well. They also make sure that at least one frozen node exists whenever frozen data does.

The Machine Learning Decider

Machine learning jobs and deployed models need memory, and that memory is not shared easily. The machine learning decider adds up what every job and model needs and requires machine learning nodes with enough total memory, and a single node large enough for the largest job. We give this its own chapter later.

Combining Deciders

When a policy has several deciders, each produces its own required capacity, and Elasticsearch takes the largest of them. This is the safe choice, because a group of nodes must meet every requirement at once. If the reactive decider says 8 terabytes and the proactive says 9, the policy requires 9.

i
Design Note

Every decider also reports why it reached its answer. Reading these reasons in the capacity interface is the best way to understand a surprising recommendation. It often shows, for example, that one huge shard is the reason a node size must be larger than expected.

9Data Tiers and Autoscaling

Autoscaling and data tiers work together. Understanding the tiers explains why different parts of the cluster grow at different speeds.

The Journey of Data Through Tiers

Not all data is equally valuable at every age. Yesterday’s logs are searched constantly. Last year’s logs are searched rarely. Elasticsearch lets you place data on different groups of nodes, called data tiers, according to its age and importance. The hot tier holds new data and gets the fastest, most expensive storage. The warm tier holds older data that is still searched from time to time. The cold tier holds data that is rarely searched, on cheaper storage. The frozen tier holds data that is almost never searched, kept mostly in cheap object storage.

flowchart LR
    IN["New data arrives"] --> HOT["Hot tier: fast disks, heavy indexing"]
    HOT --> WARM["Warm tier: older data, lighter searches"]
    WARM --> COLD["Cold tier: rarely searched, cheaper disks"]
    COLD --> FROZEN["Frozen tier: searchable snapshots, local cache"]
    FROZEN --> DEL["Deleted after retention period"]
    P1["Autoscaling policy for hot"] -. "sizes" .-> HOT
    P2["Autoscaling policy for warm"] -. "sizes" .-> WARM
    P3["Autoscaling policy for cold"] -. "sizes" .-> COLD
    P4["Autoscaling policy for frozen"] -. "sizes" .-> FROZEN
Figure 3: Data moves down the tiers as it ages, and each tier has its own autoscaling policy.
Everyday Analogy

Think of a library. New releases sit on the front tables where everyone can grab them, which is the hot tier. Older books stand on shelves in the main hall, which is warm. Rarely borrowed books wait in a lower storeroom, which is cold. The rarest items are kept in a distant archive and fetched on request, which is frozen. Each place needs a different amount of space, and each grows at its own pace.

Why Each Tier Grows Differently

TierWhat Grows ItWhat Autoscaling WatchesTypical Concern
HotIngest rate and how long data stays hotDisk space, plus forecast of new dataRunning out of disk during a surge
WarmData moving out of hot each dayDisk space for aged shardsSteady, predictable growth
ColdData kept for long searches and complianceDisk spaceCost of holding years of history
FrozenNumber and size of searchable snapshotsLocal cache and memory for shardsMany shards needing memory even when data is cheap

The Hot Tier Is the Usual Star

The hot tier is where new data lands, so it is where surges hit first. Autoscaling on the hot tier usually matters most, and it is where the proactive storage decider earns its place. Warm and cold tiers change more slowly, since they receive data only as it ages out of the tier above.

*
Practical Tip

The faster your data moves from hot to warm, the smaller your hot tier needs to be. Shortening the time data stays hot is often the cheapest and most effective way to reduce cost, and autoscaling will then need to add less.

10Disk Watermarks: The Lines Autoscaling Tries Not to Cross

Storage autoscaling is closely tied to three disk safety limits inside Elasticsearch. Knowing them makes the recommendations easy to understand.

The Three Watermarks

A watermark is a level of disk usage, given as a percentage of the disk, at which Elasticsearch takes protective action. By default there are three:

  • Low watermark, 85 percent by default: Elasticsearch stops placing new shards on a node whose disk is fuller than this.
  • High watermark, 90 percent by default: Elasticsearch tries to move shards away from the node to other nodes that have more room.
  • Flood stage, 95 percent by default: Elasticsearch makes indices that have shards on the node read-only for writes, so that no further data can be added until space is freed.
85%
low watermark: no new shards placed on the node
90%
high watermark: shards are moved away from the node
95%
flood stage: affected indices become read-only for writes
Everyday Analogy

A car’s fuel gauge has a low-fuel light, then a warning chime, and finally the engine stops. The three watermarks work in the same way. At 85 percent, the light comes on and no new passengers are taken aboard. At 90 percent, the chime sounds and people start moving to other cars. At 95 percent, the engine cuts out to protect itself. Autoscaling tries to refuel long before the light comes on.

How Autoscaling Uses the Watermarks

The storage deciders do not ask for the disk to be filled to the brim. They ask for enough storage that all shards fit while keeping each node below the low watermark. The requirement is therefore larger than the raw size of the data. If you hold 1 terabyte of shards, the requirement will be noticeably more than 1 terabyte, so the disks are never pushed to the line.

This surprises many people who compare the recommendation with the sum of their index sizes and think it is too large. The difference is the safety room that Elasticsearch needs in order to work smoothly. Shards also need free space for merges and for moving between nodes, which temporarily makes copies.

!
Watch Out

If autoscaling is switched off, or blocked by a maximum size that is too small, disks can reach the flood stage and writes will fail. When an alert about a low watermark appears, check first whether autoscaling is enabled for that tier and whether it has hit its limit.

Large Shards and Node Size

Another effect is that the largest shard determines the smallest useful node. If one shard is 400 gigabytes, no node with a smaller usable disk can ever hold it. Autoscaling therefore also reports a required capacity per node, not just in total. Very large shards can push the recommended node size up, and this is one reason to keep shards to a healthy size.

11Autoscaling for Machine Learning Nodes

Machine learning workloads are a different kind of guest in the cluster. They need memory, not disk, and they arrive and leave in bursts.

What Machine Learning Nodes Do

Elasticsearch can run anomaly detection jobs, which learn what normal looks like for a stream of data and flag unusual behavior. It can also run data frame analytics jobs and host trained models, for example models that add meaning to text. These tasks run on nodes with the machine learning role, and each one needs a certain amount of memory while it is open or deployed.

How the Decider Thinks

The machine learning decider adds up the memory that all open jobs and deployed models require, plus a small amount of overhead for the node itself. It also checks that at least one node is big enough for the largest single job or model, since a job cannot be split across nodes. From these numbers, it derives the total and per-node memory that the machine learning nodes must have.

Everyday Analogy

Imagine a workshop with several benches. Each project needs a certain amount of bench space, and a project cannot be split across two benches. The planner adds up the space needed by all projects, but also checks that there is at least one bench long enough for the biggest project. If a project of unusual size arrives, the planner asks for a longer bench, not just more benches.

Scaling Down Is More Natural Here

Machine learning workloads come and go. A job is opened, runs and later closes. When jobs close, the memory they used is free again, so the requirement drops. The decider supports scaling down after a delay, which avoids removing capacity the moment a job closes and then re-adding it minutes later. The delay acts as a cooling-off period. Nodes that do not hold shards of data are also easier to remove, since there is nothing to evacuate.

Jobs That Wait

A related idea is lazy nodes. Normally, if a job needs to start and there is no room on any machine learning node, it fails to open. With a setting for lazy machine learning nodes, the job can instead wait until capacity appears. Autoscaling then sees the waiting job, calculates the capacity it needs and asks the platform to add it. This lets a job start “before” the machine exists, which is very convenient for bursty workloads.

*
Practical Tip

Expect a delay before a waiting job starts, since a new machine learning node must be created and must load its software. For user-facing features that depend on a model being ready, keep a minimum amount of capacity running so that nobody waits for a cold start.

12Where Autoscaling Runs

The calculation is part of Elasticsearch, but the action needs an orchestrator. Which orchestrator you have decides how much of this works for you out of the box.

EnvironmentWho ActsWhat You DoNotes
Elastic Cloud (hosted)The platform itselfTurn autoscaling on for supported tiers, and set maximum sizesEasiest path, since the platform manages policies and machines for you
Elastic Cloud EnterpriseThe platform, running in your own environmentEnable and configure autoscaling limits per tierSimilar experience, using your own hardware or cloud account
Elastic Cloud on KubernetesThe Kubernetes operatorDefine autoscaling resources with minimum and maximum resource limits per node groupFits teams already running Kubernetes
Self-managed on your own serversYour own toolingRead the capacity interface and build the action yourselfPowerful but needs engineering effort, and the machines must be easy to create and remove automatically
Serverless offeringElastic, behind the scenesNothing to size, since capacity is managed for youA different product model, so behaviors differ from the cluster-based feature described here

Why Self-Managed Is Harder

The Elasticsearch calculation only makes a recommendation. In a self-managed setup, you must build the program that reads the recommendation, creates or removes servers and disks, joins them to the cluster with the right roles and handles failures along the way. That is real engineering. Most teams that want autoscaling choose a platform that already includes the acting side.

Limits Are Your Safety Rope

Whatever the platform, you set limits. A minimum makes sure capacity never drops below a level you need, for example to keep enough nodes for high availability. A maximum stops runaway growth from surprising your budget. Autoscaling works between these limits. If the requirement rises above your maximum, the platform will not go beyond it, and the cluster can still run out of room, which is why alerts on hitting the maximum are so important.

i
Licensing Note

Autoscaling is available with Elastic’s paid subscription levels and hosted offerings, and the exact requirements and supported tiers have changed over time. Confirm the details for your platform and version in Elastic’s current documentation before you plan a design.

13Setting Up Autoscaling Step by Step

The details differ by platform, but the general order of steps is the same everywhere.

1

Confirm eligibility

Check that your subscription, platform and Elasticsearch version support autoscaling for the tiers you need. This decides whether the project can start.

2

Design your tiers

Decide which data tiers you need, how long data stays in each, and which node roles will hold them. Autoscaling is only as good as the structure it sits on.

3

Fix your data lifecycle

Set up lifecycle rules that roll over indices at sensible sizes and move them between tiers on schedule, so that growth is predictable and shards are healthy in size.

4

Choose minimum and maximum limits

Set the smallest capacity you can accept for availability, and the largest you can afford. These limits are your guardrails.

5

Enable autoscaling on chosen tiers

Switch it on for the tiers you want managed, starting with the most important ones. On platforms that manage policies for you, this is a setting. Otherwise, create policies and start your orchestrator.

6

Test with a controlled load

In a test environment, add data faster than usual and watch the recommendation change, the platform react and the new capacity join. Time each stage.

7

Add monitoring and alerts

Alert on disk watermarks, on hitting maximum limits, on scaling events and on recommendations that are not being carried out.

Start Small and Learn

A wise first step is to enable autoscaling on one non-critical tier or one test deployment. Watch how it behaves for a few weeks: how often it changes, how big the steps are and whether your limits make sense. The habits and dashboards you build there will carry over to the more important parts of the cluster.

!
Watch Out

Do not turn autoscaling on and walk away. Autoscaling changes the size of your cluster and, therefore, your bill. The first weeks deserve close attention, with someone reading each scaling event and asking whether it was expected.

14Autoscaling With Lifecycle Management and Data Streams

Autoscaling reacts to data. Lifecycle management shapes the data. Together, they keep the cluster steady and the bill under control.

A Quick Look at the Two Helpers

A data stream is a structure for time-based data such as logs and metrics. Behind a single name, it manages a series of hidden backing indices and creates a new one as the current one fills. Index Lifecycle Management, or ILM, is a feature that moves indices through stages as they age. It can roll over to a new index when the current one reaches a size or age, move older indices to warm and cold tiers, and finally delete them.

Everyday Analogy

Autoscaling is a warehouse manager who adds shelves when the warehouse fills up. ILM is the routine of moving old stock to a cheaper storage building and throwing out expired goods. A manager who adds shelves but never clears old stock will need ever more shelves. A manager with a good clearing routine needs far fewer.

Why Lifecycle Rules Come First

Storage autoscaling responds to the total amount of data. Lifecycle rules decide how much data there is, in which tier, and for how long. If you keep everything on the hot tier forever, autoscaling will happily buy more and more expensive hot storage. If you move data down the tiers and delete it on schedule, the same autoscaling will buy far less. Lifecycle rules are the steering wheel, and autoscaling is the engine.

Healthy Shards Make Better Decisions

Rollover conditions keep shards at a sensible size. Predictable shard sizes make the storage deciders’ work more accurate and make it easier to place shards on nodes. A single enormous shard, or thousands of tiny ones, both cause trouble: the first forces very large nodes, and the second wastes memory. As a rule of thumb, many teams aim for shards in the range of tens of gigabytes, but you should check current guidance from Elastic for your version and use case.

Example: Trimming the Hot Tier

A team keeps thirty days of logs on the hot tier and notices that autoscaling keeps adding hot capacity every month. Searches show that almost nobody looks at logs older than three days. They change the lifecycle rule to move data to the warm tier after three days. The hot tier shrinks to a tenth of its earlier need, warm storage costs much less per terabyte, and the monthly bill falls even though the amount of data stays the same.

*
Practical Tip

Before you tune autoscaling, tune retention. Ask “who needs this data, on which tier, for how long?” for every data stream. The cheapest capacity is the capacity you never have to buy.

15What Autoscaling Does Not Do

The most common mistakes come from expecting autoscaling to do things it was never designed for. This chapter clears up those expectations.

It Does Not Watch Query Traffic

Elasticsearch autoscaling is driven by capacity needs, mainly storage and memory. It is not driven by how many searches per second arrive or how hot the processors are. If a sudden crowd of users sends heavy queries, and CPU usage rises, the storage deciders will see no change, because the data has not grown. The cluster will not automatically add search capacity for that reason.

This is the single biggest difference from the autoscaling that many people know from web servers, where more traffic means more machines. If you need to scale for search throughput, you must plan for it separately, for example by adding replicas and nodes ahead of known events, or by using scheduled changes, or by using a platform that offers other kinds of scaling. Check what your platform supports today.

Everyday Analogy

Autoscaling in Elasticsearch is like a shop that adds shelves as stock grows. It works well when the shelves are the problem. But if the shop is fine on shelves and simply has too many customers at the checkout, adding shelves does nothing. A different kind of help, more checkout staff, is needed.

It Is Not Instant

A new node must be created, started, joined to the cluster and filled with shards. Minutes are typical, and larger data moves take longer. Autoscaling is therefore for trends over hours and days, and for smoothing out surprises, not for millisecond reactions.

It Cannot Fix Bad Design

  • Too many small shards waste memory, and adding nodes only hides the waste at a higher price.
  • Heavy, unbounded queries can overload a node whatever its disk size.
  • Missing retention rules make data grow forever, and autoscaling will keep paying for it.
  • Mapping explosions, where thousands of fields are created by accident, use memory in ways that storage deciders do not measure.

It Does Not Override Your Limits

Autoscaling works inside the minimum and maximum you set. It will not spend money beyond your maximum, even if the calculation says more is needed. This protects your budget, and it also means that a maximum set too low can quietly cause the exact outage you wanted to avoid.

!
Watch Out

Many teams assume autoscaling protects them from every kind of overload. It protects against running out of storage and memory for the data and jobs the cluster holds. It does not protect against slow queries, a sudden traffic spike, or bad indexing settings. Put separate safeguards in place for those.

16Scaling Up Versus Scaling Down

Growing a cluster is fairly gentle. Shrinking it is delicate. Understanding why explains many of the rules you will meet.

Why Scale-Up Is Easy

When capacity is added, nothing has to be moved out of the way. New nodes join, Elasticsearch places new shards on them and may rebalance a few existing ones, and the load spreads out. Even if something goes a little wrong, the old nodes are still there and still holding the data.

Why Scale-Down Is Hard

To remove a node that holds shards, Elasticsearch must first copy those shards to other nodes and only then remove the node. Every shard that moves means reading it from disk, sending it over the network and writing it elsewhere. If you shrink a busy hot tier at a bad time, this extra work can slow down indexing and searching just when you least want it.

flowchart TD
    A["Required capacity falls below current capacity"] --> B["Wait for a cooling-off period"]
    B --> C{"Still lower after the wait?"}
    C -- "No" --> Z["Keep current capacity"]
    C -- "Yes" --> D["Choose which node to remove"]
    D --> E["Move its shards to other nodes"]
    E --> F["Wait for shards to finish moving"]
    F --> G["Remove the empty node"]
    G --> H["Check cluster health and disk levels"]
Figure 4: A careful scale-down. It waits, evacuates shards, and only then removes capacity.
Everyday Analogy

Adding a new storeroom is easy: you unlock the door and start putting boxes inside. Closing a storeroom is harder, since you must carry every box to another room first, and you need to be sure the other rooms have space. If you close a storeroom in the middle of the busiest delivery day, the carrying gets in the way of the work.

How Platforms Handle It

Because of this, platforms are more cautious about scaling down data nodes than about scaling up. Some tiers may only scale up automatically, leaving shrinking to a deliberate action by a person, while workloads that hold no data, such as machine learning nodes, are easier to scale down. Details differ by platform and version, so check the current documentation for what your platform does automatically.

Cooling-Off Periods

To prevent “flapping”, where a cluster grows and shrinks repeatedly in a short time, scale-down decisions use a delay. The requirement must stay low for a while before capacity is removed. Think of a thermostat that does not switch the heater on and off every few seconds. A short delay avoids wasteful changes and keeps the cluster stable.

*
Practical Tip

If you need to shrink a data tier, plan it as a project: lower retention or move data down the tiers first, let the requirement fall naturally, and schedule the actual node removal for a quiet period. Doing the steps in that order avoids surprising the cluster.

17Autoscaling Versus Other Ways to Size a Cluster

Autoscaling is one option among several. Each approach fits a different situation, and comparing them helps you choose wisely.

ApproachHow It WorksBest ForMain Limit
Fixed size, manual changesPeople size the cluster and change it when neededSmall, stable workloads with predictable growthDepends on people noticing in time, and often over-provisions to be safe
Scheduled scalingCapacity is raised and lowered at set timesKnown daily or seasonal patterns, such as a yearly saleDoes not react to surprises that were not scheduled
Custom scripts on metricsYour own program watches metrics such as CPU and adds nodesSpecial needs, such as scaling for search trafficYou must build, test and maintain it, and get shard movement right
Elasticsearch autoscalingThe cluster calculates required storage and memory, and the platform actsGrowing data, tiered storage and machine learning workloadsNot driven by query traffic, and not instant
Serverless offeringThe provider manages capacity behind the scenesTeams who want no capacity planning at allDifferent feature set and pricing model, less low-level control

These Are Not Rivals

Most production systems combine approaches. A team might use autoscaling for storage growth, scheduled scaling before a known sale for search throughput, and manual review for large structural changes. The skill is in matching each kind of demand to the tool that fits it.

Everyday Analogy

A hotel handles busy periods in several ways together. It has a permanent staff for normal days, a rota with extra staff for known busy weekends, a list of people to call in when something unexpected happens, and an automatic rule that orders more linen when the store runs low. No single method covers every case, and the best hotels use all of them.

*
How to Decide

Ask what is growing. If it is data or machine learning work, autoscaling fits well. If it is query traffic, plan search capacity separately. If the pattern is known in advance, a schedule is simple and cheap. If you want to avoid capacity work completely, look at serverless options and compare features and cost.

18Performance and Scalability Considerations

Autoscaling helps a cluster grow, but the way the cluster is designed decides how well it grows.

Shards Are the Building Blocks

Everything in scaling comes back to shards. Elasticsearch places whole shards on nodes, so the number and size of shards decide how evenly data can spread. Too few large shards make balancing hard and force big nodes. Too many small shards waste memory, because each shard carries overhead in the node’s memory whether it holds a lot of data or a little.

Lever 1

Shard Size

Keep shards in a healthy range so that they are easy to place and to move. Rollover rules are the tool for this.

Lever 2

Shard Count

Avoid thousands of tiny shards. Combine small indices, or use fewer primary shards for small data, so that memory is not wasted.

Lever 3

Replica Count

Each replica doubles the storage for that index. Use as many as your availability needs and no more.

Lever 4

Retention

The number of days on each tier multiplies directly into storage. Shorter time on the hot tier saves the most.

Lever 5

Compression and Mappings

Leaner mappings, fewer unneeded fields and suitable compression settings reduce the size of data on disk.

Lever 6

Reaction Speed

Shorter forecasts and fast machines reduce lag between need and capacity, while very large data moves lengthen it.

The Cost of Rebalancing

When new nodes join, Elasticsearch may move existing shards to even out the load. This rebalancing uses network and disk on both the sending and receiving nodes. Elasticsearch limits how many shard moves happen at once and how fast, so that everyday work is not starved. These limits keep the cluster responsive, and they also mean that a large scale-up can take a while to fully settle.

Speed of Ingest Versus Speed of Scaling

Think of two speeds racing each other: how fast data arrives, and how fast new capacity becomes available. As long as capacity arrives faster than the data does, the cluster stays healthy. If a huge burst arrives faster than the scaling process can react, disks can fill up before help arrives. To stay ahead, keep a safety margin of free space and use the proactive decider on tiers that receive bursts.

!
Watch Out

Test your worst realistic surge, such as a sudden tenfold jump in log volume during an incident. Measure how long it takes from the start of the surge until new capacity serves traffic. If disks would fill before that, increase the safety margin or the size of your minimum capacity.

Example: Surviving a Log Storm

A team’s application fails at night and starts writing error logs at eight times the normal rate. Because they run a proactive storage decider with a sensible minimum, the platform sees the growth within minutes and adds hot capacity. Disk levels rise to about seventy percent and then fall as new nodes take shards. Nobody is paged for a full disk, and indexing never stops.

19Data Flow and the Life of a Scaling Event

Each scaling change moves through a set of stages, from a quiet cluster to a resized one. Knowing them helps you read your dashboards.

flowchart LR
    S["Steady: capacity matches need"] --> G["Growing: need rises"]
    G --> R["Recommendation: required is above current"]
    R --> P["Planning: orchestrator checks limits"]
    P --> A["Acting: nodes created or enlarged"]
    A --> J["Joining: new nodes enter the cluster"]
    J --> B["Balancing: shards placed and moved"]
    B --> S
    P --> L["Blocked by maximum limit"]
    L --> AL["Alert: needs human decision"]
Figure 5: The life of a scale-up event. A blocked limit sends the event to a human instead of back to steady state.
Stage 1

Steady

Required and current capacity match. Disk levels are comfortably below the low watermark.

Stage 2

Growing

Data or workloads grow. Free space shrinks, and the deciders begin to require more than the cluster has.

Stage 3

Recommendation

The capacity interface shows a required capacity above the current one, with reasons from each decider.

Stage 4

Planning

The orchestrator compares the recommendation with your limits and decides how large the step should be.

Stage 5

Acting

The infrastructure creates larger or additional nodes. This is often the longest stage.

Stage 6

Balancing

Nodes join and shards settle. Load spreads out, and the cluster returns to steady state.

What You See at Each Stage

During growth, you would see free disk space falling and possibly the first low-watermark warnings. During the recommendation stage, the capacity interface shows a gap. During acting, the platform’s activity log records a plan being applied and nodes being created. During balancing, shard relocation counts rise and then settle. After balancing, disks fall to a comfortable level and the gap closes. If the gap does not close, something is blocking the process, and it is time to investigate.

Everyday Analogy

Think of a growing plant in a pot. First it thrives. Then its roots reach the sides, which is the recommendation that it needs a bigger pot. You buy a pot and fill it with soil, which is the acting stage. You move the plant across, which is the balancing stage. Then it thrives again until the next time. If you have no larger pot to hand, which is like a maximum limit, the plant keeps struggling until someone decides what to do.

Keep a Timeline of Events

Record each scaling event with its time, tier, size before and after, and the reason. Over a few months, this record becomes a rich picture of how your data grows. It helps with forecasting budgets, with spotting unusual jumps and with explaining changes in cost to the people who pay the bill.

20A Worked Example, Start to Finish

A short story with numbers makes the ideas concrete. Here is an invented example of a logging cluster and how autoscaling handles a normal month and a bad night.

The Setting

A streaming service stores application logs in a cluster with a hot tier and a warm tier. On a normal day, the logs add about 500 gigabytes to the hot tier. Data stays hot for two days, then moves to warm, where it stays for thirty days before deletion. Each index has one replica. All figures here are invented to illustrate the reasoning and are not from a real company.

Sizing by Hand First

QuestionWorkingResult
How much primary data is on hot?500 GB per day for 2 daysAbout 1 TB of primary data
With replicas?1 TB of primaries plus 1 TB of replicasAbout 2 TB stored on hot
With safety room under the low watermark?Keep disks below about 85 percent, and leave room for mergesRoughly 2.6 to 3 TB of hot disk required
How much on warm?500 GB per day for 30 days, with replicasAbout 30 TB stored, so roughly 36 to 40 TB of warm disk required

These numbers show what the storage deciders are doing behind the scenes. They add the space for replicas and also the room that Elasticsearch needs to breathe. The recommended capacity is noticeably higher than the sum of index sizes.

A Normal Month

With autoscaling on and reasonable limits, the warm tier grows day by day for the first thirty days as data accumulates, and then levels off when deletion starts to match arrival. The platform adds warm capacity in a few steps during that first month. The hot tier stays flat, since data leaves after two days. Cost tracks real need, with no large idle reserves.

A Bad Night

One night, a failing service floods the logs, and volume jumps to eight times normal, about 4 terabytes per day at the peak rate. The proactive decider sees the fast growth and raises the hot requirement within minutes. The platform adds hot capacity, and new nodes join. Disk use on hot peaks near 75 percent and then eases. By morning, the incident is fixed, volume returns to normal and, two days later, the extra data has moved to warm. The warm tier grows a little to hold it, and thirty days later, the data is deleted.

The Bill

The extra hot capacity existed only for a short time, since the surge data moved out after two days. The warm tier held the surge data for thirty days, then dropped back. Without autoscaling, the team would have needed either permanent hot capacity for the worst night, wasting money every day, or a manual scramble at three in the morning.

i
Lesson From the Example

The lifecycle rules did half the work. Because data moved from hot to warm after two days, the surge only stressed the hot tier briefly. Autoscaling handled the rest. Together they turned a scary night into a routine event.

21Cost Control and Guardrails

Automatic growth is wonderful until the bill arrives. Guardrails keep the growth inside a budget you have chosen.

Where the Money Goes

Cluster costs come from four main places: the servers or virtual machines, the disks, the data moved across networks or between zones, and the licenses. Autoscaling changes the first two directly, and it can change the third indirectly, since more nodes can mean more replication traffic. Understanding each helps you predict what growth will cost.

Guardrail 1

Maximum Size Per Tier

A ceiling that autoscaling will never exceed. It turns “unlimited growth” into “growth up to this budget.”

Guardrail 2

Minimum Size Per Tier

A floor that keeps enough nodes for availability and enough memory for important workloads, even when demand is low.

Guardrail 3

Retention Rules

Lifecycle deletion keeps the total amount of data bounded. Without it, cost climbs forever.

Guardrail 4

Budget Alerts

Alerts from the cloud provider or the platform when spending passes a level, so people notice before the invoice does.

Guardrail 5

Scaling Event Review

A regular look at what grew and why, with a question for each big step: was this expected?

Guardrail 6

Tier Discipline

Data belongs on the cheapest tier that still meets its search needs. Review this every quarter.

Setting the Maximum Wisely

The maximum is a balancing act. Set it too low, and a real surge can hit the ceiling and cause an outage. Set it too high, and a runaway process, such as a logging loop, could grow the cluster to a size you cannot afford before anybody notices. A useful method is to set the maximum to your worst realistic need plus a margin, and to set an alert at seventy or eighty percent of the maximum, so humans get time to react.

Everyday Analogy

A company gives an employee a credit card with a limit. The employee can buy what is needed for the job without asking each time, which makes work fast. The limit stops a mistake, or a stolen card, from becoming a disaster. A message arrives when spending passes a threshold, so a person can step in. Autoscaling limits and alerts work like the card limit and the spending message.

!
Watch Out

A logging loop or a misconfigured application can create huge amounts of data in hours. Autoscaling, doing exactly what it should, will try to keep up until it reaches your maximum. Put rate limits and quotas on your data sources, so one buggy service cannot spend your whole budget.

22Security

Autoscaling creates and removes machines automatically, and automation needs strong access controls. Security must grow along with the cluster.

New Nodes Must Be Trusted Nodes

Whenever a new node joins, it becomes part of the cluster and can receive copies of your data. The joining process must therefore be secured. Nodes should use encrypted connections between them, using TLS, the same technology that puts the padlock in a web browser, and should prove their identity with certificates. Platforms that manage autoscaling usually handle this for you. In self-managed setups, your automation must issue and install certificates for every new node.

Protect the Automation

The orchestrator has power. It can create machines, which costs money, and it can delete them, which can affect data. Give it only the permissions it needs, and protect its credentials. Use the least privilege rule: every person or program receives no more access than its job requires. Store secrets in a proper secrets manager, rotate them on a schedule and log everything the orchestrator does.

Everyday Analogy

A company that hires temporary staff during busy seasons still checks each new person’s identity and gives each a badge with limited access. A stranger who simply walks in and starts working would be turned away. New nodes are the temporary staff, and certificates are their badges.

Access to the Autoscaling Interface

Creating and changing autoscaling policies requires special cluster permissions, and reading the capacity recommendation needs another. Grant them to the orchestrator and to a small number of administrators. A person who can change a policy can change how big and how expensive your cluster becomes, so treat that ability like a financial control as well as a technical one.

Data on New Disks

Every new disk that receives shards must be encrypted in the same way as the old ones, if you use encryption at rest. Make encryption a default in your machine templates, so it cannot be forgotten. When nodes are removed, their disks should be wiped or destroyed according to your rules, since they may hold copies of sensitive data.

!
Watch Out

Autoscaling can spread your data across more machines quickly. If a machine template has weaker security settings than the older nodes, every new node makes the cluster less safe. Test that freshly created nodes have exactly the same security posture as long-running ones.

23High Availability, Failure Scenarios and Recovery

Autoscaling helps availability by preventing full disks, and it also adds moving parts that can fail. Plan for both sides.

Keep Enough Nodes to Survive

High availability means the system keeps working when parts fail. Elasticsearch achieves it with replicas and with nodes spread across zones. Your minimum limits should always leave enough nodes, in enough zones, for the cluster to survive the loss of one zone or one node. A minimum that allows the cluster to shrink to a single node during a quiet night would remove that safety.

ScenarioWhat You SeeLikely CauseWhat To Do
Recommendation never becomes capacityRequired stays above current for a long timeOrchestrator down, blocked by a limit, or the platform could not create machinesCheck the orchestrator’s logs and limits, and raise the maximum if justified
Disks reach flood stageWrites are rejected, indices become read-onlyGrowth outran scaling, or maximum was reachedAdd capacity or free space, then release the write block after disk levels drop
New nodes do not joinPlatform reports success but the cluster does not growNetwork, certificate or role misconfigurationInspect node logs and fix templates before retrying
Scaling loops up and downFrequent size changes in short periodsMissing cooling-off periods or fluctuating workloadsIncrease delay before scale-down and smooth out bursty jobs
Shard moves overwhelm the clusterSlow searches and indexing during a resizeVery large shards moving at the same time as heavy trafficLower relocation limits, resize in quieter periods, and keep shards smaller
Unexpected cost jumpBig increase in nodes or sizeRunaway data source or loose maximumFind the source of data, set quotas, and tighten limits

When the Automation Itself Fails

If the orchestrator stops working, the cluster does not stop. It continues to run at its current size, and the capacity interface continues to make recommendations that nobody carries out. That is why it is valuable to alert on the gap between required and current capacity, so people know when the automation has stopped listening. Have a manual procedure ready for adding capacity in an emergency, and rehearse it.

*
Practical Tip

Write a short runbook titled “Autoscaling did not act.” It should list the checks in order: is the recommendation present, is the orchestrator running, is a limit blocking the change, and how to add capacity by hand. During an incident, a written list is worth more than memory.

24Monitoring, Logging and Metrics

Autoscaling changes your cluster without asking, so you need to know what it is doing and whether it is working.

The Numbers That Matter

Storage

Disk Use Per Node and Tier

The percentage of disk used on each node, compared with the watermarks. This is the earliest warning that capacity is tight.

Gap

Required Versus Current Capacity

The difference between what deciders require and what the cluster has. A gap that lasts for hours means the platform is not acting.

Limits

Closeness to Maximum

How near each tier is to its maximum size. An alert at seventy or eighty percent gives you time to decide.

Events

Scaling Event History

Times, sizes and reasons for every change. This helps with cost analysis and with finding unusual jumps.

Shards

Relocations and Shard Counts

How many shards are moving or waiting to move, and how many exist in total per node. It shows the aftermath of a resize.

Workload

Ingest Rate and Data Growth

Gigabytes added per hour and per day, by data stream. The root cause of most scaling is here.

Where to Find Them

The capacity interface itself is the primary source for required and current capacity, and it includes the reasoning of each decider. Elasticsearch’s cluster and node statistics report disk use, shard counts and relocations. Kibana’s monitoring pages, and the activity logs of your platform, show the history of changes. Send these into the same dashboards and alerting tools that your team already uses, so autoscaling alerts arrive in a familiar place.

Alerts That Help

  • Low watermark reached on any node. It means autoscaling is late or blocked.
  • Required capacity above current for more than a set time. It means the recommendation is not being applied.
  • Tier at seventy or eighty percent of its maximum. It gives people time to raise the limit or reduce data.
  • Unusual growth in data volume. A sudden jump often reveals a runaway source before it costs much money.
  • Frequent scale changes. It suggests flapping or a noisy workload.
!
Watch Out

Do not rely on cost reports alone to learn what autoscaling is doing. Cost reports arrive days after the event. Technical alerts on the gap between required and current capacity arrive within minutes, while there is still time to act.

25Advantages, Disadvantages and Trade-offs

Autoscaling solves real problems and also creates a few new ones. A fair look at both helps you decide when it is worth using.

Advantages

  • Prevents many full-disk outages by adding capacity before limits are reached
  • Saves money by avoiding permanent over-provisioning for peak days
  • Frees engineers from constant capacity planning
  • Handles different tiers separately, so each grows at its own pace
  • Understands Elasticsearch internals, such as shard sizes and watermarks, better than a generic scaler
  • Supports machine learning workloads that arrive in bursts
  • Gives clear reasons for its recommendations through the capacity interface

Disadvantages

  • Does not react to query traffic or processor load
  • Not instant, since nodes must start and shards must move
  • Needs an orchestrator, so self-managed setups require extra engineering
  • Requires a paid subscription level or hosted offering
  • Can raise costs quickly if a data source runs away
  • Scale-down of data nodes is cautious and may need human action
  • Hides poor design, such as oversized shards or missing retention

Key Trade-offs to Decide

Safety versus cost. A higher minimum and a proactive decider keep you safer during surges, but they hold more capacity when things are quiet. Decide how much safety your workload deserves.

Automation versus control. Fully automatic scaling saves effort, but it takes decisions out of human hands. Many teams keep automatic scale-up and require a person to approve large scale-downs or to raise maximum limits.

Big nodes versus many nodes. Larger nodes are simpler and need fewer shards to move, but they take a bigger share of the cluster when one fails. More, smaller nodes spread the risk, but add coordination overhead.

Simplicity versus precision. One policy per tier is easy to understand. Fine-tuning many settings might save a little money, but makes the system harder to reason about. Start simple, and add detail only when measurements show a need.

26Design Patterns and Anti-Patterns

Teams that have run autoscaled clusters repeat the same good habits, and the same avoidable mistakes.

Patterns That Work

Pattern 1

Tiered Lifecycle First

Design hot, warm, cold and frozen tiers with clear retention rules before turning on autoscaling. The lifecycle sets the shape, and autoscaling fills it.

Pattern 2

Proactive on Hot, Reactive Elsewhere

Use forecasting on the tier that receives bursts, and simple reactive sizing on tiers that grow slowly and predictably.

Pattern 3

Floor and Ceiling

Always set both a minimum for availability and a maximum for budget, with an alert well before the ceiling is reached.

Pattern 4

Schedule Plus Autoscale

Raise capacity on a schedule for known events, and let autoscaling handle the unexpected growth around it.

Pattern 5

Quotas at the Source

Limit how much any single application can send, so one bug cannot consume the whole budget.

Pattern 6

Rehearsed Manual Override

Keep a tested way to add or remove capacity by hand, in case the automation fails or must be paused.

Anti-Patterns to Avoid

ANTI-PATTERN 01Avoid
What people do

They expect autoscaling to handle a surge of search traffic.

Why it hurts

Autoscaling reasons about storage and memory, not query load. A traffic spike may overload the cluster while the recommendation stays unchanged, and nothing gets added.

Better approach

Plan search capacity separately with replicas, scheduled scaling before known events, and load tests. Check what your platform offers for traffic-based scaling.

ANTI-PATTERN 02Avoid
What people do

They use autoscaling instead of retention rules and keep all data on the hot tier forever.

Why it hurts

The cluster grows without limit, using the most expensive storage for data that nobody searches. The bill climbs steadily while value stays flat.

Better approach

Move data down the tiers and delete it on schedule. Let autoscaling size the tiers that remain.

ANTI-PATTERN 03Avoid
What people do

They set the maximum size very low to save money and never watch it.

Why it hurts

When a real surge arrives, the platform hits the ceiling and stops growing. Disks fill and writes fail, which is the very outage that autoscaling was meant to prevent.

Better approach

Set the maximum from your worst realistic need, add an alert at seventy or eighty percent of it and review it every quarter.

ANTI-PATTERN 04Avoid
What people do

They let the cluster fill with thousands of tiny shards and rely on adding nodes to cope.

Why it hurts

Each shard uses memory whatever its size. More nodes hide the waste but cost far more than fixing the shard layout would.

Better approach

Use rollover to keep shards a healthy size, merge small indices and choose shard counts to match data volume.

ANTI-PATTERN 05Avoid
What people do

They switch autoscaling on and never look at scaling events again.

Why it hurts

A runaway data source or a misconfigured policy can grow the cluster and the bill for weeks before anyone notices.

Better approach

Review scaling events on a regular schedule, alert on unusual growth and keep budget alerts active.

27Best Practices and Common Mistakes

A short list of habits that separate smooth autoscaling deployments from painful ones.

1

Understand your data first

Measure how much data each stream adds per day, how long each must be kept and how it is searched. Autoscaling works best when you understand the growth it is following.

2

Set lifecycle rules before limits

Tier and retention rules decide how much capacity is needed at all. Get them right before choosing minimum and maximum sizes.

3

Keep shards healthy

Use rollover to keep shards in a sensible size range, and avoid very large or very numerous shards.

4

Choose limits with care

A minimum for availability, a maximum for budget, and alerts before either is reached.

5

Test the worst night

Simulate a big surge in a test environment and time the whole path from growth to serving capacity.

6

Watch and review

Alert on watermarks and on the gap between required and current capacity, and review scaling history regularly.

Common Mistakes

  • Assuming traffic-based scaling. Expecting more search capacity when query load rises, when the feature follows storage and memory.
  • Forgetting the license or platform requirements. Discovering late that a tier or environment does not support autoscaling.
  • Comparing the recommendation with raw index sizes. Forgetting replicas and watermark room, and concluding the number must be wrong.
  • Leaving minimums too low. Allowing the cluster to shrink to a size that cannot survive the loss of a zone.
  • Ignoring shard layout. Growing nodes to hide the cost of oversized or too many shards.
  • No plan when the ceiling is hit. Having no alert or procedure for the moment the maximum limit blocks growth.

28Day-Two Operations: Living With Autoscaling

Turning autoscaling on is a day’s work. Living with it for years is the rest. These are the routine chores that keep it healthy.

Reviewing Limits Regularly

Data grows, budgets change and workloads evolve. Every quarter, look at each tier’s minimum and maximum. Ask whether the maximum is still right for your worst realistic need and your current budget. Ask whether the minimum still keeps you safe. Adjust when the answers change, and record why.

Reading the Capacity Reasons

Each decider explains its answer. Make a habit of reading these explanations when a big step happens. You may discover that a single huge shard forced a larger node size, that a new data stream doubled the hot requirement, or that a machine learning job needs more memory than expected. Every discovery suggests a fix that costs less than simply paying for more capacity.

Upgrades and Changes

Upgrading Elasticsearch or the orchestrator can change how recommendations are made or applied. Read the release notes for autoscaling changes, and test upgrades in a copy of your environment. Consider pausing scale-down during an upgrade window, so that shard moves do not pile up on top of the upgrade work.

Handling Planned Events

Before a big sale, a product launch or a migration, review your capacity. It is often wise to raise the minimum a little ahead of time so that the cluster starts the event with room to spare, then lower it again afterward. Autoscaling deals with the unexpected, and planning deals with the expected.

Everyday Analogy

A good farmer uses an automatic irrigation system that waters the fields when the soil is dry. But the farmer still walks the fields, checks the pipes and adjusts the settings for each season. Before a heat wave, the farmer raises the water level in advance. The system saves effort, and the farmer’s judgment keeps it working well.

Cleaning Up

Retire data streams and indices that no longer serve a purpose. Remove policies for tiers that no longer exist. Review machine learning jobs that were opened for a test and never closed, since they keep holding memory and keep the machine learning tier larger than needed.

*
Practical Tip

Put recurring chores on a calendar: limit review, scaling event review, budget check, retention review and runbook rehearsal. Chores that are scheduled tend to happen, while chores kept in memory tend to wait for the next incident.

29A Simple Troubleshooting Guide

When autoscaling seems to misbehave, an ordered set of checks finds the cause faster than guessing. Work from the calculation toward the machines.

1

Is the recommendation there?

Look at the capacity interface. Does each policy show a required capacity, and do the deciders explain their answers? If a tier is missing, it may have no policy.

2

Is required above current?

If required capacity equals or is below current capacity, the cluster is not asking for more. Then the trouble is elsewhere, perhaps CPU load or bad queries, which autoscaling does not address.

3

Is the orchestrator reading it?

Check that the orchestrator is running and can reach the cluster. Look at its logs for errors about credentials, permissions or network access.

4

Is a limit blocking growth?

Compare the required capacity with your maximum for the tier. If it is above, the platform will not go further, and a human must decide what to do.

5

Did the platform create machines?

Look at the platform’s activity log. Machine creation can fail because of quotas in your cloud account, missing instance types or capacity shortages in a zone.

6

Did new nodes join correctly?

Confirm that new nodes appear in the cluster with the right roles, and that shards are being placed on them. Check certificates and network rules if they do not.

Common Symptoms and First Guesses

SymptomFirst Thing To Check
Disk warnings but no growthWhether autoscaling is enabled for that tier and whether the maximum was reached
Recommendation is much larger than the sum of index sizesReplicas, watermark room and the size of the largest shard, as shown in the decider reasons
Cluster keeps growing every dayRetention rules, and a data stream that is growing faster than expected
Machine learning job waits and does not startLazy node settings, machine learning limits and platform machine creation
Slow searches during a resizeShard movement volume, relocation limits and timing of the resize
Search overload but no scalingAutoscaling does not track query load, so check replicas, query cost and search capacity separately
i
A Good Habit

Write this order into your runbook, and add each new lesson after every incident. Over time, it becomes the most useful page your team owns for autoscaling.

30Real-World Scenarios

The stories below are illustrative composites showing how different kinds of organizations use autoscaling. They are not accounts of specific companies.

A Streaming Service With Log Storms

A video streaming service keeps application logs on a hot tier for two days and on a warm tier for a month. Most of the time, the volume is steady. When a release goes wrong, error logs jump to many times normal. Proactive sizing on the hot tier adds capacity within minutes, and the lifecycle rules move the surge data down to cheaper storage after two days. Engineers never get a full-disk page during incidents.

An Online Retailer Before a Sale

A retailer knows that the yearly sale brings a large jump in orders and search events. Two days before, the team raises the minimum capacity of the hot tier, so the cluster starts with room to spare, and adds search replicas for the expected traffic. During the sale, autoscaling covers the unexpected data growth. After the sale, the minimum is lowered again.

A Security Team With Long Retention

A security operations team must keep a year of events for investigation, but only searches the last week regularly. They keep seven days on hot, ninety days on warm and the rest on frozen searchable snapshots. Autoscaling sizes each tier, and the frozen tier keeps costs low, since most of that data sits in object storage with a small local cache.

A Platform Team Running Anomaly Detection

A platform team runs anomaly detection jobs on hundreds of metrics. New jobs are added and old ones are closed all the time. The machine learning tier grows when new jobs open and shrinks after the cooling-off delay when they close. Jobs that arrive while capacity is being added wait as lazy jobs and then start once the new node joins.

A Startup Watching Its Budget

A small company runs a modest cluster on a hosted platform. It sets a low maximum on each tier, matched to its budget, and adds an alert at eighty percent. When data growth from a new feature pushes the hot tier toward the ceiling, the alert fires, and the team decides whether to raise the maximum or shorten the retention. Growth stays a decision, not a surprise.

31Common Myths and Misunderstandings

Half-true ideas about autoscaling cause wasted effort and bad surprises. Here are the ones that appear most often.

Myth 1

“Autoscaling adds nodes when CPU is high.”

It is driven by storage and memory needs, not by processor load or query traffic.

Myth 2

“Elasticsearch adds the nodes itself.”

Elasticsearch calculates the requirement. A separate orchestrator, such as a hosted platform or a Kubernetes operator, creates the machines.

Myth 3

“It reacts instantly.”

New nodes must start and receive shards. Expect minutes at least, and longer for big moves.

Myth 4

“It will keep my costs down by itself.”

It matches capacity to need, but need is shaped by your retention, shard design and data sources. Guardrails are still your job.

Myth 5

“It shrinks the cluster whenever things are quiet.”

Scale-down of data nodes is cautious, because shards must be moved first. Many platforms are conservative about it.

Myth 6

“It fixes a badly designed cluster.”

Too many shards, unbounded retention and heavy queries are not solved by adding capacity. They are just paid for.

Myth 7

“The recommended size should equal my data size.”

The requirement includes replicas and safety room under the disk watermarks, so it is larger than the raw size of your indices.

Myth 8

“Set it once and forget it.”

Limits, retention and workloads change. Regular review keeps the system safe and affordable.

i
A Healthy Attitude

Treat autoscaling as a helpful assistant, not a magician. It handles one kind of problem very well, namely running out of room, and it needs good design, sensible limits and human attention to do that well.

32Glossary of Terms

A quick reference for the important words in this guide, in plain language.

TermPlain Meaning
AutoscalingAutomatically calculating and changing cluster capacity to match need
Autoscaling policyA named set of rules, tied to node roles, that tells Elasticsearch which deciders to use
CapacityHow much storage and memory a group of nodes has or needs
Capacity APIThe interface that shows required and current capacity for every policy
ClusterA group of Elasticsearch nodes working together as one system
Cold tierNodes that hold rarely searched data on cheaper storage
Cooling-off periodA delay before scale-down, so the cluster does not grow and shrink repeatedly
Data streamA structure for time-based data that manages hidden backing indices behind one name
DeciderA piece of autoscaling logic that calculates required capacity for one kind of need
Flood stageThe disk level at which affected indices become read-only for writes, 95 percent by default
Frozen tierNodes that serve searchable snapshots from object storage with a local cache
Hot tierNodes that hold fresh, busy data on the fastest storage
ILMIndex Lifecycle Management, which moves indices through stages as they age
Lazy node settingA setting that lets machine learning jobs wait for capacity instead of failing to start
NodeOne Elasticsearch server in a cluster
Node roleA label saying what a node does, such as holding hot data or running machine learning
OrchestratorThe program that creates, resizes and removes machines based on the recommendation
Proactive deciderA decider that adds room for data expected to arrive soon
Reactive deciderA decider that sizes for the data that exists now
ReplicaAn extra copy of a shard that protects data and helps search
RolloverStarting a new index when the current one reaches a set size or age
Searchable snapshotAn index whose data lives in object storage but can still be searched
ShardOne piece of an index, stored and searched independently
WatermarkA disk usage level at which Elasticsearch takes protective action

33Frequently Asked Questions

Quick answers to the questions people ask most often when they first meet autoscaling.

Q1Does Elasticsearch add nodes by itself?
No. Elasticsearch calculates how much capacity each group of nodes requires and exposes it. A separate orchestrator, such as a hosted platform or the Kubernetes operator, reads that and creates or removes machines.
Q2What does autoscaling actually look at?
Mainly storage and memory. Storage deciders look at shard sizes and disk safety limits. Machine learning deciders look at the memory needed by jobs and models. Frozen deciders look at cache and memory for searchable snapshots.
Q3Will it add capacity when my search traffic spikes?
Not on its own. It does not follow query load or processor usage. Plan search capacity separately, using replicas, scheduled scaling or load testing.
Q4How fast does it react?
It is measured in minutes or longer, not milliseconds. New machines have to start and join, and shards have to be placed or moved. Keep a safety margin for bursts.
Q5Can it shrink my cluster automatically?
It depends on the tier and platform. Workloads that hold no data, such as machine learning nodes, are easier to scale down. Data nodes need their shards moved first, so many platforms are cautious about shrinking them automatically.
Q6Why is the recommended size bigger than my data?
The requirement includes replica copies and safety room under the disk watermarks, so shards can be placed and moved without filling disks. Read the reasons from each decider to see the exact cause.
Q7What happens if I reach my maximum limit?
The platform stops adding capacity, even if the recommendation is higher. Disks can then fill and writes can fail. Alert at seventy or eighty percent of the maximum and decide in advance what to do.
Q8Do I need to configure policies myself?
On hosted platforms, the platform manages policies when you turn autoscaling on, and you mostly choose limits. In self-managed setups with your own orchestrator, you create policies through the autoscaling interface.
Q9Is autoscaling free?
The feature is tied to Elastic’s paid subscription levels and hosted offerings, and the machines it adds cost money. Check the current documentation for what your subscription includes.
Q10What is the difference between reactive and proactive storage deciders?
The reactive decider sizes for the data that exists now. The proactive decider also adds room for the data expected within a short forecast window, based on recent growth.
Q11Does autoscaling work with machine learning?
Yes. The machine learning decider sums up the memory of open jobs and deployed models and requires enough node memory to run them, including a node large enough for the biggest job. With lazy node settings, jobs can wait for new capacity.
Q12Should I still use lifecycle management?
Yes. Lifecycle rules decide how much data lives on each tier and for how long. Autoscaling then sizes those tiers. Without lifecycle rules, autoscaling simply pays for endless growth.
Q13Can I use autoscaling on my own servers?
You can read the recommendation, but you must build the part that creates and removes machines. Many self-managed teams find this substantial work and choose a platform that already includes an orchestrator.
Q14How do I avoid surprise bills?
Set a maximum for every tier, alert well before it, use retention rules, put quotas on data sources and review scaling events regularly.
Q15What is the biggest reason autoscaling projects disappoint?
Expectation mismatch. People expect it to handle query traffic, react instantly or fix poor design. It is a tool for storage and memory capacity, and it works best on top of good lifecycle rules, healthy shards and sensible limits.

34Summary and Key Takeaways

Key Takeaways

  • Autoscaling in Elasticsearch has two halves. The cluster calculates how much storage and memory each group of nodes requires, and an orchestrator such as a hosted platform or Kubernetes operator adds or removes machines to match.
  • Policies and deciders drive the calculation. A policy is tied to node roles and holds deciders, including reactive and proactive storage, frozen deciders and a machine learning decider. The largest requirement wins.
  • Storage sizing includes safety room. The requirement covers replicas and space under the disk watermarks, so it is larger than the raw size of your data.
  • It is not traffic-based and not instant. It follows storage and memory, not query load or processor usage, and changes take minutes or longer, so plan search capacity and surges separately.
  • Scale-up is easy, scale-down is careful. Removing data nodes means moving shards first, so platforms are cautious, and a cooling-off delay prevents flapping.
  • Lifecycle rules and guardrails come first. Tiers, retention, healthy shard sizes, minimum and maximum limits and alerts decide how much autoscaling needs to buy and how much it may spend.
  • Watch it and rehearse the failure. Alert on watermarks and on the gap between required and current capacity, review scaling events regularly and keep a tested manual way to add capacity.