Skip to content

fix(db): cap postgres connection pools#359

Open
raymondjacobson wants to merge 1 commit into
mainfrom
codex/db-pool-caps
Open

fix(db): cap postgres connection pools#359
raymondjacobson wants to merge 1 commit into
mainfrom
codex/db-pool-caps

Conversation

@raymondjacobson

Copy link
Copy Markdown
Contributor

Summary

  • add a shared dbpool helper that applies conservative connection-pool defaults to long-lived Postgres pools
  • cap core, eth, and mediorum pgx pools at 8 max conns by default while preserving explicit pgxpool DSN params
  • reduce mediorum GORM/sql pool from 50 max open conns to a 20 max / 5 idle default with env overrides

Pool knobs

  • OPENAUDIO_PGX_POOL_MAX_CONNS
  • OPENAUDIO_PGX_POOL_MAX_CONN_IDLE_TIME
  • OPENAUDIO_GORM_MAX_OPEN_CONNS
  • OPENAUDIO_GORM_MAX_IDLE_CONNS
  • OPENAUDIO_GORM_CONN_MAX_IDLE_TIME

Testing

  • go test ./pkg/dbpool ./pkg/core ./pkg/eth
  • go test -c ./pkg/mediorum/server -o /tmp/mediorum-server.test

Notes

  • go test ./pkg/mediorum/server still requires its local Postgres harness on localhost:5454; without that harness it fails during TestMain database setup before package tests run.

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