bench: HammerDB-style TPROC-* workload suite with safety-feature toggles#26
Merged
Conversation
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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
HammerDB-style TPROC-* workload suite with safety-feature toggles
Adds three workload drivers under
lab/bench(alongside the existingscale_bench), sharing a common harness whose central feature is asafety-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-order45%, 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 purecommit/log overhead.
tproc_h— analytic: long read-only scans run concurrently with pointwriters, to exercise MVCC.
Shared harness (
bdb_bench.h)-X txn/-X lock/-X logDB_INIT_TXN/LOCK/LOG-d sync|wnosync|nosync-mDB_MULTIVERSION)-CDB_INIT_CDB)-c -t -S -s -iTransaction helpers become no-ops under
-X txn, so each workload is writtenonce 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)
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, plainlocking starves the analytic scans to ~0 completions (writers monopolize),
while
-mlets them run at ~7 queries/s (~700k rows/s scanned) against aconsistent 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.