hardbyte / hardbyte/postgresql-job-queue-benchmarking

Apply producer in-flight tracking to poller-based adapters before next cross-system sweep

Offen
#31 0 Kommentare 0 Reaktionen 0 zugewiesene Personen Auf GitHub ansehen
Vorherrschende Sprache
HTML
Sterne
2
Forks
0
PR-Merge-Kennzahlen
Keine gemergten PRs in 30 T.

Beschreibung

## 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).

Beitragsleitfaden

Für dieses Repository ist kein Beitragsleitfaden indexiert

Rechercherichtung

Review PR #30 first to understand the existing in-flight tracking pattern, then locate the poller and producer paths for oban, river, pgque, absurd, and procrastinate. Compare depth-target behavior with the same-hardware smoke runs, verify steady-state queue depth against the acceptance range, and document the adapter pattern in CONTRIBUTING_ADAPTERS.md.

Vom Indexierungsmodell aus dem Issue-Text verfasst.

Bewertung

Tech-Stack
postgresql
Bereich
backend, documentation, performance
Issue-Typ
Bug
Schwierigkeit
4/5
Geschätzter Aufwand
3-5 Tage
Aktivitätsstatus
Ruhig
Klarheit
Größtenteils klar
Anfängerfreundlichkeit
45/100

Neue Issues direkt in Ihr Postfach

Eine kurze Übersicht über anfängerfreundliche GitHub-Issues.