Load and soak testing
This page describes the load, stress, soak and capacity testing that exists for SynergyDB at main 8a689c5c (2026-11-30): what each harness does, what runs have been recorded, and how to run them again. Paths in source pointers are relative to the repository root.
Throughput comparisons against the reference databases are on Benchmark harnesses and Benchmarks. Correctness testing is on Testing.
Scope of this snapshot
Several harnesses that status entries describe are not in the snapshot, so their code could not be read for this page:
| Harness | Described in | In the snapshot |
|---|---|---|
Multi-day soak driver demo/soak/ (soakd, run.sh, dashboard) |
docs/status/2026-11-27-multi-day-soak.md |
No |
Meridian Market app code (apps/meridian/) |
apps/meridian/README.md, docs/status/2026-11-24-all-wires-at-once.md
|
README only |
Meridian concurrent run data docs/proof/meridian-concurrent-2026-11-24/
|
docs/status/2026-11-24-all-wires-at-once.md |
No. docs/proof/ holds only 2026-11-30/
|
June-era probes concurrency_probe.py, consistency.py, compaction_bench.py, concur_tx.py
|
ROADMAP.md, STATUS.md
|
No |
(source: listings of demo/, apps/meridian/, docs/proof/, test-scripts/)
What is in the snapshot: the Rust load tests in tests/, the shell stress script tests/stress_100_stage.sh, and the cluster failover scripts in test-scripts/cluster/.
Recorded runs
Every number below comes from a status entry. None was rerun for this page.
| Run | Build | Load | Result | Source |
|---|---|---|---|---|
| Soak, local run 1 | A build of feat/cross-wire-vector-search plus a MySQL fix |
About 25 min, kill -9 about every 4 min (5 kills) |
771,865 operations, 307k reads verified; bank totals held at every full check; 82,290 of 82,290 cross-wire searches found, write-to-searchable lag p50 13 ms; recovery average 19.4 s, maximum 70.2 s. Failures were the bugs listed under Findings |
docs/status/2026-11-27-multi-day-soak.md, "Gates run" |
| Soak, local run 2 | Same, with the Redis client-retry fix in the harness | About 7 min, 1 kill | 398,747 operations, 162,383 reads verified. Every check passed except the Elasticsearch count after the kill | same |
| Meridian, every wire at once |
main 1b283eb, 4-core cloud machine |
45 min, 4 kill -9s; the gates table lists three 45-minute runs |
20 of 20 durable wires read back every acknowledged write (about 1.08 M writes); 80 of 80 post-restart checks at 500 of 500; recovery 3.3 to 6.3 s; store ledger matched on 20 of 21 wires | docs/status/2026-11-24-all-wires-at-once.md |
| PostgreSQL connection capacity | Release build, 4 vCPU, soft open-files limit 1,024 raised by the server | pgbench scale 10 at 500 and 1,000 clients | No failed transactions, no accept errors. Select-only 77.0k and 70.5k tps; TPC-B 2.9k and 2.0k tps | docs/status/2026-11-30-open-files-and-accept-backoff.md |
| Raft failover under load | 3-node local cluster | Seven wires writing, leader killed with SIGKILL mid-run | 5 of 5 checks in four runs; 17k to 23k acknowledged writes per run; new leader in 3.5 s; 0 acknowledged writes lost; all wires identical on all three nodes | docs/status/2026-11-30-distributed-multiwire.md |
| Statement snapshot, PG wire | Branch fix/statement-snapshot against main
|
psycopg, 4 transfer and 2 SUM sessions, 20 s |
main: 25 bad sums of 179k; branch: 0 of 260k |
docs/status/2026-11-24-statement-snapshot.md, "Capability shift" |
Not verified: no soak run longer than about 25 minutes is recorded. The soak driver is designed to run for days, but no multi-day result is in this snapshot (source: docs/status/2026-11-27-multi-day-soak.md). Benchmarks and Operations say the same.
Rust load and performance tests
These run in-process through the crate API, with no network clients. They need only Rust (source: tests/load_stress.rs, tests/perf_baseline.rs, tests/large_data.rs, module docs).
| File | Tests | Ignored | What it does | Run |
|---|---|---|---|---|
tests/load_stress.rs |
21 | 2 | Sustained throughput, memory pressure, connection and resource limits, progressive load, protocol stress, WAL stress | cargo test --test load_stress -- --nocapture |
tests/perf_baseline.rs |
30 | 0 | Throughput floors for SQL, Redis, MongoDB, Bolt, Gremlin, storage, Prometheus, S3, Elasticsearch, DynamoDB, Memcached and InfluxDB handlers | cargo test --test perf_baseline -- --nocapture |
tests/large_data.rs |
19 | 3 | Large row counts, wide rows, deep nesting, many keys |
cargo test --test large_data -- --ignored for the ignored ones |
(source: #[test], #[tokio::test] and #[ignore] counts in each file)
load_stress.rs
The module doc says every test is designed to finish in under 60 seconds in a debug build, and tests that might not are ignored (source: tests/load_stress.rs, module doc).
| Module | Tests | Source |
|---|---|---|
sustained_throughput |
stress_sustained_sql_write_500, stress_sustained_storage_write_5k (ignored), stress_sustained_read_under_write, stress_write_amplification
|
tests/load_stress.rs, sustained_throughput
|
memory_pressure |
stress_memtable_flush, stress_multiple_memtable_rotation (ignored), stress_many_open_iterators, stress_large_value_storage
|
tests/load_stress.rs, memory_pressure
|
connection_resource_limits |
stress_many_query_engines, stress_rapid_open_close, stress_concurrent_writers_and_sync
|
tests/load_stress.rs, connection_resource_limits
|
progressive_load |
stress_progressive_table_count, stress_progressive_column_count, stress_progressive_row_size
|
tests/load_stress.rs, progressive_load
|
protocol_stress |
stress_redis_1k_keys, stress_redis_large_list, stress_mongo_1k_documents, stress_mongo_deep_query_nesting
|
tests/load_stress.rs, protocol_stress
|
wal_stress |
stress_wal_large_values, stress_wal_rapid_sync, stress_wal_data_survives_reopen
|
tests/load_stress.rs, wal_stress
|
The two ignored tests each do 10,000 storage operations and are marked as taking over 60 seconds in debug. Run them with cargo test --test load_stress -- --ignored (source: tests/load_stress.rs, #[ignore] comments).
The module doc also records design limits for test authors: QueryEngine is not thread-safe, so each thread creates its own engine; JOINs are avoided because they are slow in debug builds; and composite primary keys are avoided because of "a known bug" (source: tests/load_stress.rs, module doc). Not verified: whether the composite primary key bug the comment refers to is still present.
perf_baseline.rs
Each test times a fixed number of operations and calls assert_throughput(ops, elapsed, min), which fails when operations per second fall below min (source: tests/protocol_helpers/mod.rs, assert_throughput). The floors range from 0.1 to 50 operations per second. The module doc says they are "intentionally very low" so the tests pass in debug builds on slow CI machines (source: tests/perf_baseline.rs, module doc and assert_throughput calls). These tests catch a collapse, not a regression. Read the printed numbers with --nocapture for anything finer, and compare release builds only.
large_data.rs
The module doc says "Most tests marked #[ignore]", but 3 of the 19 are: large_100k_rows_insert_and_query, large_storage_100k_sequential and large_100k_rows_aggregation (source: tests/large_data.rs).
Related integration tests
These are correctness tests under concurrency or failure, not load tests, but they cover the same ground at small scale (source: test counts in each file):
| File | Tests |
|---|---|
tests/concurrency.rs |
28 |
tests/crash_recovery_test.rs |
28 |
tests/failure_modes.rs |
25 |
tests/chaos_engineering_test.rs |
16 |
See Testing.
Shell stress: stress_100_stage.sh
tests/stress_100_stage.sh drives a running server over the PostgreSQL wire with psql (source: tests/stress_100_stage.sh):
-
Phase 1 runs
tests/full_protocol_test.shif it is present. - Phase 2 creates two integer-only tables, then runs 100 stages. Stage n inserts 2n rows, runs 1 + n/10 counter updates, runs SELECTs whose shape rotates through ten levels (count, group by, join, subquery, distinct, having, window, min and max, case, union), and from stage 51 on deletes the rows written 50 stages earlier.
- Phase 3 prints the row count, the number of distinct stages (it expects about 50), the counter sum and operations per second, then drops both tables.
Connection settings come from PG_HOST (default: the loopback address), PG_PORT (default 5435), PG_USER and PG_DB (source: tests/stress_100_stage.sh, configuration block). The script logs each stage's label as "Concurrent=k", but the counter updates run one after another, not concurrently (source: tests/stress_100_stage.sh, update loop). The exit code depends only on whether a stage failed. The distinct-stage count is printed, not checked.
PG_PORT=5432 bash tests/stress_100_stage.sh
Not verified: no status entry records a run of this script, and the "151 tests" in its Phase 1 header comment is not checked against full_protocol_test.sh.
The soak harness (demo/soak)
docs/status/2026-11-27-multi-day-soak.md describes soakd, a driver meant to run for days against one SynergyDB with every wire busy, through each vendor's official client. The code is not in this snapshot (source: listing of the repository root), so everything in this section is Not verified against code.
Per the entry:
| Workload | What must hold |
|---|---|
| Bank | PostgreSQL and MySQL SELECT ... FOR UPDATE transfers. Total money and every balance (opening plus in minus out) reconcile |
| Records | Numbered records on 10 wires (PostgreSQL, MySQL, MongoDB, Redis, Cassandra, ClickHouse, Neo4j, S3, CouchDB, Elasticsearch), read back and counted against a ledger as acknowledged, unknown or absent |
| Counters |
UPDATE n = n + 1, $inc and HINCRBY, with a floor and ceiling check on every read (lost updates) |
| AI search | One vector collection over PostgreSQL rows, MongoDB documents and Redis hashes, searched through SQL vector_search and Redis FT.SEARCH ... KNN, with a write-to-searchable lag probe |
| Meridian checkouts | The all-wire store app, with a periodic full verify |
| Health probes | A list of real applications to probe, passed as a JSON file |
(source: docs/status/2026-11-27-multi-day-soak.md, "What changed")
The driver applies a daily load curve with bursts and kills the server with kill -9 every SOAK_KILL_EVERY_H hours (default 6), through the Docker socket or a command. It times recovery per wire with a real query, then runs a full check of every workload. Metrics are kept in SQLite outside SynergyDB, so a crash does not lose them. A dashboard serves on port 8950 and a daily summary is written as HTML and Markdown. run.sh either starts its own SynergyDB (--image or --bin) or attaches to a running one (--attach <container> --probes <file>) (source: same).
Findings from the soak runs
| Finding | Status in later entries | Source |
|---|---|---|
PostgreSQL wire torn read: a single SELECT sum(balance) sometimes saw half of a committed two-row transfer (1,642 of 621,753 sums off by one in a standalone reproducer) |
TransactionManager::statement_snapshot gives each read-only statement one snapshot. Regression test sum_over_concurrent_transfers_sees_whole_transactions. Both are on main
|
docs/status/2026-11-27-multi-day-soak.md; docs/status/2026-11-24-statement-snapshot.md; src/transaction/mvcc.rs, statement_snapshot; src/query/engine.rs
|
Elasticsearch: documents acknowledged just before a kill readable by GET _doc but missing from _count, _mget and search (4 of 12,211 after four kills); a scroll returned 9,261 of 12,207 |
No fix found in the entries read for this page | docs/status/2026-11-27-multi-day-soak.md |
Redis: one HINCRBY took 18.4 s with no crash in progress |
Same | same |
ClickHouse: DESCRIBE TABLE db.t on a qualified name returns one * column; now64(3) unknown |
Same | same |
| All wires share one storage namespace, so same-named tables on PostgreSQL, MySQL, Cassandra, ClickHouse and MongoDB collide | Same | same |
Two caveats on the torn read. The statement-snapshot entry is dated 2026-11-24 and cites "the soak run", while the soak entry is dated 2026-11-27 and ran on a feature-branch build, so the entry dates do not show which build the soak's torn read was measured on. The statement-snapshot entry also leaves one case open: autocommit multi-row UPDATE and DELETE still write row by row, so a concurrent snapshot can see part of one (source: docs/status/2026-11-24-statement-snapshot.md, "New bugs or gaps found"). Not verified: no soak rerun after the fix is recorded.
A lesson for any load harness: redis-py retries a command up to 10 times after a timeout by default, which double-counts a non-idempotent HINCRBY. The soak client turns client retries off (source: docs/status/2026-11-27-multi-day-soak.md).
Meridian: soak and every-wire runs
Meridian Market is an all-wire demo store in apps/meridian/. Its README lists five ways it tests SynergyDB, under a heading that says "Three ways" (source: apps/meridian/README.md). Two are load tests:
| Mode | Command | What must hold |
|---|---|---|
| Soak | python -m meridian soak --minutes 30 --kill-every 120 |
Workers place orders while SynergyDB is killed with SIGKILL on a timer and restarted on the same volumes. After each restart every acknowledged write is present and correct, and every write in flight at the crash is all or nothing |
| Every wire at once | python -m meridian concurrent --minutes 45 --kill-every 600 |
One process per wire with its official client; writers insert keyed records and readers read back other threads' acknowledged records. Every acknowledged write reads back after each restart and at the end, with no errors outside restart windows. Memcached is checked only between restarts and on its newest 50,000 keys |
(source: apps/meridian/README.md, "Three ways it tests SynergyDB")
MERIDIAN_RESTART_CMD sets the command that kills and restarts SynergyDB (source: docs/status/2026-11-24-all-wires-at-once.md). The app finds the server through MERIDIAN_HOST, or MERIDIAN_<WIRE>_HOST and MERIDIAN_<WIRE>_PORT per wire, and logs in with MERIDIAN_USER and MERIDIAN_PASSWORD (source: apps/meridian/README.md, "Run it").
The entry's findings from the 45-minute runs: Kafka duplicated one acknowledged event after a kill -9 with an idempotent producer; Memcached returned "connection closed" about 4 times per 45 minutes outside a restart; a MySQL VARCHAR primary-key point read took about 90 ms (source: docs/status/2026-11-24-all-wires-at-once.md, "New bugs or gaps found").
Not verified: the Meridian code is not in this snapshot, so the modes above are described from its README only.
Connection capacity
Before 2026-11-30, under Docker's default soft limit of 1,024 open files, PostgreSQL logins failed past about 150 concurrent clients and the accept loop spun and flooded the log. The server now raises its soft limit to the hard limit at startup, warns if the result is under 4,096, and backs off in every accept loop through protocol::accept_error (source: docs/status/2026-11-30-open-files-and-accept-backoff.md; src/protocol/mod.rs, accept_error). Tests: the accept_tests module, 3 tests per the entry (source: src/protocol/mod.rs, accept_tests).
The capacity numbers are in Recorded runs. The same entry measured about 6 to 7 MB of memory per open PostgreSQL connection (about 3.6 GB at 500 clients, 5.5 GB at 1,000), against about 2 MB per backend for PostgreSQL 16 in the same runs (source: docs/status/2026-11-30-open-files-and-accept-backoff.md, "New bugs or gaps found"). Plan memory for connection count before running a high-client load test. See Operations.
To rerun, start SynergyDB with a high hard limit (for example docker run --ulimit nofile=20000:20000 ...) and drive it with pgbench at the client counts you need. make bench ARGS='--wires postgres --bench-clients 1,8,500 --pg-scale 10' runs pgbench and sysbench through the proof pack (source: Makefile, bench; prove/prove.py, --bench-clients). Not verified: that the proof pack's reference PostgreSQL container accepts 500 clients with its default settings.
Cluster failover under load
test-scripts/cluster/multiwire_failover_test.py starts a local three-node replicated cluster on loopback, then checks follower write refusal, replicated reads, and failover under load: one writer per wire (PostgreSQL, MySQL, MongoDB, Redis, Cassandra, CouchDB, InfluxDB) writes numbered records to the leader, the leader is killed with SIGKILL mid-run, writers find the new leader, and the killed node restarts. At the end every acknowledged record must be on all three nodes and each wire's record set identical (source: test-scripts/cluster/multiwire_failover_test.py, module docstring).
python3 test-scripts/cluster/multiwire_failover_test.py --load-secs 20 --json out.json
It is Linux and macOS only and wipes its own data directories under /tmp (source: same). Results are in Recorded runs. See Raft for the replication design.
How to rerun
| Goal | Command | Needs |
|---|---|---|
| In-process load tests | cargo test --release --test load_stress -- --nocapture |
Rust |
| Including the slow ones | cargo test --release --test load_stress -- --include-ignored |
Rust |
| Throughput floors | cargo test --release --test perf_baseline -- --nocapture |
Rust |
| Large data | cargo test --release --test large_data -- --include-ignored |
Rust, memory and disk |
| 100-stage SQL stress | PG_PORT=<port> bash tests/stress_100_stage.sh |
A running server, psql, bc
|
| Meridian soak |
docker compose run --rm app python -m meridian soak --minutes 30 from apps/meridian/
|
Docker; the Meridian code (not in this snapshot) |
| Meridian every wire | docker compose run --rm app python -m meridian concurrent --minutes 45 --kill-every 600 |
Same |
| Raft failover | python3 test-scripts/cluster/multiwire_failover_test.py |
Python drivers for seven wires |
| Throughput vs reference | make bench |
See Benchmark harnesses |
(source: tests/load_stress.rs, tests/perf_baseline.rs, tests/large_data.rs module docs; tests/stress_100_stage.sh; apps/meridian/README.md, "Run it"; test-scripts/cluster/multiwire_failover_test.py; Makefile)
--release and --include-ignored are standard Cargo and libtest options; the files' own docs show the debug form. Record any run in a docs/status/ entry with the build, the machine, the duration, the kill schedule and every number, as the entries above do. See Contributing.