-
Notifications
You must be signed in to change notification settings - Fork 62
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
Atlas Device sync - very high latency 200 to 400 ms on read and write #1708
Comments
➤ PM Bot commented: Jira ticket: RKOTLIN-1060 |
I am facing the same high latency issue as well in my project, here is what I have done:
with latency ranging from 300ms to up to 600 ms while the iOS SDK for the same data and operation is giving a very good latency ~30ms |
From the documentation of Do you need |
Is your friend, who's working on the iOS app developing against the same Atlas App Services application? If you can share links to some logs showing low latency as well as some logs showing high latency, we could be able to check and see if there's any clues there. |
Hi @nirinchev , now in this second screenshot the ios app logs write transaction at the bottom are between 36 and 46 and thats 10x times lower , which made us wonder why , for the ios we are using the free plan ,, |
Hi @kneth, thanks for the reply. As for using In the documentation,, it says that frozen objects must be first converted to live objects using |
So just to confirm, those two apps (iOS and Android) are synchronizing with two different Atlas App Services applications? If that's the case, then the most likely reason is how they're setup on the backend. For optimal results with sync, you want a local deployment model and make sure that the app services application is colocated with the Atlas cluster. |
Is your Atlas cluster also running on AWS in Frankfurt? |
The latency is almost certainly due because your Device Sync app servers are not in the same region as your Atlas cluster. If you place them in the same region you will greatly improve your latency. |
i think you are right , we made device sync in same region as atlas cluster , the layency is now between 30 and 60 as you see in pic below , and this is great , thank you for your collaboration @ianpward , @nirinchev , @kneth |
we are using this realm kotlin with Atlas device sync , we followed the tutorial made by the device sync team on mongo db website , the sync and everything works well , but the unusual thing is that we noticed the latency is very high in the mongodb logs , is always above 200 ms to 400 ms , whether its a read or a write or even update , what makes me wonder is a friend of mine is using swift sdk to make an ios app ( same as mine ) and latency on his side is about 40 ms only , and that's a huge difference ,
u can see the mongo db logs below :
you will find below an example function that creates a trip document for example ,
we tried also to make the document schema variable names as short as possible to reduce the document size but the latency stayed the same between 200 ms to 400 ms. ,,
we also tried the todo app template provided by mongo team and it gave us same latency , so we are wondering if this is related to the kotlin sdk ,
as a final try , we tried the java sdk and same results .
**realm version : 1.13.0
Android Studio version: Android Studio Iguana | 2023.2.1
Android Build Tools version: 8.3
Gradle version: 8.3**
The text was updated successfully, but these errors were encountered: