Skip to main content
Version: 5.1.2

Built-in Workloads

Stroppy ships with embedded workload scripts and SQL files. You can run them without generating a workspace:

stroppy run simple
stroppy run tpcb/tx
stroppy run tpcb/procs
stroppy run tpcc/tx
stroppy run tpcc/procs
stroppy run tpch/tx
stroppy run tpcds tpcds-scale-100
stroppy run execute_sql

Each workload is a TypeScript script bundled with any SQL files it needs. Stroppy resolves them through the standard search path; see stroppy help resolution for details.

Available Presets

PresetDescriptionScript variantsSQL variants
simpleMinimal smoke workload that creates, loads, verifies, and drops a small demo table.simple.tsnone
tpcbTPC-B style banking transaction.tx.ts, procs.tspg.sql, mysql.sql, pico.sql, ydb.sql for tx; pg.sql, mysql.sql for procs
tpccTPC-C OLTP workload with five weighted transaction types.tx.ts, procs.tspg.sql, mysql.sql, pico.sql, ydb.sql; procs supports PostgreSQL/MySQL
tpchTPC-H analytical schema load and Q1-Q22 execution.tx.tspg.sql, mysql.sql, pico.sql, ydb.sql
tpcdsTPC-DS analytical query runner.tpcds.tsscale-factor SQL files
execute_sqlGeneric SQL file or inline SQL runner.execute_sql.tsuser-provided

simple

simple is a first-run smoke test and a small example of the current InsertSpec API.

stroppy run simple
stroppy run simple -d noop
stroppy run simple -d pg -D url=postgres://user:pass@host:5432/postgres

What it does:

  1. Drops stroppy_demo if it exists.
  2. Creates stroppy_demo (id INT PRIMARY KEY, label TEXT, value INT).
  3. Loads 100 deterministic rows with Rel.table(...) and driver.insertSpec(...).
  4. Validates the row count.
  5. Performs three row lookups with DrawRT.
  6. Drops the table in teardown.

Steps:

StepWhat it does
drop_schemaDrops stroppy_demo.
create_schemaCreates the demo table.
load_dataLoads 100 rows with InsertSpec.
workloadValidates count and performs lookups.

The workload uses a fixed shared-iterations scenario with one VU and one iteration. Use tpcb/tx or tpcc/tx when you want a duration/VU throughput run.

tpcb

TPC-B models a simple banking transaction: update an account balance, update teller and branch totals, and insert a history row. It is the workload behind pgbench and is useful for transactional throughput testing.

Running

stroppy run tpcb/tx -d pg
stroppy run tpcb/tx -d pg -e scale_factor=10 -- --duration 5m --vus 32
stroppy run tpcb/procs -d mysql

Use tpcb/tx for portable client-side transactions across PostgreSQL, MySQL, Picodata, and YDB. Use tpcb/procs for PostgreSQL/MySQL stored procedure mode.

Parameters

ENV variableDefaultVariantDescription
SCALE_FACTOR, BRANCHES1bothNumber of branches. Tellers = 10 x scale; accounts = 100,000 x scale.
POOL_SIZE50bothPrimary driver pool size.
LOAD_WORKERS0tpcb/txParallel InsertSpec workers during load. 0 lets the framework choose.
SQL_FILE<auto>bothSQL file path. Defaults to a dialect file based on driverType.
TX_ISOLATION<auto>tpcb/txOverrides transaction isolation. Defaults are driver-specific.

Steps

StepVariantWhat it does
drop_schemabothDrops existing TPC-B objects.
create_schemabothCreates pgbench_branches, pgbench_tellers, pgbench_accounts, and pgbench_history.
create_procedurestpcb/procsCreates PostgreSQL/MySQL stored procedures.
load_databothLoads branches, tellers, and accounts with InsertSpec.
workloadbothRuns the transaction loop.
stroppy run tpcb/tx --steps drop_schema,create_schema,load_data
stroppy run tpcb/tx --steps workload
stroppy run tpcb/tx --no-steps drop_schema

SQL variants

tpcb/tx selects SQL by driver type:

Driver typeSQL file
postgrestpcb/pg.sql
mysqltpcb/mysql.sql
picodatatpcb/pico.sql
ydbtpcb/ydb.sql

tpcb/procs supports PostgreSQL and MySQL only.

tpcc

TPC-C loads a warehouse schema and runs the standard 45/43/4/4/4 mix of New-Order, Payment, Order-Status, Delivery, and Stock-Level transactions.

stroppy run tpcc/tx -d pg
stroppy run tpcc/tx -d pg -e warehouses=10 -- --vus 32 --duration 30m
stroppy run tpcc/procs -d mysql

Use tpcc/tx for portable client-side transactions across PostgreSQL, MySQL, Picodata, and YDB. Use tpcc/procs for PostgreSQL/MySQL stored procedures.

