Conversation
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.
kmandryk
requested review from
NoorChasib,
alex-struk,
antsand and
dbarkowsky
as code owners
June 8, 2026 17:11
dbarkowsky
reviewed
Jun 8, 2026
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.
dbarkowsky
approved these changes
Jun 9, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
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: