-
Notifications
You must be signed in to change notification settings - Fork 2
chore: lower rds resources #113
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR lowers RDS resource usage and surfaces a new pool-size setting for the application’s database connections.
- Adjust Aurora Serverless v2 minimum capacity to 0 for cost savings
- Add
POSTGRES_POOL_SIZE
environment variable to ECS task definition - Wire
POSTGRES_POOL_SIZE
into Prisma’sconnection_limit
at runtime
Reviewed Changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated no comments.
File | Description |
---|---|
infrastructure/database/vars.tf | Lower default Aurora min_capacity from 0.5 to 0 |
infrastructure/api/ecs.tf | Inject POSTGRES_POOL_SIZE env var with hardcoded value “1” |
backend/src/prisma.service.ts | Parse POSTGRES_POOL_SIZE and apply it to Prisma’s pool size |
Comments suppressed due to low confidence (3)
backend/src/prisma.service.ts:10
- [nitpick] Add a comment or update README/docs to explain the new
POSTGRES_POOL_SIZE
variable and its effect on the Prisma connection pool, ensuring team members know how to override it.
const DB_POOL_SIZE = parseInt(process.env.POSTGRES_POOL_SIZE || "5", 10);
infrastructure/database/vars.tf:41
- Aurora Serverless v2 requires
min_capacity
to be at least 0.5 ACU; setting it to 0 will cause Terraform apply failures. Consider reverting to 0.5 or confirming that 0 is a valid value in your target AWS region.
default = 0
infrastructure/api/ecs.tf:204
- [nitpick] Hardcoding the pool size in the task definition makes tuning across environments harder. Consider defining
postgres_pool_size
as a Terraform variable and referencing it here for configurability.
name = "POSTGRES_POOL_SIZE"
No description provided.