Slow connection on IOS devices or looses connection while joining a match

Dear Nakama developers,
first of all i want to thank you all for this amazing and supportive team who helped us through out this journey, it will have not been possible to come this far without you.

we build an unity application using nakama that runs on both IOS and Android, the game works fine on android devices without delay, but the same app on IOS will take so much time to load data from the database, and when you try to join a match it takes forever for OnReceivedMatchmakerMatched to happen,
testing between two devices, one android and one IOS the android joins the match instantly, but the IOS either takes too much time to pair or fails in the middle when trying to join the same match.
how can we improve this better?

some additional infos:
database: cockroachdb
deployment: AWS
Nakama nodes: 1 node
cockroachdb nodes: 2 nodes

this is the debug log that shows on xcode when disconnection happens


i have noticed this mostly happens on a bad internet connection.

and this is our config.yml

and in the Nakama log it shows

any help on this is appreciated.
thanks.

Hi @sana2024 , there are a lot of different reasons this could be occuring, but unfortunately we cannot help you diagnose custom infrastructure issues. We recommend using Heroic Cloud which is built specifically for your matchmaking use case and isn’t inconsistent across device requests.

@lugehorsam thank you for your reply,
I’ve looked into heroic cloud offers and it’s definitely an amazing deal, and I will for sure use it in my future personal projects, but I’m currently building this game for a company that consists of using their AWS infrastructure, which for sure harder for me to deal with.
but is there anything I can do on Nakama side to prevent this from happening?? anything that needs to be changed in the configuration that I listed above???

The timeout and wait configurations ultimately constitute a set of tradeoffs, but won’t paper over a bad internet connection. Lower values will reject requests that otherwise would have been valid if not for the slow connection. But higher values will potentially result in more server resources for non-responsive clients and take longer to notify the client if there is a backend issue.I recommend that your company emails support@heroiclabs.com if they would like to discuss sustainable solutions to these types of issues.

thank you,
i finally been able to detect the issues, as you said the configuration will cause to not work over a bad internet connection, my session expiry was sent to the default which was 60 second, and that resulted in the session to exipre and send session reshresh everytime and this put a very large load load on the mobile device and the server that resulted in it to slow down, i’ve set the session expiry 3h.

1 Like