Closed cillaeslopes closed 4 months ago
Thank you for taking the time to submit your report! From the looks of it, this could be better discussed on our Discord. If you haven't already, please join here and send a new post in the # 🐈 nestjs-help forum. Make sure to include a link to this issue, so you don't need to write it all again. We have a large community of helpful members, who will assist you in getting this to work.
Is there an existing issue for this?
Current behavior
MongoDB connections doesn't seem to be closed after request is over. I've been monitoring the number of open connections on Compass and it gets higher and higher.
When I start the application it starts with 13 connections
If I simulate a high number of simultaneos requests it goes up to 35 connections
Then it never gets back to 13 so it only gets higher.
Minimum reproduction code
https://github.com/cillaeslopes/nest-mongo-test
Steps to reproduce
npm i
npm run start:watch
Then in another terminal:
node scripts/high-traffic.js
And observe mongodb connections with:
db.serverStatus().connections
Expected behavior
I'd expect the number of connections to get back to initial state once the requests are done
Package version
10.0.2
mongoose version
8.0.1
NestJS version
10.3.2
Node.js version
20.11.1
In which operating systems have you tested?
Other
No response