hardbyte / hardbyte/postgresql-job-queue-benchmarking
Follow-up: expose pg_ash extension as opt-in once the image story is sorted
- Lenguaje dominante
- HTML
- Estrellas
- 2
- Forks
- 0
- Métricas de merge de PR
- Sin PR fusionados en 30 d
Descripción
Spun out of #pr-for-feat/pg-ash-wait-events.
The harness now does pg_ash-style wait-event sampling itself
(see \`bench_harness/wait_events.py\`), which is option **B** of the
A/B/C trade-off in the PR description: harness-side sampler against
the standard \`postgres:17.2-alpine\` image, no extension install.
This issue tracks option **A**: switching (or extending) the postgres
image to one that ships \`pg_cron\` + the \`pg_ash\` extension itself,
exposed via an opt-in \`--with-pg-ash-extension\` flag.
## Why it's a separate issue
- Today's harness-side sampler covers the data we need for the
cross-system comparison report. Histogram counts per phase are in
\`raw.csv\`, top-N events in \`summary.json\`, the
\`Wait-event breakdown — clean phase\` plot is in \`index.html\`.
- pg_ash inside Postgres adds compact ASH partitions (rolling
retention, time-series queries on an actual table) that are nice
for **post-bench exploration**, not for the report. That's a
separate value prop — ad-hoc \"slice the wait events by minute\"
queries against a real history table.
- pg_ash needs \`pg_cron\` which the standard \`postgres:17.2-alpine\`
image doesn't ship. Switching the image *for everyone* would
confound throughput numbers across runs (different shared libraries,
potentially different defaults). Switching it only when the flag is
set keeps the canonical comparison clean while letting curious users
drop into ASH.
## Likely shape
- New \`--with-pg-ash-extension\` CLI flag.
- When set, override \`POSTGRES_IMAGE\` to a Tembo or custom image with
\`pg_cron\` + \`pg_ash\`.
- After \`start_postgres\`, run \`CREATE EXTENSION pg_cron;
CREATE EXTENSION pg_ash;\`. pg_ash schedules its own samplers via
pg_cron — no harness work beyond the install.
- At end of run, dump pg_ash's ASH table into \`raw_pg_ash.parquet\`
alongside \`raw.csv\` so users have both views.
## Out of scope here
- The harness-side sampler stays. It's the canonical data source for
the cross-system overlay; pg_ash would be a *complementary*
exploration tool.
- We are **not** changing the default image. Whatever image option A
introduces is gated behind the flag.
## References
- pg_ash: https://github.com/NikolayS/pg_ash
- Tembo Postgres images (one example with pg_cron):
https://github.com/tembo-io/tembo/tree/main/images
Guía de contribución
No hay ninguna guía de contribución indexada para este repositorio
Línea de trabajo
Comienza con el manejo de la CLI y el flujo de start_postgres; después, revisa bench_harness/wait_events.py para conocer los límites de muestreo existentes. Añade la ruta opcional --with-pg-ash-extension sin cambiar la imagen predeterminada, instala pg_cron y pg_ash después del inicio y vuelca la tabla ASH en raw_pg_ash.parquet junto a raw.csv.
Escrito por el modelo de indexación a partir del texto del issue.
Evaluación
- Stack tecnológico
- postgresql, python
- Área
- cli, database, performance
- Tipo de issue
- Nueva funcionalidad
- Dificultad
- 4/5
- Tiempo estimado
- 3-5 días
- Estado de actividad
- Tranquilo
- Claridad
- Bastante claro
- Aptitud para principiantes
- 52/100