question

Marc avatar image
Marc asked

Timeout/Slow connection issues

A few days ago we encountered a few problems related to timeout and slow speed connection. From devices (Android/IOS), from Unity and even in the PlayFab dashboard.

We checked the PlayFab Status at that moment and all systems were fully operational.

This happened at least 2 times in the last week.

Can you tell us any possible causes for this?

Thanks

Marc

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image
brendan answered

The most common cause would be an issue with your ISP.

The core PlayFab services are housed in AWS US-West-2, so http://www.cloudping.info/ is usually your best resource for checking ping times from your location.

In terms of the backend time to process calls, you can always find all the data on the average time to process every call (in an hourly breakdown) in your Analytics->Reports tab, in the API usage details report.

10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Marc avatar image
Marc answered

Hi @Brendan

This happens in different devices with different ISP. Anyway, we checked ping and we have 180-200ms latency. And the average call time does almost never exceed the 0.66s.

We found the option "Request Type" in the PlayFabSharedSettings asset and set it to "Http Web Request". This option improves the response speed, but still does not explain the timeouts.

But we notice that since this change, the http exceptions had increased.

We usually get this errors:

WebException: The request timed out

System.Net.HttpWebRequest.GetRequestStream ()
PlayFab.Internal.PlayFabWebRequest.Post (PlayFab.Internal.CallRequestContainer reqContainer)
Rethrow as WebException: Timeout: WebException making http request to: https://8FF3.playfabapi.com/Client/ExecuteCloudScript
UnityEngine.Debug:LogException(Exception)
PlayFab.Internal.PlayFabWebRequest:Post(CallRequestContainer)
PlayFab.Internal.PlayFabWebRequest:WorkerThreadMainLoop()

This happens (sometimes) when 2 calls to the api are launched at the same time. The exeption is thrown immediately without waiting the 10s timeout we set on PlayFabSharedSettings asset.

and

Exception:    at System.Net.WebConnection.HandleError(WebExceptionStatus st, System.Exception e, System.String where)
   at System.Net.WebConnection.ReadDone(IAsyncResult result)

System.Net.WebConnection.HandleError (WebExceptionStatus st, System.Exception e, System.String where) Rethrow as WebException: Error getting response stream (ReadDone2): ReceiveFailure System.Net.HttpWebRequest.EndGetResponse (IAsyncResult asyncResult) System.Net.HttpWebRequest.GetResponse () PlayFab.Internal.PlayFabWebRequest.ProcessHttpResponse (PlayFab.Internal.CallRequestContainer reqContainer) Rethrow as Exception: Unhandled exception in ProcessHttpResponse : https://8FF3.playfabapi.com/Client/ExecuteCloudScript UnityEngine.Debug:LogException(Exception) PlayFab.Internal.PlayFabWebRequest:ProcessHttpResponse(CallRequestContainer) PlayFab.Internal.PlayFabWebRequest:WorkerThreadMainLoop()

This one, we are not sure yet to know when it happens.

We checked the reports and no errors related have been found.

Thank you

Marc

1 comment
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

brendan avatar image brendan commented ·

You've pretty much nailed the answer - Unity HttpWebRequest doesn't handle multiple simultaneous requests well. The recommendation is to serialize them, so that you don't run into this.

1 Like 1 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.