Skip to content

Add Prisma connection pool configuration #110

Description

@therealjhay

Description: The PrismaClient is instantiated with no connection pool configuration. Defaults may not be optimal for the expected load, especially for the api-gateway which handles all database traffic.

Requirements:

  • Configure connection_limit in the Prisma datasource (e.g., pool_timeout=10&connection_limit=20)
  • Set appropriate pool timeout for the workloads
  • Document the chosen values with rationale in comments
  • Make pool size configurable via env var DATABASE_POOL_SIZE

Suggested execution steps:

  1. Update prisma.config.ts or the DATABASE_URL with ?connection_limit=20&pool_timeout=10
  2. Alternatively, add DATABASE_POOL_SIZE to env schema and use it when creating PrismaClient
  3. Add a comment explaining the pool size rationale

Example commit message:

fix: configure Prisma connection pool size and timeout

Set connection_limit=20 and pool_timeout=10s via DATABASE_URL parameters
to prevent connection exhaustion under concurrent load.

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions