tree: c2bab1b523176000eeba5b35496020d1e756cb77
  1. benchmarks.go
  2. CHANGES.md
  3. go.mod
  4. go.sum
  5. README.md
spanner/benchmarks/README.md

Spanner Benchmarking

This module supports running performance benchmarking in Go against Production and Cloud devel environments.

It supports stale reads and queries.

By default, it leverages the latest released version of spanner. For local development, you might want to point at head via something like replacement:

cd spanner/benchmarks
go mod edit -replace cloud.google.com/go/spanner=../

Commands

go run spanner/benchmarks/benchmarks.go <option1> <value1> <option2> <value2> ...

Please look at the Configurations section for allowed options and values.

Environmental variables

Environment VariableDescriptionPossible values
SPANNER_CLIENT_BENCHMARK_GOOGLE_CLOUD_PROJECTTo configure project id of the spanner instanceany valid project ID
SPANNER_CLIENT_BENCHMARK_SPANNER_INSTANCETo configure instance id of the spanner instanceany valid instance ID in the same project
SPANNER_CLIENT_BENCHMARK_SPANNER_DATABASETo configure database name in the spanner instanceany valid database ID in the same instance
SPANNER_CLIENT_BENCHMARK_CLOUD_ENVIRONMENTTo configure spanner environmentPRODUCTION, DEVEL

Configurations

ConfigDescriptionShort OptionLong OptionDefault
Warm up timeTotal warm up time before running actual benchmarking-wu-warmUpTime7 mins
Execution timeTotal execution time of benchmarking-et-executionTime30 mins
Wait between requestsTotal wait time between two requests. After executing a request script will wait for sometime before starting the next request. Usually it will wait 2X time of configured value.-wbr-waitBetweenRequests5 ms
StalenessTotal Staleness for Reads and Queries-st-staleness15 secs
Transaction TypeTransaction type of benchmarking, read or query.. etcNA-transactionTyperead
Traces EnabledTo decide if traces should be enabled or not-te-tracesEnabledfalse
Disable Native MetricsTo decide if built-in metrics should be disabled-dnm-disableNativeMetricsfalse
Trace Sampling FractionTo configuring trace sampling fraction. 0 - No sampling, >= 1 - Always sample-tsf-traceSamplingFraction0.5

Other configurations

To enable some application specific configurations, you can reference the following table.

DescriptionEnvironment variable
Enabling directpathGOOGLE_SPANNER_ENABLE_DIRECT_ACCESS=true

Note: Multiplexed sessions are always enabled and cannot be disabled. The session pool has been removed.