Performance overview

This page describes the approximate performance that Spanner can provide under optimal conditions, factors that can affect performance, and tips for testing and troubleshooting Spanner performance issues.

The information on this page applies to both GoogleSQL and PostgreSQL databases.

Performance and storage improvements

Performance and storage improvements are rolling out to all Spanner regional and multi-region instance configuration. These performance improvements should result in higher throughput and better latency in Spanner nodes in both regional and multi-region instance configurations. Increased throughput and storage are available in select instance configurations. You don't need to make any changes to your application or manually configure anything in your Spanner instances to take advantage of these improvements, which are offered at no additional cost.

Increased performance throughput

The following table provides the approximate throughput (queries per second) for instance configurations with improved performance. Each node (1,000 processing units) of compute capacity in the instance has up to 50% higher throughput.

Instance Configuration Type Peak Reads (QPS per region)   Peak Writes (QPS total)
Regional 22,500 or 3,500
Multi-region 15,000 or 2,700

Increased performance throughput is available for all Spanner instance configurations except:

  • Regional instance configurations: us-west4

  • Multi-region instance configurations: nam10, nam-eur-asia1

For information about the performance throughput of these instance configurations, see Performance for typical workloads.

Read guidance is given per region (because reads can be served from any read-write or read-only region), while write guidance is for the entire configuration. Read guidance assumes you're reading single rows of 1KB. Write guidance assumes that you're writing single rows at 1KB of data per row.

In general, both the read and write throughputs of a Spanner instance scale linearly as you add more compute capacity (nodes or processing units) to the instance. For example, if a single-region Spanner instance with 2 nodes can provide up to 45,000 reads per second, then a single-region Spanner instance with 4 nodes can provide up to 90,000 reads per second.

If you are not seeing desired performance for your workload from Spanner, see troubleshooting performance regressions for information about common causes.

Increased storage

For select Spanner regional and multi-region instance configurations, each node (1,000 processing units) of compute capacity in the instance has an increased storage capacity of 10 TB. The following table provides the instance configurations with increased storage available:

Regional instance configurations

africa-south1, asia-east1, asia-northeast2, asia-south1, asia-southeast1, australia-southeast1, europe-west3, europe-west4, southamerica-east1, us-central2, us-east1, us-east4, us-east7

Multi-region instance configurations

asia1, nam6, nam7, nam8, nam14

Performance for typical workloads

If the instance configuration you're using hasn't undergone improved performance throughput, then each node (1,000 processing units) of compute capacity in your instance can provide the following approximate throughput (queries per second):

Instance Configuration Type Peak Reads (QPS per region)   Peak Writes (QPS total)
Regional 15,000 or 2,300
Multi-region (Breakdown by base config) 10,000 or 1,800

For regional instance configurations that allow optional read-only replicas, the optional read-only replica can support an additional 5,000 reads per second.

Performance for multi-region configurations

Each Spanner multi-region instance configuration has slightly different performance characteristics based on the replication topology.

Each 1,000 processing units (1 node) of compute capacity can provide the following peak performance (at 100% CPU):

Base Configuration Name Approximate Peak Reads (QPS per region) Approximate Peak Writes (QPS total)
asia1 15,000 2,700
asia2 15,000 2,700
eur3 15,000 2,700
eur5 15,000 2,700
eur6 15,000
7,500 for each optional read-only replica
2,700
nam3 15,000
7,500 for each optional read-only replica
2,700
nam6 15,000 in us-central1 and us-east1
7,500 in us-west1 and us-west2 [1]
2,700
nam7 15,000
7,500 for each optional read-only replica
2,700
nam8 15,000 2,700
nam9 15,000 2,700
nam10 10,000 1,800
nam11 15,000
7,500 for each optional read-only replica
2,700
nam12 15,000 2,700
nam13 15,000 2,700
nam14 15,000 2,700
nam15 15,000 2,700
nam-eur-asia1 10,000 1,000
nam-eur-asia3 15,000 1,500
  • [1]: us-west1 and us-west2 provide only half of the QPS performance because they contain one replica per region instead of two.

Read guidance is given per region (because reads can be served from anywhere), while write guidance is for the entire configuration. Read and write guidance assume that you're reading and writing single rows at 1 KB of data per row.

Run your typical workloads against Spanner

Always run your own typical workloads against a Spanner instance when doing capacity planning, so you can figure out the best resource allocation for your applications. Google's PerfKit Benchmarker uses YCSB to benchmark cloud services. You can follow the PerfKitBenchmarker tutorial for Spanner to create tests for your own workloads. When doing so, you should tune the parameters in the benchmarking configuration yaml files to make sure that the generated benchmark reflects the following characteristics in your production environment:

Reproduce benchmark numbers

To reproduce the benchmark numbers, follow the Benchmarking Spanner with PerfKit Benchmarker tutorial using the corresponding yaml files in the throughput_benchmark folder.

To benchmark instances in an instance configuration that has undergone performance improvements, ensure that your tests are running in one of these improved instance configurations.

Zonal and regional failure protection

When running your workloads in production, it is important to provision enough compute capacity to continue to serve your traffic in the event of the loss of an entire zone (for regional instances) or an entire region (for multi-region instances). See alerts for high CPU utilization for more information on the recommended maximum CPU.

What's next