Latency of Cloud Code / Regions as it scales

Hi,

I’m finding difficulty finding any info about this online. If Cloud Code is used for a game that is available globally, and relies heavily on Cloud Code, how does Unity ensure the latency is lowest relative to the user?
I don’t see any way to set a region for cloud code, is there automatic detection for where the user is to the closest Unity server available to execute the request?

Hi kuabs,

Right now, our services like Cloud Code are only available in the US (with some exceptions like Analytics, Remote Config, CCD, Vivox and Game Server Hosting). It’s on our roadmap to make our services available in other regions. If you wouldn’t mind, here are some questions that would help us consider this topic on our roadmaps:

  • Which specific regions would you like to be able to connect to? E.g., would US, Europe West and Asia work for you?
  • Which services other that Cloud Code would you like to be able to use in other regions?
  • How would you like to connect to a particular region? Would you like that to be automatic and/or would you like to be able to choose at runtime (e.g., for region specific accounts)?

Hi francoisjjunity-- Thanks for the reply.

  1. US, Europe West, and Asia certainly would be some of the top priorities in terms of market coverage. My concern right now is I don’t think I’d be able to do a release outside of NA given the information I’ve been provided, as I’m concerned a user in say, Asia, would have too long of a delay in response from cloud code, which my game will utilize heavily. I’m not sure if you all have done tests with response time from cloud code from around the world, but I’m assuming most testing has been in the US. Also, if possible, could you show me in the docs where it mentions this is a US-region-only feature currently?

  2. Other features that I’d like to use in across regions would be Authentication, Cloud Save, Cloud Code, and Economy.

  3. I would prefer automatic. Meaning, I would like to just provide one global experience to players, but under-the-hood when they call UGS services, it would be ideal if Unity could detect their location, detect the region closest to them that has, for example, the Cloud Code for my project deployed, and then route their traffic there. I personally don’t have a usecase for region-specific accounts that are isolated from the rest of the regions, so this automated would be ideal by a landslide.

That is excellent feedback, thank you!

  1. Unfortunately, we do not have that type of information publicly documented just yet. The services that do feature multi-regional presence, do so usually to optimise latencies for real-time multiplayer games. For example there is documentation on the regional support for Game Server Hosting (Multiplay), Relay, Matchmaker and others. e.g. Relay locations and regions and Regions

We really would like to support multi-regionality in the way that you have described, so I will take this as another piece of feedback to help us prioritize this work in our roadmaps.

1 Like

Thank you @francojjunity . I will do some testing on my end to try to see how slow cloud code response time is in other regions, perhaps through VPN or some other method since I’m based in the US myself.

Since I’m working with limited resources, I wanted to simplify my game design to not have to rely on dedicated game servers, which is why I’m going for more of a “asynchronous” multiplayer type of approach with cloud code.

My main ask would be that when regions are rolled out for Cloud Code, try to make the path to utilizing it as easy as possible for those of us already built on cloud code. And if there’s any way I can see if this makes it onto a roadmap via notification or otherwise, I’d be very interested.

I want to go with a pure UGS solution, but this will become increasingly necessary over time. When compared to other Cloud Serverless architectures, for example Azure, you could have an Azure Function app in each region you wish to support, to keep latency down. A similar approach, but more optimized for gaming (via the automated functionality we discussed earlier, ie choose which regions you wish to support and Unity handles routing based on user location) could be implemented to compete from the UGS side.

2 Likes