#Cloud Code Module Performance

1 messages · Page 1 of 1 (latest)

austere thunder
#

If you've got a lot of code in that single module it could take a little bit longer for it to be available from cold-start (the very first call), my guess would be it's negligible for most use-cases/scales though.

I'd recommend you optimize for your workflow / minimal complexity first. A single module would be where I'd start until I had signal that a hot-codepath would benefit from being separated.

@eager canyon any additional insight?

warm turtle
#

fair enough thanks! what does it mean cold start in terms of UGS first call any code from this module after module updated? or for example when I have 0 CCU the service down and the next start will also be cold?

eager canyon
#

@warm turtle a cold start is typically needed when your Cloud Code module has not been called at least once in a 15 minute time window. So during development you might occasionally need to wait a couple of seconds (typically much less than 10 seconds) for your module to start up and return responses. To answer your question directly - yes, when you have 0 CCU for 15 minutes, there will be a cold start cost.

There should be no noticeable cold start latency when updating a module. After you've submitted your new module version, Cloud Code will continue to serve requests to your cloud code module and only redirect traffic to the new version that you have deployed, once it is ready to receive requests.

If you have a very large amount of code in your module (in the order of 50-100MB), you could notice an increased cold start latency, but the increased latency will be in the order of a couple more seconds at most. See this page for some more detail about the limits of Cloud Code - https://docs.unity.com/ugs/en-us/manual/cloud-code/manual/modules/reference/limits, specifically notice this line "The combined size of all .ccm files in your project can't exceed 128 Mb in size."

All this being said, if you have at least 1 CCU making 1 call to cloud code within a 15 minute window, then your players will never encounter the cold start.

#

In most cases, a single module should be fine and like dsiems mentioned, rather focus on your game features right now!