PostgreSQL Benchmark
We compared Namastack Outbox 1.11.1 and 2.0.0 while the application was writing orders and consumers were processing outbox records. A record counts as processed when its handler succeeds and PostgreSQL commits its deletion.
15-minute results
- 1.11.1Direct completion7,283
- 2.0.0Direct completion26,584
- 2.0.0Completion batching66,755
Each bar averages one 15-minute run. Completion batching is opt-in in 2.0.0. In this comparison, enabling it brought throughput to 2.51× the 2.0.0 direct-completion rate.
| Configuration | Committed orders/s | Inserted records/s | Pending at the end |
|---|---|---|---|
| 1.11.1 direct | 25,576 | 51,151 | 39,482,608 |
| 2.0.0 direct | 22,252 | 44,503 | 16,127,892 |
| 2.0.0 batched | 33,381 | 66,763 | 6,833 |
The generator targeted 50,000 orders/s in every run. The committed rates show how many orders each configuration actually wrote while processing was active. Pending counts come from a database snapshot at the end of the window and include in-flight records whose deletion was still uncommitted.
What happened over time
1.11.1 began near 30,000 processed records/s, then slowed as its backlog grew. In the batched 2.0.0 run, processing stayed close to the achieved insert rate. Grafana replays the recorded samples. Backlog points between the boundary snapshots are estimates.
| Configuration | 60 s mean processed/s | 5 min processed/s | 15 min processed/s |
|---|---|---|---|
| 1.11.1 direct | 29,380 | 14,519 | 7,283 |
| 2.0.0 direct | 33,029 | 28,311 | 26,584 |
| 2.0.0 batched | 70,493 | 62,021 | 66,755 |
The 60-second figures average three reconciled runs per configuration. Each longer figure comes from one run. In a separate 60-second batched attempt, the end snapshot showed about 24,480 processed records/s and 2.89 million pending. Its follow-up reconciliation was interrupted.
What changed in 2.0
- Completion batching. JDBC can commit completions from several keys together. Each key worker waits for its record's commit before it starts the next record for that key. Completion batching configuration
- Bulk reads. The outbox can load records for multiple keys together and deserialize a payload when a handler needs it.
- Bounded key selection. The database applies the poll limit in SQL, and revised JDBC indexes support the new queries.
The release comparison measures the read-path and schema changes together. The two 2.0.0 configurations isolate the batching setting. See Performance Tuning for when to try it and what to measure.
Test setup and reproduction
| Component | Configuration |
|---|---|
| Host and Docker VM | Apple M5 Max, 18 logical CPUs, 64 GiB host RAM. Docker had 18 CPUs and 31.3 GiB RAM. |
| Runtime | PostgreSQL 18.7 and Eclipse Temurin 25.0.5+8 |
| PostgreSQL | shared_buffers=512MB, max_connections=320, max_wal_size=16GB, checkpoint_timeout=5min, six autovacuum workers |
| Durability | synchronous_commit, fsync, and full_page_writes enabled |
| Dispatch | Four consumers, virtual threads, fixed 10 ms polling, up to 1,000 keys per poll, batch dispatch, delete on completion |
| Completion batching | Up to 1,024 actions, with a 1 ms collection window |
Every order and its two outbox records shared one database transaction. The two handlers did lightweight work without a broker. Ten consecutive orders shared a key. Each run warmed up for 30 seconds, drained the warm-up records, and reset the tables before timing. Committed deletions were calculated from the inserts and the number of records still present in the snapshot window, then checked against database counters after the drain period.
Download the runner, raw measurements, Grafana replay, and full report.