The OLTP path through the gateway (P3b)
Primary-key seeks, a per-session catalog cache and prepared statements: a key lookup from 5.52 ms to 0.143 ms, 10 608 lookups/s at 8 clients; aggregates same.
Run details
| Date | |
|---|---|
| Commit | 4362b9d |
| Host | sttiz, shared production VPS under the uf-remote caps: 3 CPUs, 6 GB. |
| Tool | UF_BENCH=1 bash scripts/p3a-e2e-host.sh under uf-remote. Path: pgbench 16 → loopback TCP → ufgw → Unix socket → ufd --jwks; data as in the P3a report (tenant A: 10 000 orders), 10 s per run, 0 failed transactions. |
| Raw results | No separate raw file; the figures are those printed by pgbench in the run and recorded in the report. |
| Report | docs/bench/2026-10-23-p3b-oltp.md |
Indicative only. Measured on a shared development host with other services running, one node, data that fits in memory. These figures show direction, not performance to expect. The claims policy requires a dedicated host before any target is published.
The tables, as written
Transcribed from the report without rounding. Bracketed values are the previous measurement where the report gives one.
pgbench, 10 s per run; P3a column from the previous report
| Statement | Clients | P3a simple (ms) | P3b simple (ms) | P3b prepared (ms) | P3b statements/s (best) |
|---|---|---|---|---|---|
| SELECT amount, status FROM orders WHERE id = :id | 1 | 5.52 | 0.181 | 0.143 | 6 984 |
| same | 8 | 41.7 | 0.754 | 0.767 | 10 608 |
| SELECT status, count(*), sum(amount) … GROUP BY status | 1 | 5.64 | 5.28 | 5.38 | 189 |
| same | 8 | 42.2 | 41.5 | 41.6 | 193 |
| INSERT INTO orders … VALUES (…) | 1 | 1.06 | 0.870 | 0.922 | 1 149 |
| same | 8 | 6.80 | 6.26 | 6.17 | 1 296 |
Average latency, ms, log scale
P3a simple protocol vs P3b simple vs P3b prepared, one client and eight clients
Before and during this run
- Key lookups seek: the point query reads one row instead of the tenant's 10 100.
- The catalog is cached per session and refreshed when the node reports it stale: one node round trip less per statement.
- Prepared statements (the extended protocol) save the parse on the client side; the gateway still binds at every Bind.
What the numbers say
The report's own reading, including what went wrong and what is still open.
- Point lookup 5.52 ms → 0.143 ms (39×), and 8 clients reach about 10 600 lookups/s because each request now holds the engine thread for microseconds.
- The catalog cache is visible in the simple-protocol lookup (0.285 → 0.181 ms); prepared statements add a small gain (0.181 → 0.143 ms).
- Aggregates and inserts are unchanged: the GROUP BY reads every row on one engine thread with no parallel scan; inserts are most likely bounded by the write-ahead log sync (not profiled), and collection inserts do not yet share the raw-write group commit. Parallel reads (P3e) and group commit for inserts are the next levers.
Files and tools
Report
docs/bench/2026-10-23-p3b-oltp.md in the repository.
Raw results
No separate raw file; the figures are those printed by pgbench in the run and recorded in the report.
Access
The repository is private during development. Early-access teams receive the build, the benchmark scripts and the raw files.
See the measurements in context.
The performance page draws the latest figure from each area and states what is not measured yet.
