Skip to main content
This page shows you how to reproduce . Across all scales, CockroachDB can process tpmC (new order transactions per minute) at near maximum efficiency. Start by choosing the scale you’re interested in:
WorkloadCluster sizeWarehousesData size
Local3 nodes on your laptop102 GB
Local (multi-region)9 in-memory nodes on your laptop using cockroach demo102 GB
Small3 nodes on c5d.4xlarge machines2500200 GB
Medium15 nodes on c5d.4xlarge machines13,0001.04 TB
Large81 nodes on c5d.9xlarge machines140,00011.2 TB

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.
  1. In separate terminal windows, use the command to start 3 nodes:
  2. Use the command to perform a one-time initialization of the cluster:

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. Use to load the initial schema and data:
This will load 2 GB of data for 10 “warehouses”.

Step 3. Run the benchmark

Run the workload for ten “warehouses” of data for ten minutes:
You’ll see per-operation statistics every second:
For more tpcc options, use cockroach workload run tpcc --help. For details about other built-in load generators, use cockroach workload run --help.

Step 4. Interpret the results

Once the workload has finished running, you’ll see a final output line:
You will also see some audit checks and latency statistics for each individual query. For this run, some of those checks might indicate that they were SKIPPED due to insufficient data. 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. The TPC-C specification has p90 latency requirements in the order of seconds, but as you see here, CockroachDB far surpasses that requirement with p90 latencies in the tens of milliseconds.

Step 5. Clean up

  1. When you’re done with your test cluster, stop the nodes. Get the process IDs of the nodes:
    Gracefully shut down each node, specifying its process ID:
For the last node, the shutdown process will take longer (about a minute) and will eventually stop the node. This is because, with only 1 of 3 nodes left, all ranges no longer have a majority of replicas available, and so the cluster is no longer operational.
  1. To restart the cluster at a later time, run the same cockroach start commands as earlier from the directory containing the nodes’ data stores. If you do not plan to restart the cluster, you may want to remove the nodes’ data stores: