06 — Empirical Test and Benchmark Results¶
Series: PostgreSQL Multi-Master & Active-Active Architectures
Author: Jean-Marie Renouard (jmrenouard) — LightPath
License: MIT License
1. Executed Test Configuration & Dataset Parity¶
All benchmarks ran sequentially on a 20-vCPU, 16.4 GiB WSL2 Docker host. An isolated bench_client container (multi-db-pgbench-sysbench:latest) attached directly to each cluster bridge network. Every topology ran at PG_SCALE = 2 (200,000 pgbench_accounts, 20 pgbench_tellers, 2 pgbench_branches) after warm-up. Each used a standard surrogate PK on pgbench_history (stepped BIGINT on pg-birep/bucardo, snowflake.nextval() on pgedge, composite PRIMARY KEY(aid, hid) on citus, unique_rowid() on cockroach, BIGSERIAL elsewhere).
Methodological note: Chapter 05 defines PG_BENCH_SCALE=10 as an initial target. Instead, the live matrix used PG_SCALE=2 so all eight topologies (including CockroachDB and Bucardo) initialized cleanly without host RAM throttling.
2. Core Throughput & Latency Results (Suites A, B1, B2, C)¶
The table below lists verbatim metrics from results/benchmark_summary.csv. It covers pgbench Single-Node RW (Suite A, 8 clients, 20 s), Disjoint RW (Suite B1, 2x4), Overlap RW (Suite B2, 2x4), and Select-Only (Suite C, 16 clients, 20 s).
| Topology | Suite A TPS (avg ms) |
Suite B1 Disjoint TPS (avg ms) |
Suite B2 Overlap TPS (avg ms) |
B2 Retries (40001) |
B2 Balance Drift | Suite C RO TPS (avg ms) |
|---|---|---|---|---|---|---|
#15 pg17-standalone |
866.82 (9.22) |
920.07 (8.68) |
879.01 (9.09) |
0 |
0 |
55,614.16 (0.257) |
#15 pg17-async-streaming |
610.15 (13.09) |
627.39 (12.73) |
584.80 (13.66) |
0 |
0 |
45,358.52 (0.325) |
#15 pg17-sync-streaming |
409.48 (19.52) |
407.41 (19.61) |
465.22 (17.17) |
0 |
0 |
54,483.07 (0.271) |
#16 pg17-logical |
532.38 (14.99) |
251.63 (31.75) |
355.57 (22.48) |
0 |
0 |
42,302.43 (0.348) |
#1 pg-birep |
875.91 (9.12) |
820.09 (9.74) |
1,228.60 (6.50) |
0 |
-4,567 (Diverged) |
53,072.52 (0.279) |
#2 pgedge (Spock 5) |
556.06 (14.37) |
346.95 (23.03) |
818.65 (9.76) |
0 |
-66,328 (Lost) |
54,124.99 (0.273) |
#9 bucardo |
735.38 (10.86) |
1,078.90 (7.40) |
1,267.77 (6.30) |
0 |
+123,679 (Lost) |
53,731.92 (0.274) |
#7 citus |
309.04 (25.85) |
265.29 (30.12) |
312.98 (25.53) |
0 |
0 |
21,324.70 (0.724) |
#5 yugabyte |
173.64 (45.88) |
194.75 (41.04) |
170.19 (46.96) |
0 |
0 |
17,150.58 (0.922) |
#6 cockroach |
42.08 (187.60) |
60.35 (132.32) |
74.17 (106.44) |
96 |
0 |
13,185.54 (1.199) |
Catalog ID disambiguation: #16 (T3) designates pg17-logical (legacy results/functional_limits_matrix.csv tags it #14 Baseline), whereas #14 is reserved for Legacy Trigger Systems (Slony-I / Londiste / RubyRep).
Key Insights from Suites A–C¶
- Synchronous WAL Penalty (
#15): Enablingsynchronous_commit=onagainst one local standby cutspg17-standaloneRW throughput by52.8%(866.82 -> 409.48 TPS). It also doublesp95latency (23.96 -> 50.31 ms), showing thefsync+ network floor. - Disjoint Partitioning vs Overlap (
B1vsB2): Under strict disjoint key ranges (B1),pg-birep(820.09 TPS),pgedge(346.95 TPS), andbucardo(1,078.90 TPS) achieved zero balance drift (0). Once multi-node runs touched overlapping accounts (B2), raw TPS rose (1,228.60/818.65/1,267.77 TPS) because async writers skipped locks. That corrupted balances by-4,567,-66,328, and+123,679units! Notably,pg-birepdid not even converge (node1: -193,944vsnode2: -208,996vs expected-189,377). - Read-Only Scaling (
Suite C): Native PostgreSQL heap engines sustained53,072–55,614 TPSat< 0.3 msaverage latency (16clients). Coordinator/LSM engines traded raw point-lookup speed for distributed routing: Citus (21,324.70 TPS), YugabyteDB (17,150.58 TPS), and CockroachDB (13,185.54 TPS). - Wait-on-Conflict vs Optimistic
SERIALIZABLE: YugabyteDB (READ COMMITTED) ran Suites A–C with040001retries, beating CockroachDB (SERIALIZABLE) by4.1xon Suite A (173.64vs42.08 TPS). CockroachDB logged44(A),87(B1), and96(B2) serialization retries (p95 = 625.04 msin Suite A).
3. Suite D — Hot-Row Contention & spock.delta_apply Validation¶
Suite D (15 s, 8 total clients targeting 50 hot accounts aid = 1..50 with abalance = abalance + delta) empirically isolates non-commutative Lost Updates versus CRDTs and consensus serialization:
| Topology | TPS | lat_avg_ms (p95) |
Expected SUM(delta) |
Observed SUM(abalance) |
balance_drift |
Convergence Verdict |
|---|---|---|---|---|---|---|
pg17-standalone |
3,128.63 |
2.54 (3.95) |
2,362,664 |
2,362,664 |
0 |
PASS_SINGLE_PRIMARY |
pg17-async-streaming |
2,081.26 |
3.82 (6.12) |
1,578,778 |
1,578,778 |
0 |
PASS_SINGLE_PRIMARY |
pg17-sync-streaming |
1,370.10 |
5.83 (8.73) |
1,035,721 |
1,035,721 |
0 |
PASS_SINGLE_PRIMARY |
pg17-logical |
2,386.93 |
3.33 (5.47) |
1,808,364 |
1,808,364 |
0 |
PASS_SINGLE_PRIMARY |
pg-birep |
1,231.15 |
6.48 (13.01) |
922,873 |
n1: 851,810 / n2: 851,747 |
-71,063 |
EXPECTED_LIMITATION_DIVERGED |
pgedge (Default LWW) |
2,280.11 |
3.49 (5.31) |
1,737,102 |
1,458,404 (all 3) |
-278,698 |
EXPECTED_LIMITATION_LOST_UPDATE |
pgedge-delta-apply |
1,837.64 |
4.34 (9.35) |
1,391,780 |
1,391,780 (all 3) |
0 |
PASS_CONVERGED (CRDT) |
bucardo |
1,378.79 |
5.79 (8.03) |
1,046,798 |
515,178 (both) |
-531,620 |
EXPECTED_LIMITATION_LOST_UPDATE |
citus |
1,691.45 |
4.72 (6.72) |
1,283,370 |
1,283,370 |
0 |
PASS_CONVERGED |
yugabyte |
832.65 |
9.59 (15.14) |
624,295 |
624,295 |
0 |
PASS_CONVERGED |
cockroach |
471.61 |
16.91 (34.17) |
359,402 |
359,402 |
0 |
PASS_CONVERGED |
This experiment yields a definitive architectural result:
- Silent Corruption Under Async LWW: pgedge LWW looked fastest (2,280.11 TPS), yet silently discarded 16.0% (-278,698) of committed credits. bucardo lost 50.8% (-531,620) of committed money! pg-birep diverged even between its two nodes (-71,063 on node1, -71,126 on node2).
- CRDT Delta-Apply Proof: Enabling ALTER TABLE pgbench_accounts ALTER COLUMN abalance SET (log_old_value=true, delta_apply_function=spock.delta_apply) preserved 1,837.64 TPS on 3 writers with 0 balance drift. That delivers 2.2x YugabyteDB throughput and 3.9x CockroachDB while remaining PA/EL.
4. Suite E (sysbench OLTP) & Suite F (WAN tc netem 25ms)¶
To avoid single-benchmark bias (pgbench) and sub-millisecond Docker loopback illusions, Suites E (sysbench oltp_read_write, 4 tables x 10,000 rows, 8 threads, 20 s) and F (tc qdisc replace dev eth0 root netem delay 25ms on peer/standby/worker/voter containers, ~50 ms effective RTT) stress multi-statement queries and real WAN physics:
| Topology | Suite E sysbench TPS |
Suite E QPS (p95 ms) |
Suite E tx_failed |
Suite A Local TPS | Suite F netem 25ms TPS (p95 ms) |
WAN Drop |
|---|---|---|---|---|---|---|
pg17-standalone |
1,129.51 |
22,687.48 (7.56) |
112 |
866.82 |
N/A | N/A |
pg17-async-streaming |
962.84 |
19,353.12 (10.27) |
107 |
610.15 |
599.61 (34.38) |
-1.7% |
pg17-sync-streaming |
819.36 |
16,493.23 (11.65) |
118 |
409.48 |
57.00 (353.49) |
-86.1% |
pg17-logical |
595.81 |
11,974.58 (23.95) |
65 |
532.38 |
654.11 (30.58) |
0% (+23% var) |
pg-birep |
1,105.32 |
22,192.83 (10.84) |
96 |
875.91 |
824.04 (24.95) |
-5.9% |
pgedge (Spock 5) |
888.56 |
17,873.46 (15.27) |
114 |
556.06 |
646.77 (32.40) |
0% (+16% var) |
bucardo |
1,232.84 |
24,757.64 (7.70) |
112 |
735.38 |
763.23 (27.26) |
0% (+4% var) |
citus |
189.44 |
3,796.81 (50.11) |
9 (of 3,806; 3,797 comm.) |
309.04 |
21.67 (633.96) |
-93.0% |
yugabyte |
128.24 |
2,564.80 (81.48) |
0 (of 2,574) |
173.64 |
5.78 (3,401.33) |
-96.7% |
cockroach |
44.84 |
1,531.47 (502.20) |
685 (of 1,587; 902 comm.) |
42.08 |
10.06 (2,930.54) |
-76.1% |
Two Critical Production Realities Exposed by Suites E & F¶
- Client Drivers Without Retry Loops Collapse Under
SERIALIZABLE(Suite E):pgbench --max-tries=100masked CockroachDB40001aborts in Suites A–B2. By contrast, stocksysbenchlacks40001retries and suffered685errors alongside902commits (43.2%exposure) at502.20 msp95. Meanwhile, YugabyteDB'sREAD COMMITTEDWait-on-Conflict sustained0errors (128.24 TPS). - PACELC
ECTax Over WAN (Suite F): Adding25 msone-way delay (~50 msRTT) onto peer nodes crushed synchronous consensus engines. Measured drops match Chapter 02's latency equation: pg17-sync-streamingcollapsed by-86.1%(57.00 TPS,avg = 139.56 ms).cituscollapsed by-93.0%(21.67 TPS,avg = 364.81 ms) as multi-shard TPC-B statements paid cross-worker RTTs and 2PC overhead.yugabyte(5.78 TPS,avg = 1,327.30 ms,p95 = 3,401.33 ms) andcockroach(10.06 TPS,avg = 715.77 ms,14retries) dropped-96.7%and-76.1%because each TPC-B transaction touched multiple non-colocated tablets/ranges (accounts,tellers,branches,history), paying repeated2 * RTTdistributed commit trips.- Asynchronous
PA/ELsystems (pg-birep824.04 TPS,pgedge646.77 TPS,bucardo763.23 TPS) committed locally without waiting for WAN round-trips.
5. Extended V2 Sweeps (E2–E4, H, WAN 10/25/50 ms, c=1..32) & Log10 Charts¶
Expanded 10-topology sweeps (187 rows total) confirm those trends. See Chapter 09 for methodology, Chapter 10 for tiers, and dashboard/index.html to explore:
sysbenchE2–E4&H: Native PG reached1,659–1,806(E2),801–1,784(E3,pg17-sync370.71), and124k–148k TPS(E4) vs distributed180–522(E2),119–563(E3),11.6k–19.8k(E4). Append-onlyHhit3,108(standalone),2,987(yugabyte), and2,207(pgedge).- WAN (
10 -> 25 -> 50 ms): Async stayed flat (pg17-async587->600->619,pgedge645->647->687,bucardo593->763->613) whilePC/ECfell steeply (pg17-sync121.8->57.0->25.8,citus44.4->21.7->8.8,cockroach19.4->10.1->4.5,yugabyte15.4->5.8->3.1 TPS,p95=5,475 ms). - Concurrency (
c=1..32):standalonescaled298->801, whilepg17-syncplateaued at425.cockroachpeaked atc=4(74.1) then fell to40.3(88retries,p95=3,400 ms) atc=32.

