-
Notifications
You must be signed in to change notification settings - Fork 122
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
Timeout connection after near 100 requests to MongoDB #2384
Comments
Issues go stale after 90d of inactivity. Prevent issues from auto-closing with an If this issue is safe to close now please do so. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
It's critical to comprehend MongoDB Client Timeout Options. First, "connection timeout is the number of milliseconds the driver will wait before a new connection attempt is aborted". Mongo driver uses 30s as a default value of the server selection timeout; this time element can be manipulated. However, Mongo Java and Nodejs driver have a default socket timeout of 0s (essentially no timeout). Ruby on the otherhand has a 5s socket timeout. You don't want to manipulate these timeout sessions because the various operations are using that specific timeframe to operate. Also, keep in mind that the MongoClient timeout options vary depending upon the specific version your system is utilizing. Variances also exist amongst the different languages of the Mongo drivers. You must visit https://scalegrid.io/blog/understanding-mongo-client-timeout-options to understand your default timeout choices. |
@vlad1777d I'm encountering a similar issue but it seems unrelated to Docker For Mac as I have this same symptom also on Linux hosts. It' super frustrating that mongodb connections suddenly just drop off without any actual issue and then don't come back at all without downing and creating a new container |
Closed issues are locked after 30 days of inactivity. If you have found a problem that seems similar to this, please open a new issue. Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. |
(in progress, I saved it not to lose information)
Expected behavior
Some connections would be finished with "ECONNRESET", some - with success. Just like when running this on host.
Actual behavior
When I send 1000 requests to MongoDB on host machine at the same time - some of them (57) were finished with error "ECONNRESET", other 947 - finished with success.
When I send even 100 requests from host machine (MongoDB node driver), after some amount of requests, only 649 were finished with success, near 164 were finished with "ECONNRESET", all other were just waiting and after some time it begins to slowly display:
"connection 960 to mongo:27017 timed out",
and so on for other connections.
After this "timeout" messages started appearing, no one other connection to Mongo didn't finished neither with "ECONNRESET", nor with success.
Information
Steps to reproduce the behavior
The text was updated successfully, but these errors were encountered: