Before you begin
- TPC-C provides the most realistic and objective measure for OLTP performance at various scale factors. Before you get started, consider reviewing what TPC-C is and how it is measured.
- Make sure you have already installed CockroachDB.
Step 1. Start CockroachDB
The
--insecure flag used in this tutorial is intended for non-production testing only. To run CockroachDB in production, use a secure cluster instead.cockroach demo command to start a simulated multi-region cluster with 9 nodes:
You must use the IP address shown at the SQL prompt to run the following steps.This is necessary because the demo cluster may use a randomly allocated local IP that is not the
127.0.0.1 shown here.Step 2. Import the TPC-C dataset
CockroachDB comes with a number of built-in workloads for simulating client traffic. This step features CockroachDB’s version of the TPC-C workload. In a second terminal window (call it terminal 2), usecockroach workload to load the initial schema and data:
ZONE survival goal.
Step 3. Run the benchmark
Run the workload for 10 “warehouses” of data for ten minutes. In order to spread the simulated workload across the 3 regions specified in the previous step, you will need to start each of the following commands from 3 different terminals: In terminal 2:Step 4. Interpret the results
Once theworkload has finished running, you’ll see a final output line in each terminal window.
In terminal 2:
SKIPPED due to insufficient data since this is a small run on a small machine. For a more comprehensive test, run workload for a longer duration (e.g., two hours). The tpmC (new order transactions/minute) number is the headline number and efc (“efficiency”) tells you how close CockroachDB gets to theoretical maximum tpmC. In a perfect execution, the sum of efficiency across all partitions would be 100%.
Step 5. Clean up
When you’re done with your test cluster, switch back to terminal 1 wherecockroach demo is still running and issue \q at the SQL prompt to gracefully shut down the demo cluster.

