Stay organized with collections
Save and categorize content based on your preferences.
This page explains how autoscaling works in Spanner, and introduces
the two types of autoscaling you can use in Spanner.
Scaling Spanner
When you create a Spanner instance,
you choose the number of compute capacity nodes or processing
units to use when serving your data. However,
there are times when the workload might increase or decrease. Scaling an
instance is the process of adding or removing compute capacity in response to
changes in the instance's workload or data storage needs.
It can be useful to scale your Spanner instance based on metrics
such as the instance's CPU usage. For example, if your instance is under a heavy
load and its CPU utilization is high, you can temporarily add compute capacity
and remove it again when its CPU usage drops. Removing compute capacity from the
instance when it doesn't have heavy usage lowers costs.
You can't resolve all Spanner performance issues by adding
compute capacity. For example, scaling up an instance can't solve problems that
occur that are unrelated to the instance size, such as lock contention and
hotspots.
There are two ways that you can scale your Spanner instance to
meet workload changes:
Configure your instance manually to add or remove compute capacity.
Configure autoscaling on your instance so that compute capacity
automatically scales up or down to meet workload levels.
Requirements on this page apply to both the managed autoscaling feature and the
open source Autoscaler tool.
When to use autoscaling
The benefits of autoscaling include the following:
Costs: Autoscaling reduces costs by decreasing compute capacity during
off-peak hours, which helps avoid over-provisioning.
Performance: Autoscaling lets Spanner automatically add
compute capacity to an instance when a workload changes or there is an
increase in data storage requirements. This helps maintain workload
performance objectives by ensuring that the instance has enough compute
capacity to meet the target CPU utilization and storage requirements.
Automation: Autoscaling reduces management complexity. You don't need
to monitor and scale the instance size manually. With managed autoscaling,
you don't write an application to do these tasks, because the
Spanner service handles them for you.
Autoscaling is often the best choice for the following situations:
Steady diurnal or cyclical traffic patterns, such as those generated by
online banking systems.
New applications expecting organic growth.
Workloads that are new to Spanner.
Although Spanner quickly adds compute capacity when traffic
increases, it can take time to balance the additional capacity.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Hard to understand","hardToUnderstand","thumb-down"],["Incorrect information or sample code","incorrectInformationOrSampleCode","thumb-down"],["Missing the information/samples I need","missingTheInformationSamplesINeed","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2025-08-07 UTC."],[],[],null,["# Autoscaling overview\n\nThis page explains how autoscaling works in Spanner, and introduces\nthe two types of autoscaling you can use in Spanner.\n\nScaling Spanner\n---------------\n\nWhen you create a [Spanner instance](/spanner/docs/instances),\nyou choose the number of [compute capacity nodes or processing\nunits](/spanner/docs/compute-capacity) to use when serving your data. However,\nthere are times when the workload might increase or decrease. *Scaling* an\ninstance is the process of adding or removing compute capacity in response to\nchanges in the instance's workload or data storage needs.\n\nIt can be useful to scale your Spanner instance based on metrics\nsuch as the instance's CPU usage. For example, if your instance is under a heavy\nload and its CPU utilization is high, you can temporarily add compute capacity\nand remove it again when its CPU usage drops. Removing compute capacity from the\ninstance when it doesn't have heavy usage lowers costs.\n\nYou can't resolve all Spanner performance issues by adding\ncompute capacity. For example, scaling up an instance can't solve problems that\noccur that are unrelated to the instance size, such as lock contention and\nhotspots.\n\nThere are two ways that you can scale your Spanner instance to\nmeet workload changes:\n\n- Configure your instance manually to add or remove compute capacity.\n- Configure autoscaling on your instance so that compute capacity automatically scales up or down to meet workload levels.\n\nFor autoscaling, you have the following options:\n\n- Configure [Spanner managed autoscaling](/spanner/docs/managed-autoscaler).\n- Set up the open source [Autoscaler tool for Spanner](/spanner/docs/autoscaler-tool-overview).\n\nRequirements on this page apply to both the managed autoscaling feature and the\nopen source Autoscaler tool.\n\nWhen to use autoscaling\n-----------------------\n\nThe benefits of autoscaling include the following:\n\n- **Costs:** Autoscaling reduces costs by decreasing compute capacity during off-peak hours, which helps avoid over-provisioning.\n- **Performance:** Autoscaling lets Spanner automatically add compute capacity to an instance when a workload changes or there is an increase in data storage requirements. This helps maintain workload performance objectives by ensuring that the instance has enough compute capacity to meet the target CPU utilization and storage requirements.\n- **Automation:** Autoscaling reduces management complexity. You don't need to monitor and scale the instance size manually. With managed autoscaling, you don't write an application to do these tasks, because the Spanner service handles them for you.\n\nAutoscaling is often the best choice for the following situations:\n\n- Steady diurnal or cyclical traffic patterns, such as those generated by online banking systems.\n- New applications expecting organic growth.\n- Workloads that are new to Spanner.\n\nAlthough Spanner quickly adds compute capacity when traffic\nincreases, it can take time to balance the additional capacity.\n\nWhat's next\n-----------\n\n- Learn more about [Managed autoscaler for Spanner](/spanner/docs/managed-autoscaler)\n - Learn how to [create an instance with the managed autoscaler enabled](/spanner/docs/create-manage-instances#create-instance)\n - Learn how to [modify an instance to add autoscaling or change autoscaling settings](/spanner/docs/create-manage-instances#modify-managed-autoscaler)\n - Learn how to [change an instance from using autoscaling to manual scaling](/spanner/docs/create-manage-instances#remove-managed-autoscaler)\n- Learn more about the [Autoscaler tool for Spanner](/spanner/docs/autoscaler-tool-overview)"]]