Skip to content

Ai 1238 - #185

Merged
kmandryk merged 4 commits into
developfrom
AI-1238
Jun 11, 2026
Merged

Ai 1238#185
kmandryk merged 4 commits into
developfrom
AI-1238

Conversation

@kmandryk

@kmandryk kmandryk commented Jun 8, 2026

Copy link
Copy Markdown
Collaborator

Summary

AI-1238
Configure Prisma connection pool to match backend pod capacity

Changes

Testing

Checklist

By submitting this pull request, I acknowledge that I have attempted to meet the following:

  • a self-review of my code
  • commented code particularly in hard-to-understand areas
  • corresponding changes to the documentation where required
  • changes tested to the best of my ability
  • no new errors or non-functional code

kmandryk added 2 commits June 5, 2026 14:45
Introduce DB_POOL_MAX support and sane defaults for Prisma/pg connection pools. Adds getPrismaPoolMax utility (default backend=20, temporal=3), uses it in backend PrismaService and temporal worker client, and surfaces the pool size in startup logs. Update env samples, kustomize configmap, OpenShift overlay templates, and deployment scripts to include DB_POOL_MAX (dev=20, prod example=10). Update docs (HA and env config) to explain sizing and impact on Postgres max_connections, and add unit tests for getPrismaPoolMax.
Read k6 env vars LOAD_TEST_VUS and LOAD_TEST_DURATION in read-benchmark-datasets.js and switch options to use vus/duration when provided, otherwise keep the staged ramp fallback. Add -e LOAD_TEST_VUS and -e LOAD_TEST_DURATION to the k6:datasets npm script so Docker runs receive the vars. Change seeded document statuses: seed-hitl-fixtures uses awaiting_review instead of completed_ocr, and seed-large-dataset uses extracted instead of completed_ocr to match expected test states.
Comment thread docs-md/HIGH_AVAILABILITY.md Outdated
Reduce the default per-pod Postgres connection pool size from 20 to 10 across the codebase and docs to keep total connections under Postgres' default max_connections at HPA max scale. Updated constants and helpers (backend & temporal utils), env samples and OpenShift config/examples, HPA comments and HA docs, the deploy script default, and a unit test expectation. Also adjusted minor import formatting and Prisma comment to reflect the new default. Single-replica load-test behavior can still override DB_POOL_MAX=20 in instance envs if needed.
@kmandryk
kmandryk merged commit f893836 into develop Jun 11, 2026
12 checks passed
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.

2 participants