Skip to content
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

Closed
vlad0337187 opened this issue Jan 9, 2018 · 4 comments
Closed

Timeout connection after near 100 requests to MongoDB #2384

vlad0337187 opened this issue Jan 9, 2018 · 4 comments

Comments

@vlad0337187
Copy link

vlad0337187 commented Jan 9, 2018

(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

@docker-robott
Copy link
Collaborator

Issues go stale after 90d of inactivity.
Mark the issue as fresh with /remove-lifecycle stale comment.
Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

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.
/lifecycle stale

@YRM64
Copy link

YRM64 commented May 6, 2018

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.

@deiga
Copy link

deiga commented Nov 14, 2018

@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

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

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.
/lifecycle locked

@docker docker locked and limited conversation to collaborators Jun 26, 2020
# for free to subscribe to this conversation on GitHub. Already have an account? #.
Projects
None yet
Development

No branches or pull requests

5 participants