You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Name the three distinct latencies in any Postgres queue and explain why
PgQue's batch-ticker model makes #1 and #2 sub-ms while bounding #3 by
the tick cadence (not by load). Addresses recurring confusion about the
apparent contradiction between sub-ms consumer-path latency and the ~1 s
end-to-end delivery bound.
- README.md: brief paragraph + 3-bullet list, new "Three latencies"
subsection between "Latency trade-off" and "Comparison".
- docs/pgq-concepts.md: detailed version with per-latency physics,
tick-frequency trade-off table, comparison to pgmq's poll-on-demand
model, when-to-pick guidance, provenance link.
Uses actual pgque.sql column names: queue_ticker_max_lag (3s),
queue_ticker_idle_period (1min idle-decelerator), queue_ticker_max_count
(500). The 1-second cadence comes from the pg_cron schedule set by
pgque.start(), not from queue_ticker_idle_period.
Copy file name to clipboardExpand all lines: README.md
+9Lines changed: 9 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,7 @@
16
16
17
17
-[Why PgQue](#why-pgque)
18
18
-[Latency trade-off](#latency-trade-off)
19
+
-[Three latencies](#three-latencies)
19
20
-[Comparison](#comparison)
20
21
-[Installation](#installation)
21
22
-[Roles and grants](#roles-and-grants)
@@ -65,6 +66,14 @@ Ways to reduce delivery latency: tune tick frequency and queue thresholds; use `
65
66
66
67
If your top priority is single-digit-millisecond dispatch, PgQue is the wrong tool. If your priority is **stability under load without bloat**, that is where PgQue fits.
67
68
69
+
## Three latencies
70
+
71
+
"Queue latency" is three numbers, not one. PgQue makes #1 and #2 sub-ms and bounds #3 by whatever tick cadence you configure:
3.**End-to-end delivery** — `send` → consumer visibility. ≈ tick period. **Tunable, not floored.** Default `pg_cron` at 1 s → ~500 ms average; sub-ms e2e is achievable with aggressive ticking (staggered `pg_cron` jobs, in-tick `pg_sleep` loop — see [concept doc](docs/pgq-concepts.md#three-latencies)). Trade-off: more ticks mean more `tick`/`subscription` metadata churn ([#61](https://github.com/NikolayS/pgque/issues/61)). Under sustained load the ticker keeps firing at its configured rate — batch size absorbs the load, e2e does not inflate.
76
+
68
77
## Comparison
69
78
70
79
| Feature | PgQue | PgQ | PGMQ | River | Que | pg-boss |
0 commit comments