Before you begin
Review TPC-C concepts
TPC-C provides the most realistic and objective measure for OLTP performance at various scale factors. Before you get started, consider reviewing .Step 1. Set up the environment
Provision VMs
- Create 4 VM instances, 3 for CockroachDB nodes and 1 for the TPC-C workload.
- Create all instances in the same region and the same security group.
- Use the
c5d.4xlargemachine type. - Use local SSD instance store volumes. Local SSDs are low latency disks attached to each VM, which maximizes performance. This configuration best resembles what a bare metal deployment would look like, with machines directly connected to one physical disk each. We do not recommend using network-attached block storage.
- Note the internal IP address of each instance. You’ll need these addresses when starting the CockroachDB nodes.
This configuration is intended for performance benchmarking only. For production deployments, there are other important considerations, such as security, load balancing, and data location techniques to minimize network latency. For more details, see the .
Configure your network
CockroachDB requires TCP communication on two ports:26257for inter-node communication (i.e., working as a cluster) and for the TPC-C workload to connect to nodes8080for exposing your DB Console
Inter-node and TPCC-to-node communication
DB Console
Step 2. 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.- SSH to the first VM where you want to run a CockroachDB node.
- .
-
Run the command:
-
Repeat steps 1 - 3 for the other 2 VMs for CockroachDB nodes. Each time, be sure to adjust the
--advertise-addrflag. -
On any of the VMs with the
cockroachbinary, run the one-time command to join the first nodes into a cluster:
Step 3. 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.- SSH to the VM where you want to run TPC-C.
- .
-
Import the TPC-C dataset:
This will load 200 GB of data for 2500 “warehouses”. This can take a while to complete. You can monitor progress on the Jobs screen of the DB Console. Open the by pointing a browser to the address in the
adminfield in the standard output of any node on startup.
Step 4. Run the benchmark
-
Still on the same VM, create an
addrsfile containing connection strings to the 3 CockroachDB nodes: -
Run TPC-C for 30 minutes:
Step 5. Interpret the results
Once the workload has finished running, you will see a result similar to the following. The efficiency and latency can be combined to determine whether this was a passing run. You should expect to see an efficiency number above 95%, well above the required minimum of 85%, and p95 latencies well below the required maximum of 10 seconds.See also
- Hardware CockroachDB works well on commodity hardware in public cloud, private cloud, on-prem, and hybrid environments. For hardware recommendations, see our .
- Performance tuning For guidance on tuning a real workload’s performance, see , and for guidance on techniques to minimize network latency in multi-region or global clusters, see .

