Search Unity

  1. We are migrating the Unity Forums to Unity Discussions. On July 12, the Unity Forums will become read-only. On July 15, Unity Discussions will become read-only until July 18, when the new design and the migrated forum contents will go live. Read our full announcement for more information and let us know if you have any questions.

Feedback Any Reason Why Our Communication With Rest-API and Unity is Slow?

Discussion in 'Multiplayer' started by umityayla, Nov 28, 2019.

  1. umityayla

    umityayla

    Joined:
    May 21, 2019
    Posts:
    26
    We have a Unity3D Game. It sometimes needs to make Rest-API calls to the remote server. Remote server has uwsgi(tried gunicorn, didn't change much)+python+flask+haproxy+mongodb (I just laid out our entire back-end stack). We use proyecto26 on our game as a rest client driver. The problem is, we sometimes get gigantic latency issues. Normally it's around 100-300 ms. But sometimes it spikes up to 13000 ms (13 seconds). But when I try our server with postman. I get latency results around 100-300 ms. Any idea what could be the reason?

    Our Unity version is 2019.1.4f1
     
  2. tobiass

    tobiass

    Joined:
    Apr 7, 2009
    Posts:
    3,086
    You could capture the network conversation with Wireshark. When the problem appears, you can look up if it's a delay server-side or if the client is behaving strangely.
    Your client will trigger more work on the server than postman, so it's not a reliable (full) test.