6. V3 Extension: PostgreSQL 18.6 Benchmarks & Ecosystem Vitality¶
- PostgreSQL 18.6 Head-to-Head (Ch. 12): An additional 87 sequential rows across all 5 native PG 18.6 stacks (
results/benchmark_pg18.csv,results/functional_limits_pg18.csv) quantify AIO (-18.5%cold scan), defaultdata_checksums=on,substream=p, anduuidv7(). InH_append_only,pg18-birephit2,066.70 TPS(3.30xvs PG 17627.13) andpg18-logical3,518.49 TPS(+85.1%).pg18-sync-streaminggained+21.6%onA(497.94) and3.20xonE3(1,184.57), whileT11hit87,903 rows/s(pg18-async-streaming). - Ecosystem Vitality & V3 Log10 Charts (Ch. 11): Pair empirical throughput with live GitHub engineering cadence (
21rows) inchart_08_popularity_stars_forks_log.png,chart_09_popularity_commits_activity_log.png, andchart_10_pg18_vs_pg17_log.png.
7. V4 Extension: YT Cluster 1.21.3 (cc=half & cc=nodes>=0) vs Multi-Master & Raft (18/18 Suites)¶
Completed empirical coverage in results/benchmark_yt_cluster.csv adds 36 rows (18 yt-cluster + 18 yt-cluster-async on dbinvent/yt:1.21.3, PG 18.7, Solution #18). This enables an 18-suite comparison against pg18-birep, pgedge (LWW), yugabyte, and cockroach:
Topology (PG_SCALE=2) |
A RW (c=8) |
B1 Disjoint |
B2 Overlap (Drift) |
D Hot 50 (Drift) |
C RO (c=16) |
E1 SB RW |
E3 SB WO |
E4 Point Sel |
H Append uuidv7() |
WAN 10->25->50ms |
G c=1->4->32 |
|---|---|---|---|---|---|---|---|---|---|---|---|
yt-cluster (cc=half) |
20.63 |
36.14 |
10.69 (0) |
67.76 (0) |
48,787.74 |
28.48 |
26.43 |
165,472.75 |
110.53 |
4.81->2.25->1.41 |
28.07->27.47->4.60 |
yt-cluster-async (nodes>=0) |
41.45 |
88.19 |
55.03 (0) |
163.01 (0) |
40,774.49 |
124.05 |
133.55 |
177,442.88 |
224.93 |
8.47->4.78->2.90 |
53.94->91.68->44.20 |
pg18-birep (origin=none) |
514.28 |
417.18 |
792.45 (-338) |
1,774.11 (-83,252) |
42,190.66 |
1,055.55 |
1,492.99 |
146,907.74 |
2,066.70 |
763.80->747.42->782.57 |
334.72->689.16->721.49 |
pgedge (Spock LWW) |
556.06 |
346.95 |
818.65 (-66,328) |
2,280.11 (-278,698) |
54,124.99 |
888.56 |
1,279.51 |
140,124.63 |
2,206.60 |
644.63->646.77->687.00 |
312.94->616.09->575.54 |
yugabyte (DocDB Raft) |
173.64 |
194.75 |
170.19 (0) |
832.65 (0) |
17,150.58 |
128.24 |
360.02 |
11,557.45 |
2,987.24 |
15.38->5.78->3.06 |
68.14->111.55->99.49 |
cockroach (Pebble Raft) |
42.08 |
60.35 |
74.17 (0) |
471.61 (0) |
13,185.54 |
44.84 |
118.69 |
13,245.96 |
734.60 |
19.38->10.06->4.53 |
36.07->74.11->40.25 |

Four Empirical Takeaways for YT Cluster¶
- Sync vs Async Within YT Cluster: Switching from
cc=halftocc=nodes>=0speeds writes2.0xto5.1x(A20.63->41.45,B210.69->55.03,D67.76->163.01,E128.48->124.05,E326.43->133.55 TPS) with0drift. Trade-offs include higher retry churn (2,173inB2) andRPO > 0async exposure. - Reads Match Native PG (
177kE4), Writes Trail Raft on LAN: Native local reads hit177,442.88 TPS(E4) and48,787.74 TPS(C,13.4xCockroachDB onE4). Trigger + Rustytservcheckin capsyt-cluster(cc=half) below CockroachDB onA(20.63vs42.08 TPS) and11x–12xbelow YugabyteDB onD(67.76vs832.65). Still, YT keeps0drift unlikepg18-birep(-83,252) orpgedgeLWW (-278,698). - WAN
ytservLeader Affinity &SQLSTATE 55000reconQuarantine: At10/25/50msWAN,yt-cluster(cc=half) drops to2.25 -> 1.41 TPS, whileyt-cluster-asyncstill calls the Leader (8.47 -> 4.78 -> 2.90 TPS). Undercc=nodes>=0, runningE3on reused post-E1tables triggeredSQLSTATE 55000(reconblocked). Isolated table prep reached133.55 TPS(0drift). - Full 17-Topology Visual Traceability: All 17 topologies render across
chart_01–chart_07(PG17+PG18+YT). Interactive filtering uses theYT vs Multi-Masterpreset indashboard/index.htmlwith CSV lineage in Chapter 09.
8. V5 Production-Tuned Benchmark Summary (PG_SCALE=20, v2.6.1, 318 Rows)¶
In env/multi-db-docker-env v2.6.1, scripts/bench_pg_optimized_runner.sh re-ran all suites under durable production tunings (fsync=on, PG_SCALE=20 = 2M accounts, sysbench 4x25k, pgbench -M prepared --max-tries=200, WARMUP_S=5, fillfactor=90, wal_compression=lz4, PG 18/YT io_method=worker/io_workers=4, Spock delta_apply, Citus 1-shard colocation, Yugabyte RC + CACHE 1000 + HAProxy :15470, CockroachDB v25.4 HAProxy :15480 + cockroach-rc non-root bench role, YT YT_MAX_PREPARED=300 + ytctl parallel + Leader affinity + Lua 55409 hook), adding 318 rows across 18 topologies in results/benchmark_optimized.csv (log). Complete tables and tuning recipes live in Chapter 13 — Production Tuning & Realistic Scale Benchmarks.

Representative Metric (PG_SCALE=2 -> 20) |
Baseline (Scale=2) |
Tuned (Scale=20) |
Speedup & Key Engineering Driver |
|---|---|---|---|
pgedge (A_single_rw / D_hot_conflict) |
556.06 / 2280.11 (-278698) |
1948.84 / 2125.19 (0 drift) |
3.50x (A), 0 drift using spock.delta_apply vs pg18-birep (-95989) |
pg18-birep / pg-birep (G_conc_c32) |
721.49 / 254.43 |
4163.31 / 3890.14 |
5.77x / 15.29x (-M prepared + fillfactor=90 + lz4 WAL) |
pg18-sync-streaming (F_25ms WAN / c=32) |
41.56 (p95 529.136ms) / 305.22 |
178.00 (p95 92.707ms) / 2313.61 |
4.28x WAN (p95 5.7x faster), 7.58x (G_conc_c32) |
citus (A_single_rw / G_conc_c32 / E_sb) |
309.04 / 260.76 / 189.44 |
493.76 / 894.14 / 76.76 |
1.60x / 3.43x (1-shard colocation; 4x25k scan -59.5%) |
yugabyte (A_single_rw / G_c32 / H_app) |
173.64 / 99.49 / 2987.24 |
441.44 / 589.52 / 3161.72 |
2.54x (A), 5.93x (G_c32), RC + CACHE 1000 + :15470 |
cockroach v25.4 (A_single_rw / G_c32) |
42.08 (v24.3) / 40.25 |
307.95 (rt=0) / 365.47 |
7.32x (p95 625.042->51.183ms), 9.08x using HAProxy :15480 |
cockroach-rc (E_sysbench_rw vs CRDB) |
44.84 (fl=685) / 85.38 (rt=650) |
153.70 (fl=0, rt=0, p95 80.03ms) |
3.43x vs base, 1.80x vs v25.4 Serializable (0 40001 retries) |
yt-cluster / -async (A / E4 / H) |
20.63 / 177442.88 / 224.93 |
40.77 / 189286.48 / 440.62 |
1.98x (yt A), 1.96x (async H), 0.08ms avg / 0.21ms p95 (E4) |
Key Takeaways from the PG_SCALE=20 Campaign¶
- Prepared + HOT +
lz4Dominate Native PG: Removing parse overhead and enabling HOT lifts PG 17/18 + SpockAto1276.91–1948.84 TPS(2.1x–5.9x). Concurrencyc=32hits2891.42–4163.31 TPSdespite a10xlarger dataset (2Maccounts). delta_applyFixes Async Arithmetic While LWW Still Breaks: At2125.19 TPSonD_hot_conflict,pgedgeholds0drift (B2andD). By contrast,pg-birep(-94514),pg18-birep(-95989), andbucardo(-303741) lose hot increments.- HAProxy + RC Unlock Distributed SQL (
2.5x–9.1x), Except Heavy4x25kScans: CockroachDBv25.4+cockroach-rcclear write40001aborts insysbench(rt=0). Larger2.5xsysbenchtables (100krows) slow range scans oncitus(76.76 TPS) andyugabyte(68.85 TPS). - Full Dual-Dataset Lineage (
628Total Raw Rows): Compare Baseline (310rows /301dedup) vs Tuned (318rows across18topologies) interactively indashboard/index.htmland inspect all recipes in Chapter 13 and Chapter 09.