hardbyte / hardbyte/postgresql-job-queue-benchmarking
Apply producer in-flight tracking to poller-based adapters before next cross-system sweep
- Lenguaje dominante
- HTML
- Estrellas
- 2
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
## Context
PR #30 fixed an overshoot in awa-bench's depth-target producer: the
producer now tracks its own contribution since the last depth-poll
snapshot, so bursts during the ~200 ms stale window self-limit.
## Per-adapter shape
| Adapter | Depth source | Status |
|---|---|---|
| pgboss | live \`getQueueStats()\` inside producer loop | accurate (already tracks target) |
| pgmq | live \`queue_depth()\` inside producer loop | accurate (already tracks target) |
| **awa** | atomic + in-flight tracker (this fix) | accurate |
| oban | ETS table populated by 200 ms-cadence poller | **overshoots** |
| river | atomic populated by 200 ms-cadence poller | **overshoots** |
| pgque | variable populated by 200 ms-cadence poller | **overshoots** |
| absurd | variable populated by 200 ms-cadence poller | **overshoots** |
| procrastinate | variable populated by 200 ms-cadence poller | **overshoots** |
## Why it matters
At a given \`target_depth\` setting, the five overshoot-adapters end up
operating at higher effective backlog than the three accurate-adapters.
Higher backlog means more queued work, more scan cost on claim
queries, and (depending on the system) more lock contention or
table bloat. Cross-system throughput comparisons under depth-target
mode are not at the same operating point.
The pattern from PR #30 applies cleanly to all five poller-based
adapters:
1. Snapshot \`enqueued\` in the poller right after updating
\`queue_depth\`, keyed against a consistent moment.
2. In the producer, compute \`effective_depth = queue_depth +
(enqueued_now - enqueued_at_poll)\` and throttle against that.
## Acceptance criteria
- oban, river, pgque, absurd, procrastinate producers all track
target accurately under depth-target mode (median \`queue_depth\`
within ±20 % of target during steady-state soak).
- Each adapter's change is a self-contained PR with its own smoke
showing the before/after delta on the same hardware.
- Documented in CONTRIBUTING_ADAPTERS.md so future adapters get
the pattern right from the start.
## Out of scope
- The 200 ms cadence itself. PR #30's earlier commit established
that 200 ms is load-bearing for the depth-target controller;
loosening it regressed throughput by ~17 % and doubled depth.
The fix is the in-flight tracker, not a tighter poll.
Refs: PR #30, awa #289 (queue_counts_fast — the other half of the
depth-target hot path).
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Revisa primero PR #30 para entender el patrón existente de seguimiento de operaciones en curso y, después, localiza las rutas del poller y del producer para oban, river, pgque, absurd y procrastinate. Compara el comportamiento del objetivo de profundidad con las ejecuciones smoke en el mismo hardware, verifica la profundidad de la cola en estado estable con respecto al rango de aceptación y documenta el patrón del adaptador en CONTRIBUTING_ADAPTERS.md.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- postgresql
- Área
- backend, documentation, performance
- Tipo de issue
- Error
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 45/100