Skip to content

bench: HammerDB-style TPROC-* workload suite with safety-feature toggles#26

Merged
gburd merged 1 commit into
masterfrom
bench/tproc-suite
Jun 20, 2026
Merged

bench: HammerDB-style TPROC-* workload suite with safety-feature toggles#26
gburd merged 1 commit into
masterfrom
bench/tproc-suite

Conversation

@gburd

@gburd gburd commented Jun 19, 2026

Copy link
Copy Markdown
Collaborator

HammerDB-style TPROC-* workload suite with safety-feature toggles

Adds three workload drivers under lab/bench (alongside the existing
scale_bench), sharing a common harness whose central feature is a
safety-feature toggle framework: every workload can run with full ACID
guarantees or with individual BDB protections removed, so their cost is
directly measurable.

These are independently implemented HammerDB-style workloads — not the TPC
benchmarks
, and they produce no TPC-comparable metrics.

Drivers

  • tproc_c — OLTP: the five weighted order-entry transactions (new-order
    45%, payment 43%, order-status 4%, delivery 4%, stock-level 4%). The
    read-only transactions take snapshot isolation under -m.
  • tproc_b — debit/credit: one short write transaction over four records;
    the parameterized successor to examples/c/ex_tpcb.c, isolating pure
    commit/log overhead.
  • tproc_h — analytic: long read-only scans run concurrently with point
    writers, to exercise MVCC.

Shared harness (bdb_bench.h)

flag effect
-X txn / -X lock / -X log drop DB_INIT_TXN / LOCK / LOG
-d sync|wnosync|nosync commit durability (default nosync)
-m MVCC + snapshot readers (DB_MULTIVERSION)
-C Concurrent Data Store (DB_INIT_CDB)
-c -t -S -s -i cache, threads, scale, seconds, init

Transaction helpers become no-ops under -X txn, so each workload is written
once and runs in every mode. Automatic deadlock detection is enabled when
locking is on (without it, contended transactions block forever rather than
returning DB_LOCK_DEADLOCK).

Validated (macOS, Apple clang)

  • All four build via the Makefile, zero warnings.
  • tproc_c: full-ACID 4t ≈ 5.5k txn/s; raw (no txn/lock/log) 1t ≈ 13k txn/s.
  • tproc_b: full-ACID 4t ≈ 53k txn/s.
  • tproc_h: MVCC demonstrated — with 4 query + 4 writer threads, plain
    locking starves the analytic scans to ~0 completions (writers monopolize),
    while -m lets them run at ~7 queries/s (~700k rows/s scanned) against a
    consistent snapshot.

Purpose

This gives the project a workload suite to measure scaling and the cost of
each safety feature across configurations — the basis for the upcoming
RAM:working-set × core-count benchmarking and bottleneck profiling.

Add three workload drivers in lab/bench alongside scale_bench, sharing a
common harness (bdb_bench.h) whose point is a safety-feature toggle
framework: every workload runs with full ACID guarantees or with individual
protections removed, so their cost can be measured directly.

- bdb_bench.h: -X txn|lock|log (drop DB_INIT_TXN/LOCK/LOG), -d
  sync|wnosync|nosync (commit durability), -m (DB_MULTIVERSION + snapshot
  readers), -C (DB_INIT_CDB); plus -c cache, -t threads, -S scale, -s secs,
  -i init. Transaction helpers become no-ops under -X txn so each workload is
  written once and runs in both modes. Enables automatic deadlock detection
  when locking is on.

- tproc_c: OLTP, the five weighted order-entry transactions (new-order,
  payment, order-status, delivery, stock-level); the read-only transactions
  use snapshot isolation under -m.

- tproc_b: debit/credit, one short write transaction touching four records;
  the parameterized successor to examples/c/ex_tpcb.c, isolating commit/log
  overhead.

- tproc_h: analytic; long read-only scans run concurrently with point
  writers. Demonstrates MVCC: with snapshot isolation the scans run
  unobstructed; under plain locking they contend with the writers.

These are independent implementations, not the TPC benchmarks, and produce no
TPC-comparable metrics. README documents the toggle matrix and usage.
@gburd gburd merged commit f020b8e into master Jun 20, 2026
36 of 39 checks passed
@gburd gburd deleted the bench/tproc-suite branch June 20, 2026 01:00
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant