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 .
- Make sure you have already .
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.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 for simulating client traffic. This step features CockroachDB’s version of the TPC-C workload. In a second terminal window (call it terminal 2), use to load the initial schema and data: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 where is still running and issue\q at the SQL prompt to gracefully shut down the demo cluster.

