Search Unity

  1. Megacity Metro Demo now available. Download now.
    Dismiss Notice
  2. Unity support for visionOS is now available. Learn more in our blog post.
    Dismiss Notice

Question "Max Concurrent Web Requests" Setting Best Practices for mobile?!

Discussion in 'Addressables' started by Peter77, Jun 29, 2021.

  1. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,590
    Unity 2019.4.20.f1, Addressables 1.18.4, Unity Cloud Content Delivery, Android Player.

    The Max Concurrent Web Requests setting is set to 500 by default:

    upload_2021-6-29_11-31-50.png

    Using
    Addressables.DownloadDependenciesAsync(IEnumerable)
    caused at some point all sorts of exceptions and errors, such as:
    • UnityWebRequest result : Received no data in response
    • Curl error 7: Failed to connect to xxx.client-api.unity3dusercontent.com port 443: Connection timed out
    • UnityWebRequest result : Cannot connect to destination host
    In various desperate attempts to fix it, I reduced Max Concurrent Web Requests from 500 to 20.

    This got rid of these errors. Was it just luck and is totally unrelated, or is the 500 default setting not feasible on mobile platforms?

    What's a reasonable "Max Concurrent Web Requests" setting for Android and iOS?

    Related post:
    Extremely slow download via Addressables.DownloadDependenciesAsync and Unity Cloud Content Delivery: https://forum.unity.com/threads/ext...ync-and-unity-cloud-content-delivery.1133434/
     
    Last edited: Jun 29, 2021
    chrismarch likes this.
  2. davidla_unity

    davidla_unity

    Unity Technologies

    Joined:
    Nov 17, 2016
    Posts:
    762
    I posted a bit about this on your showcase thread but I wanted to post something on here as well. It looks like it is a known issue with the current UnityWebRequest implementation where sending "too many" can cause timeouts and other failures.

    I'm having trouble finding what "too many" actual equates to but since I can't seem to find a direct answer that it varies somewhat.

    For mobile, 500 could be too high. We could probably change the default if your current build target is a mobile platform. I'll make a ticket for us to investigate doing that but I'm not sure when/if something like that would get added to the package.
     
  3. Peter77

    Peter77

    QA Jesus

    Joined:
    Jun 12, 2013
    Posts:
    6,590
    Thank you for the reply.

    Since I reduced the Max Concurrent Web Requests as mentioned above, I no longer see these errors. It seems it's related. I'll go with the "20" for now, unless you find a magic number that works best.

    Do you happen to know the public issue tracker URL to the issue?
     
    Raghavendra likes this.
  4. EmilieCollard191

    EmilieCollard191

    Joined:
    May 8, 2019
    Posts:
    77
    I have a similar problem. When I try to download 300+ asset that each have their own .bundle(Pack separately)
    my editor use nearly 100 cpu time but if I put 10-20 as Max Concurrent Web Requests it is ok.
     
    megavoid-de and Peter77 like this.
  5. CineTek

    CineTek

    Joined:
    Jul 12, 2013
    Posts:
    98
    We are encountering the same issue when players have the game installed on an HDD or are placed in a remote location e.g. the Phillipines. (hosted in Unity CCD)
    Currently running some testing to see if the 20 concurrent request fixes those issues.
     
    megavoid-de and Peter77 like this.
  6. megavoid-de

    megavoid-de

    Joined:
    Sep 29, 2020
    Posts:
    8
    We had the same issues. Setting the value to 20 fixed the problems we had, downloads are running buttery smooth now. We are getting full 150 MBit/s from our infrastructure now.

    How a webserver (or CDN) reacts to as many as 500 connection attempts really depends on the server configuration - by default it may very well classify the connections as a DDoS attempt. TBH, having 500 concurrent connections as a default value is nuts.
     
  7. Marc-Saubion

    Marc-Saubion

    Joined:
    Jul 6, 2011
    Posts:
    653
    Hi.

    Does this option still exist? I can't find it anywhere.