I find that it is an extremely common occurrence that my CloudScript functions will exceed the time limit when they haven't run in some time. That is clearly because the first time they are run, they are loaded onto the server which takes some time. Subsequent calls run faster because of this.
Since CloudScript functions only allow a very small amount time before they timeout (5 - 10 seconds), I find it a little unfair that the time it takes to load them onto the server is counted towards the timeout limit. It makes it such that I need to rely on retry logic everywhere that a cloud function is called on my front-end.
Does anyone else have this issue and is there some general advice about this?
Thanks in advance.
Answer by Brendan · May 05, 2018 at 01:32 AM
If your script is running at close to the time limit under normal circumstances, it's highly recommended that you trim the time required. In general with servers, you should only be targeting around 80% of the theoretical max, for safety's sake. In the case of Cloud Script, for any game with a non-trivial player base, you should find that your scripts remain loaded most of the time, but it is always the case that there could be a condition that results in the script not being loaded on a logic server (or needing another logic server, if load is growing for your title), which will cause the script to have an incremental startup time.
Cloud script triggered action time limit exceeded in one specific time 1 Answer
Random generate unique items 1 Answer
CloudScript level entity api and limits 1 Answer
CloudScript .js file size limits,Cloud Script Javascript code limit 1 Answer
What happens when you're exceeding the CloudScript execution time limit too often? 1 Answer