Help with debugging MongoDB connection leak

Hi, we have a Parse deployment running on AWS elastic beanstalk that connects to MongoDB atlas. We noticed that as the server is running, the number of connections to MongoDB will slowly increase over time (like a handful each hour). The number of Parse objects in memory also seem to increase slowly over time, and the overall server response time will increase as a result. It seems that we have some leaks of Parse objects that lead to leaks of MongoDB connections, but we are not experienced with debugging this issue. Can someone help us with some tips on how to approach this issue? Like key locations to add breakpoints, key events to log/monitor, some server configuration settings to check, etc…
Thank you very much!!

The number of connections between Parse Server and MongoDB is determined by the MongoDB Node.js driver and the connection parameters (connection pool size, etc.) that you configure in either the DB connection string or in the Parse Server DB options which are passed to the MongoDB driver. I suggest you review and share your settings.

Thank you for your quick reply!
We’re still using a very old parse-server version 2.8.4, with MongoDB 3.1.1. We just configure the mongodb connection string through the databaseURI parameter when starting the server, without any special configuration. Can you help me locate where I can set breakpoints to find the details you are asking for, and maybe where the logic triggers new connections to be created/recycled? Thank you very much!!

You‘d take a look at the Parse Server MongoDB DB adapter. The connections should be managed by the MongoDB driver though, I would assume that also older drivers use a concept of connection pooling.