Workload#

The workload command runs a built-in workload without needing a config file. Sixteen benchmarks are embedded in the binary. Each workload supports all lifecycle commands (up, seed, run, deseed, down, all) and selects the correct config for the --driver automatically.

Built-in workloads#

WorkloadDescription
bankBank account operations for contention and correctness testing
ch-benchmarkCH-benCHmark mixed OLTP+OLAP (TPC-C transactions + TPC-H analytical queries)
consistencyConcurrency anomaly stress test (dirty reads, phantoms, write skew, lost updates)
kvSimple key-value read/write benchmark
movrVehicle-sharing application with rides, vehicles, and users
seatsAirline reservation system with flight booking contention
sysbench-insertSysbench oltp_insert pure insert micro-benchmark
sysbench-point-selectSysbench oltp_point_select pure read micro-benchmark
sysbench-read-writeSysbench oltp_read_write mixed read-write micro-benchmark
sysbench-update-indexSysbench oltp_update_index indexed column update micro-benchmark
tatpTelecom Application Transaction Processing (80% reads, 20% writes)
tpccFull TPC-C benchmark with all 5 transaction profiles
tpchTPC-H decision-support benchmark with analytical queries
ttlbenchInsert throughput under row-level TTL garbage collection pressure
ttlloggerStructured log ingestion with TTL-based expiry
ycsbYahoo! Cloud Serving Benchmark with configurable workload profiles

Supported drivers#

DriverConfig used
pgx, dsqlCockroachDB/PostgreSQL variant
mysqlMySQL variant
oracleOracle variant
mssqlSQL Server variant
spannerGoogle Cloud Spanner variant (GoogleSQL)
mongodbMongoDB variant (BSON/JSON commands)
cassandraCassandra variant (CQL)
sqliteSQLite variant
redisRedis / Valkey variant (commands), kv and ycsb only

Not every workload models every driver. A workload with no config for the requested driver fails up front with workload "tpcc" has no config for driver "redis" rather than running a partial schema.

SQLite allows a single writer at a time, so write-heavy workloads run with more than one worker will report database is locked (5) (SQLITE_BUSY) unless the connection URL enables WAL and a busy timeout. See SQLite concurrency.

Examples#

# Create the bank schema
edg workload bank up \
--driver pgx \
--url "postgres://root@localhost:26257?sslmode=disable"

# Seed and run in one step
edg workload bank all \
--driver pgx \
--url "postgres://root@localhost:26257?sslmode=disable" \
-w 10 \
-d 5m

# Run consistency anomaly stress test
edg workload consistency all \
--driver pgx \
--url "postgres://root@localhost:26257?sslmode=disable" \
-w 16 \
-d 30s

# Run consistency without transactions (compare anomaly behaviour)
edg workload consistency all \
--driver pgx \
--url "postgres://root@localhost:26257?sslmode=disable" \
-w 16 \
-d 30s \
--no-atomic-tx

# Run TPC-C against MySQL
edg workload tpcc all \
--driver mysql \
--url "root:password@tcp(localhost:3306)/tpcc?parseTime=true" \
-w 50 \
-d 10m

# Run KV benchmark against Spanner
edg workload kv all \
--driver spanner \
--url "projects/my-project/instances/my-instance/databases/my-db" \
--license "$EDG_LICENSE" \
-w 10 \
-d 5m

# Run bank workload against MongoDB
edg workload bank all \
--driver mongodb \
--url "mongodb://localhost:27017/edg" \
-w 10 \
-d 5m

# Run YCSB against Cassandra
edg workload ycsb all \
--driver cassandra \
--url "localhost:9042" \
-w 10 \
-d 5m

# Run TPC-C against SQLite, with WAL and a busy timeout so writers queue
# rather than failing
edg workload tpcc all \
--driver sqlite \
--url "file:tpcc.db?_pragma=journal_mode(WAL)&_pragma=busy_timeout(5000)&_txlock=immediate" \
-w 4 \
-d 5m

# Run KV against Redis
edg workload kv all \
--driver redis \
--url "redis://localhost:6379" \
-w 10 \
-d 5m

The --config flag is not required (and ignored) for workload commands. All other flags (--duration, --workers, --print-interval, --rng-seed, --license, --max-rows, --max-duration, --max-queries, --max-qps) work as normal. See Safety Caps for details on the --max-* flags.

The init command (for generating configs from existing database schemas) has its own page: Init.