Autoscaling overview Stay organized with collections Save and categorize content based on your preferences.
This page explains how autoscaling works in Spanner, and introducesthe two types of autoscaling you can use in Spanner.
Scaling Spanner
When you create aSpanner instance,you choose the number ofcompute capacity nodes or processingunits to use when serving your data. However,there are times when the workload might increase or decrease.Scaling aninstance is the process of adding or removing compute capacity in response tochanges in the instance's workload or data storage needs.
It can be useful to scale your Spanner instance based on metricssuch as the instance's CPU usage. For example, if your instance is under a heavyload and its CPU utilization is high, you can temporarily add compute capacityand remove it again when its CPU usage drops. Removing compute capacity from theinstance when it doesn't have heavy usage lowers costs.
You can't resolve all Spanner performance issues by addingcompute capacity. For example, scaling up an instance can't solve problems thatoccur that are unrelated to the instance size, such as lock contention andhotspots.
There are two ways that you can scale your Spanner instance tomeet workload changes:
- Configure your instance manually to add or remove compute capacity.
- Configure autoscaling on your instance so that compute capacityautomatically scales up or down to meet workload levels.
For autoscaling, you have the following options:
- ConfigureSpanner managed autoscaling.
- Set up the open sourceAutoscaler tool for Spanner.
Requirements on this page apply to both the managed autoscaling feature and theopen source Autoscaler tool.
When to use autoscaling
The benefits of autoscaling include the following:
- Costs: Autoscaling reduces costs by decreasing compute capacity duringoff-peak hours, which helps avoid over-provisioning.
- Performance: Autoscaling lets Spanner automatically addcompute capacity to an instance when a workload changes or there is anincrease in data storage requirements. This helps maintain workloadperformance objectives by ensuring that the instance has enough computecapacity to meet the target CPU utilization and storage requirements.
- Automation: Autoscaling reduces management complexity. You don't needto monitor and scale the instance size manually. With managed autoscaling,you don't write an application to do these tasks, because theSpanner 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 byonline banking systems.
- New applications expecting organic growth.
- Workloads that are new to Spanner.
Although Spanner quickly adds compute capacity when trafficincreases, it can take time to balance the additional capacity.
What's next
- Learn more aboutManaged autoscaler for Spanner
- Learn more about theAutoscaler tool for Spanner
Except as otherwise noted, the content of this page is licensed under theCreative Commons Attribution 4.0 License, and code samples are licensed under theApache 2.0 License. For details, see theGoogle Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2026-02-06 UTC.