Skip to content

infra: swap hobby PG to timescaledb-ha + bump CH max_concurrent_queries to 50 (HOL-35)#108

Merged
BrewingCoder merged 1 commit into
mainfrom
issue-35-infra-tuning
May 9, 2026
Merged

infra: swap hobby PG to timescaledb-ha + bump CH max_concurrent_queries to 50 (HOL-35)#108
BrewingCoder merged 1 commit into
mainfrom
issue-35-infra-tuning

Conversation

@BrewingCoder
Copy link
Copy Markdown
Owner

Summary

Two related infra tweaks surfaced during HOL-26 / HOL-29 prep work, plus a Dockerfile fix.

1. Hobby PG image: ankane/pgvectortimescale/timescaledb-ha:pg16

Hobby PG image swaps to bundle TimescaleDB + pgvector + timescaledb_toolkit. The new image enables hypertable partitioning + drop_chunks retention for HOL-29's high-volume analytics tables (logs, traces, error_objects, sessions). Apache 2 base + Timescale License community features; AGPL-compatible.

Volume layout note: timescaledb-ha lays its data dir at /home/postgres/pgdata/data, NOT the upstream /var/lib/postgresql/data. Updated the volume mount to match. Anyone swapping back to a different PG image needs to revert that path too — flagged in compose.yml comment.

One-time data wipe: the path change means existing dev volumes don't carry forward. DevSeed recreates 5 workspaces + 5 projects on first start (verified). Production deployments would need a pg_dump/restore migration plan.

2. CH max_concurrent_queries 20 → 50

HOL-24 set this to 20 to constrain idle. Real workload exceeded it — single SHOW CREATE TABLE queries got rejected with "Too many simultaneous queries" during HOL-29 schema-discovery, because the backend's six worker hosted services keep CH busy continuously. 50 is still well below the default of 100. Insert/select sub-caps bumped 10 → 25 each.

3. Dockerfile fix (uncovered while live-testing the above)

backend-dotnet.Dockerfile only had COPY directives for projects that existed before HOL-25/26. The new HoldFast.Analytics and HoldFast.Data.Postgres projects were missing from the pre-restore COPY block, so dotnet restore couldn't generate their assets files and the publish step failed. Added the two missing lines + a comment reminding future contributors to update this list when adding projects to the slnx.

Acceptance verified live

  • docker compose up -d brings up TimescaleDB-HA cleanly with the corrected volume mount
  • DevSeed recreates 5 workspaces + 5 projects in the new image
  • HOL-26 PG migrations now actually run on backend startup:
    Analytics PG migration: applying 1 0001_create_analytics_schema.up.sql Analytics PG migration: applying 2 0002_create_schema_migrations.up.sql Analytics PG migration: applying 3 0003_install_extensions.up.sql Analytics PG migrations: 3 applied, 3 total, 0 already-applied
  • analytics.schema_migrations populated with versions 1–3, all dirty=false
  • TimescaleDB 2.26.4 extension active (vs. the NOTICE-no-op in the old image)
  • CH max_concurrent_queries reads 50 from system.server_settings
  • Backend /health 200; existing CH backend untouched

Stats

4 files changed, +27 / -8.

Closes HOL-35.

🤖 Generated with Claude Code

…es to 50 (HOL-35)

Two related infra tweaks surfaced during HOL-26 / HOL-29 prep work.

## TimescaleDB-HA replaces ankane/pgvector

Hobby PG image swaps from ankane/pgvector:v0.5.1 to
timescale/timescaledb-ha:pg16. The new image bundles:
- TimescaleDB community 2.26.4 (Apache 2 base + Timescale License for
  some features; AGPL-compatible)
- pgvector (replaces the existing ankane/pgvector role for embeddings)
- timescaledb_toolkit
- pg_partman is NOT in this image, but with TimescaleDB available we
  use drop_chunks for retention instead

Volume layout note: timescaledb-ha lays its data dir at
/home/postgres/pgdata/data, NOT the upstream /var/lib/postgresql/data.
Updated the volume mount to match. Anyone swapping back to a different
PG image needs to revert that path too — added a comment in compose.yml
flagging this.

Live-verified: TimescaleDB extension active, DevSeed populated 5
workspaces / 5 projects in the new image, HOL-26 PG migrations
confirmed applicable.

## CH max_concurrent_queries 20 -> 50

HOL-24 set max_concurrent_queries=20 to constrain idle. Real workload
exceeded it - even single SHOW CREATE TABLE queries got rejected with
"Too many simultaneous queries" during HOL-29 schema-discovery work,
because the backend's six worker hosted services keep CH busy with
small queries continuously. 50 is still well below the default of 100
but accommodates the actual concurrency. Insert/select sub-caps bumped
proportionally (10 -> 25 each).

Live-verified: max_concurrent_queries reads 50 from the running CH
container after recreate.

## Out of scope

- Volume migration tooling for production deployments — the swap drops
  hobby dev data (DevSeed recreates it on first backend start). Real
  upgrades need a pg_dump/restore plan.

Closes HOL-35.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
@BrewingCoder BrewingCoder merged commit f94ff41 into main May 9, 2026
4 checks passed
@BrewingCoder BrewingCoder deleted the issue-35-infra-tuning branch May 9, 2026 16:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant