Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Initial connection time #328

Open
TecbeckMacBook opened this issue Mar 21, 2023 · 9 comments
Open

Initial connection time #328

TecbeckMacBook opened this issue Mar 21, 2023 · 9 comments

Comments

@TecbeckMacBook
Copy link

TecbeckMacBook commented Mar 21, 2023

I have used this package in my flutter app and connected my db with the following two lines:

var db = await Db.create("MY_URL");
await db.open();

These two lines are taking 10-15 seconds on average to execute which is a huge time. User waits at the splash screen for this much time because I have to show data after fetching from mongo db on the homepage of my app. What should I do to make the initial connection faster?

@giorgiofran
Copy link
Contributor

Where are you connecting?

@TecbeckMacBook
Copy link
Author

Where are you connecting?

Sorry, I didn't get your question.

@giorgiofran
Copy link
Contributor

giorgiofran commented Mar 21, 2023

Are you connecting to some cloud service, like Atlas, or do you have a specific server.

@TecbeckMacBook
Copy link
Author

Are you connecting to some cloud service, like Atlas, or do you have a specific server.

I am using Atlas.

@giorgiofran
Copy link
Contributor

Free Tier?

@TecbeckMacBook
Copy link
Author

Free Tier?

Yes.

@giorgiofran
Copy link
Contributor

There were other person reporting this problem with Atlas, but I didn't get if it depends only on the Tier or if it is Atals itself.. If you try to connect locally or on a remote server created by you, the connection time is by far better.

@JohnF17
Copy link

JohnF17 commented Mar 22, 2023

I think we could confirm which has an "issue" by running a few tests, I for one, am currently running on the free tier atlas and i have the same delay issue, not only that but I also get a random "No master connection" or "Connection lost" error messages (I'll manage to get the proper error messages next time). But I did manage to get around that by having an RX value to listen to those changes (in errors) and try to reconnect after a few seconds. But going back to the main issue:

  • Check the connection type, is db.open(secure: true) faster, the same, just as bad or even worse? (Checking this because when I get the connection lost error, it also tells me to try without making tsl=true or secure: true, and I've done neither so it should not disconnect but it happens)
  • Then since we know Current Free tier users have reported the supposed delay, we understand that there is a delay on atlas + free
  • Now check if there are users that report delay issues on atlas + paid
  • Then find other backers that confirm it connects fast or barely slow when connecting to a remote server or locally (like you have confirmed)

And then I think we'd have an understanding if its a problem with Atlas itself, or the Free tier only.

@DennisKragekjaer
Copy link

Yes same problem here, random Connection Exception, retry after some seconds and it works. But that is making me nervous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants