Skip to content

Test configs to mongodb connection#400

Merged
jue-henry merged 5 commits into
mainfrom
henry-db-test
Jun 8, 2026
Merged

Test configs to mongodb connection#400
jue-henry merged 5 commits into
mainfrom
henry-db-test

Conversation

@jue-henry

Copy link
Copy Markdown
Contributor

No description provided.

@jue-henry jue-henry self-assigned this Jun 5, 2026
@jue-henry jue-henry linked an issue Jun 5, 2026 that may be closed by this pull request
@jue-henry

Copy link
Copy Markdown
Contributor Author

Results after adding the configs, not seeing much improvement and even potentially worse:
https://us-west-2.console.aws.amazon.com/cloudwatch/home?region=us-west-2#logsV2:log-groups/log-group/$252Faws$252Flambda$252Faniml-api-dev-graphql/log-events$3FfilterPattern$3D$2522Connected+to+MongoDB+in+$2522$26start$3D1780945740000$26end$3D1780946100000

But on mongoDB I am seeing a higher number of connections being made. Does this point toward actual DB slowing down trying to open these connections?

@jue-henry

jue-henry commented Jun 8, 2026

Copy link
Copy Markdown
Contributor Author

Setting maxPoolSize to 1 seems to help a lot:
https://us-west-2.console.aws.amazon.com/cloudwatch/home?region=us-west-2#logsV2:log-groups/log-group/$252Faws$252Flambda$252Faniml-api-dev-graphql/log-events$3FfilterPattern$3D$2522Connected+to+MongoDB+in+$2522$26start$3D1780955400000$26end$3D1780955520000

This is because lambdas do not process more than 1 request at once, and previously the default maxPoolSize of 100 would cause 100 connections to MongoDB on startup

@jue-henry jue-henry merged commit 0d41a78 into main Jun 8, 2026
2 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.

Experiencing Slow Connection Times to MongoDB

1 participant