Search Unity

Insane amount of network requests

Discussion in 'Unity Hub' started by MartijnGG, Nov 24, 2018.

  1. MartijnGG

    MartijnGG

    Joined:
    May 3, 2018
    Posts:
    74
    I'm running Unity Hub 1.3.1 and have noticed that it is generating an astonishing amount of dns requests.
    Over 120 per minute!

    These seem to be requests to status.cloud.unity3d.com, so I am assuming these are the "internet connectivity tests" that were mentioned in the 1.3.1 changelog notes.

    upload_2018-11-24_20-50-44.png

    The attached image is showing these requests as send to my pi-hole, a raspberry pi dns based ad blocker.
     
  2. mathieub

    mathieub

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    48
    Hi @MartijnGG,

    To offer an optimal online user experience, Unity Hub needs to know the current connectivity status, more specifically, it needs to know if the machine can reach Internet.

    Prior to Hub 1.3.1, Hub was monitoring the internet connectivity by sending DNS requests every 500ms. Some users legitimately complained that some DNS servers and proxies configuration prevent DNS request to be responded to.
    Therefore in Hub 1.3.1, Hub is performing HTTP requests when DNS is unsuccessful to monitor internet connectivity.

    That being said, I understand that you're argument is more about the Hub's polling mechanism and its frequency (would it be DNS or HTTP), am I correct?

    If yes, could you please develop the limitation of this polling based mechanism for you and any suggestion that would fit best?
     
  3. MartijnGG

    MartijnGG

    Joined:
    May 3, 2018
    Posts:
    74
    Correct, this is purely its DNS polling every 500ms (Which it still seems to do on 1.3.1)

    Why is this needed for the hub to function when minimized to the tray?
     
  4. mathieub

    mathieub

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    48
    This is required for the following reasons:
    - tray menu allows user to sign in from it, but the sign in item needs to be deactivated when no connectivity is available
    - more importantly, when an Editor is launched from the Hub, it's the Hub which is responsible to manage connectivity status for the Editor and communicate connectivity status changes.
     
  5. MartijnGG

    MartijnGG

    Joined:
    May 3, 2018
    Posts:
    74
    Would it be an unreasonable request to significantly decrease the frequency of these requests when I am already logged in, and don't have an editor open? This amount of http requests for such a small feature sounds like overkill.

    It has dwarfed the other requests my entire LAN makes by so much, that its not even funny anymore.
    I can imagine this gets even worse in studio's where multiple (lets say 10?) people have the hub open for work. That's a staggering 1200 http request every minute, I'm a bit worried of its effect on routers.
     
  6. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    I don't use any of your Services. I don't generally have the asset store window open. I'm pretty sure we've got analytics turned off. What does the editor even need to be online for? Do you need to do a DRM check several times a second?
     
  7. mathieub

    mathieub

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    48
    @MartijnGG Thanks a lot for you feedback. For the next major release we already plan to get rid off this polling mechanism. In the meantime, we'll drastically reduce the polling frequency in the next minor release.

    @Baste Editor does not need to be online and you can work offline without any trouble, but it needs to know if it's online for embedded services windows (collab, cloud build, asset store) even if you don't use it.

    Hub is responsible for the user account info management and network connectivity check and communicate it to the Editor. I can ensure you that it's not doing any DRM checks and you can see it by yourself by using a tool like Wireshark and inspect the packets.

    Hub is sending a DNS request and if it fails it's sending an HTTP options request (which weight nothing if you exclude the header)

    I hope this answers your concerns.
     
    laurentlavigne, MartijnGG and Baste like this.
  8. Baste

    Baste

    Joined:
    Jan 24, 2013
    Posts:
    6,334
    Thanks, and yes it does.

    In an ideal world, the editor wouldn't need to check those things before I actually try to use them - the editor startup and use is generally slow as molasses, so all kinds of "let's do this check and cache this data just in case you need it" isn't really something I'm happy about.

    Being able to just straight up toggle off collab and cloud build in Packman would be for the best, but I realize I'm totally derailing this thread. Very happy you're turning down the frequency of those checks.
     
  9. Fijit

    Fijit

    Joined:
    Sep 1, 2011
    Posts:
    7
  10. mathieub

    mathieub

    Unity Technologies

    Joined:
    Jun 28, 2017
    Posts:
    48
    Thanks for the suggestion @Fijit.

    Actually, we already assessed the idea of native implementations for the connectivity monitoring.
    We concluded that it would be the ideal solution, but it would also require us to develop platform specific solutions for the 3 OSes the Hub is supporting and we tend to avoid that.

    As mentioned above, we will change our approach and get rid of connectivity monitoring in coming major release.