Common parameters:

ENV variableDefaultVariantDescription
POOL_SIZE100bothPrimary driver pool size.
SCALE_FACTOR, WAREHOUSES1bothNumber of warehouses.
LOAD_WORKERS0tpcc/txParallel InsertSpec workers during load.
RETRY_ATTEMPTS3bothAttempts for retryable serialization failures.
PACINGfalsetpcc/txEnable TPC-C keying and think-time delays.
SQL_FILE<auto>bothSQL file path selected by driver type.
TX_ISOLATION<auto>bothOverride transaction isolation.

Core steps are drop_schema, create_schema, load_data, and workload. tpcc/procs adds create_procedures; tpcc/tx adds create_indexes and validate_population where dialect files define them.

TPC-C defines k6 thresholds for the per-transaction latency trends. The post-run summary also reports observed transaction mix, compliance ratios, retry counts, and Stroppy driver/transaction metrics.

See TPC-C for the full test article.

tpch

TPC-H loads the eight-table analytical schema and runs Q1 through Q22 once with pinned query parameters.

stroppy run tpch/tx -d pg -e scale_factor=0.01
stroppy run tpch/tx -d mysql -e scale_factor=0.01
stroppy run tpch/tx -d pg -e scale_factor=1

Use SCALE_FACTOR=0.01 for smoke tests. PostgreSQL at SCALE_FACTOR=1 validates query output against embedded SF=1 reference answers.

Parameters:

ENV variableDefaultDescription
POOL_SIZE50Primary driver pool size.
SCALE_FACTOR1TPC-H scale factor; 0.01 is supported for smoke tests.
LOAD_WORKERS0Parallel InsertSpec workers during load.
SQL_FILE<auto>SQL file path selected by driver type.
TX_ISOLATION<auto>Override transaction isolation.

Steps are drop_schema, create_schema, load_data, set_logged, create_indexes, finalize_totals, queries, validate_answers, and workload.

See TPC-H for the full test article.

tpcds

The TPC-DS workload runs analytical read-only queries from a supplied scale-factor SQL file. It does not create tables or load data; it assumes you have already loaded a TPC-DS dataset at the selected scale.

stroppy run tpcds tpcds-scale-1
stroppy run tpcds tpcds-scale-100
stroppy run tpcds tpcds-scale-10000

The second argument selects the SQL file. There is no default because the correct query set depends on dataset size.

Available embedded files:

Scale factorFileUsage
1tpcds-scale-1.sqlstroppy run tpcds tpcds-scale-1
10tpcds-scale-10.sqlstroppy run tpcds tpcds-scale-10
100tpcds-scale-100.sqlstroppy run tpcds tpcds-scale-100
300tpcds-scale-300.sqlstroppy run tpcds tpcds-scale-300
1,000tpcds-scale-1000.sqlstroppy run tpcds tpcds-scale-1000
3,000tpcds-scale-3000.sqlstroppy run tpcds tpcds-scale-3000
10,000tpcds-scale-10000.sqlstroppy run tpcds tpcds-scale-10000
30,000tpcds-scale-30000.sqlstroppy run tpcds tpcds-scale-30000
50,000tpcds-scale-50000.sqlstroppy run tpcds tpcds-scale-50000
100,000tpcds-scale-100000.sqlstroppy run tpcds tpcds-scale-100000

The script runs with one VU and one iteration: a single pass through all queries.

execute_sql

execute_sql runs every query from a SQL file or inline SQL string. It powers the .sql and inline SQL input modes.

# SQL file mode
stroppy run queries.sql

# Inline SQL mode
stroppy run "select count(*) from orders"
stroppy run "create table foo (id int)"

SQL_FILE is set automatically when you pass a SQL file. The script parses flat SQL with parse_sql and executes each query with driver.exec().

SQL File Selection

Current multi-dialect built-ins generally select SQL inside the script by driverType. The runner still supports explicit SQL resolution:

  1. A second positional argument is resolved as a SQL file and takes priority.
  2. SQL_FILE can be set explicitly through the environment or -e.
  3. If neither is set, the script usually chooses pg.sql, mysql.sql, pico.sql, or ydb.sql from the active driver type.

Examples:

stroppy run tpcc/tx tpcc/pico -d pico
stroppy run tpch/tx tpch/pg -d pg
stroppy run tpcds tpcds-scale-1000
stroppy run tpcc/tx -e sql_file=./custom.sql

Workload Variants

Many presets ship with multiple script variants:

VariantFileDescription
txtx.tsClient-side transaction variant. Portable when dialect files exist for the target.
procsprocs.tsStored-procedure variant. Used by TPC-B/TPC-C on PostgreSQL and MySQL.
scale SQL*.sqlAnalytical SQL variants selected as the second positional argument, such as TPC-DS scale files.