Skip to main content
Version: 6.0.0

TPC-C

TPC-C is Stroppy's mixed OLTP workload. It loads warehouses, districts, customers, orders, stock, and items, then runs the standard 45/43/4/4/4 transaction mix.

Use it to evaluate:

  • throughput and tail latency under contention;
  • lock, deadlock, and serialization behavior;
  • retry rates;
  • connection-pool scaling;
  • primary/secondary index performance;
  • client round-trip cost versus stored procedures.

Variants​

WorkloadExecutionDrivers
tpcc/txOrdered SQL in driver transactionsPostgreSQL, MySQL, Picodata (none), YDB
tpcc/procsOne stored procedure call per transactionPostgreSQL, MySQL
stroppy run tpcc/tx -d pg \
--scale-factor 10 \
--executor constant-vus --vus 32 --duration 5m

stroppy run tpcc/procs -d mysql \
--scale-factor 10 --iterations 100

Transaction mix​

TransactionTarget shareWork
New-Order45%Create order/order lines, update district and stock, exercise required invalid-item rollback.
Payment43%Update warehouse, district, customer, and history.
Order-Status4%Read customer, latest order, and order lines.
Delivery4%Process oldest new order in each district and update balances.
Stock-Level4%Count low-stock items from recent orders.

Without pacing, Stroppy drives raw throughput. --pacing=true adds TPC-C keying and think times to both tx and procs.

Scale and initial population​

--scale-factor is integer warehouse count W (legacy environment alias WAREHOUSES).

TableRows
warehouseW
district10 × W
customer30,000 × W
item100,000 global rows
stock100,000 × W
orders30,000 × W
order_line300,000 × W initial fixed mean
new_order9,000 × W
history0; grows during Payment

Population generation preserves NURand surnames, per-district customer permutations, decimal scales, credit/delivery splits, fixed-width fields, and ORIGINAL markers. Initial order lines use ten rows per order; measured New-Order transactions choose 5–15.

Parameters​

FlagDefaultMeaning
--scale-factor1Warehouse count.
--warehouse-start1First warehouse ID in distributed slice.
--load-itemscontextualLoad global item table; true by default only at warehouse 1.
--load-workers1Workers per table load.
--pacingfalseApply keying and think times.
--retry-attempts3Maximum transaction attempts.
--pg-unloggedfalseOpt into PostgreSQL unlogged loading.
--tx-isolationdriver-derivedIsolation override.
--sql-fileselected dialectSQL override.

Shared flags: --executor, --vus, --iterations, --duration, and --query-timeout.

Default isolation:

DriverIsolation
PostgreSQLrepeatable_read
MySQLrepeatable_read
Picodatanone
YDBserializable

Distributed warehouse loading​

Several Stroppy processes can load disjoint ranges:

# Schema, item table, warehouses 1..100.
stroppy run tpcc/tx -d pg --warehouse-start 1 --scale-factor 100 \
--steps drop_schema,create_schema,load_data,validate_population

# Warehouses 101..200; item table is skipped by contextual default.
stroppy run tpcc/tx -d pg --warehouse-start 101 --scale-factor 100 \
--steps load_data,validate_population

Each VU is pinned to a home warehouse inside its configured slice. Remote warehouse choices stay inside that slice. Population validation scopes warehouse-dependent checks to the same range.

On YDB, create schema once using total warehouse count so generated partition keys cover all loaders. Subsequent processes should skip schema creation.

Steps​

StepMeaning
drop_schemaRemove tables and routines.
create_schemaCreate nine tables; render YDB partition keys in Go.
create_proceduresCreate procedures for tpcc/procs.
set_unloggedOpt-in PostgreSQL pre-load transition.
load_dataLoad eight populated tables; history stays empty.
create_indexesCreate customer-name/order indexes after load.
set_loggedRestore PostgreSQL durability after unlogged load.
create_foreign_keysAdd PostgreSQL/MySQL references after logging.
analyzeRefresh PostgreSQL/MySQL planner statistics.
validate_populationRun cardinality and TPC-C consistency checks.
workloadExecute measured five-transaction mix.

A population mismatch is structural and makes the command exit nonzero.

Load then measure:

stroppy run tpcc/tx -d pg --scale-factor 10 --load-workers 8 \
--no-steps workload

stroppy run tpcc/tx -d pg --scale-factor 10 \
--executor constant-vus --vus 64 --duration 10m \
--steps workload

SQL assets​

Drivertxprocs
PostgreSQLworkloads/tpcc/pg.sqlsame asset
MySQLworkloads/tpcc/mysql.sqlsame asset
Picodataworkloads/tpcc/pico.sqlunsupported
YDBworkloads/tpcc/ydb.sqlunsupported

ydb_no_indexes.sql is an embedded comparison schema. Local override example:

stroppy run tpcc/tx ./workloads/tpcc/ydb_no_indexes.sql -d ydb

Metrics and report​

TPC-C adds:

  • per-transaction attempt counters;
  • per-transaction duration histograms;
  • transaction mix observations;
  • required rollback decisions/completions;
  • remote New-Order line and Payment observations;
  • by-name and bad-credit selections;
  • retry counter.

The final report gives count, mix, throughput, and p50/p90/p95/p99 response time for every transaction type. Paced runs additionally receive TPC-C §5.2.5 response-time and mix verdicts, statistical-validity status, and steady-state assessment. Unpaced runs mark compliance not applicable.

Core transaction/query/terminal-error metrics are described in Reports & Workflow.

Retry and continuation​

TPC-C retries classified serialization, deadlock, lock-timeout, and selected transient errors up to --retry-attempts. A successful retry is counted without failing the iteration. A terminal nonfatal error fails one iteration, lets the VU continue, and appears in final error summary while command exits 0.

Integration coverage​

make tmpfs-up
make build
make integration
make tmpfs-down

Reference implementation: