MongoNetworkError Connection Timed Out


I have a MongoDB Server on an EC2 instance. My meteor app is hosted on Heroku and is connected to said Server. We’ve had about 2 months uptime and just yesterday things crapped out causing the app to crash.

Logs show `

Exception while polling query {"collectionName":"Foo","selector":{"barId":"9hcnn7vreGbM9dKSH"},"options":{"transform":null}} { MongoNetworkError: connection 5 to IP:27017 timed out`

at TLSSocket.<anonymous> (/app/.meteor/heroku_build/app/programs/server/npm/node_modules/meteor/npm-mongo/node_modules/mongodb-core/lib/connection/connection.js:259:7)
 at Promise.asyncApply (packages/mongo/mongo_driver.js:1042:14)

This then repeats for what seems like an infinite amount of lines. I can see it being done for several other queries. Seems like clients had several connections trying to query data and the logs are showing failure for all of them?

Restarting the Heroku dynos seems to have resolved things. I also checked the mongod.log file. I’m seeing msg":"Slow query" on some line, but other than that, nothing stands out (or rather, I’m not sure what to look for).

Never had this issue before. Sounds like it could just be an anomaly with the connection, or maybe the DB being bogged down? Any insights? Thanks!