Limits

Cloud Code scripts have limits for the amount of data that you can process to ensure that Cloud Code runs correctly.

Cloud Code API

  • The Cloud Code Client API service limits each player to 12,000 requests per minute.
  • The Cloud Code Admin API service limits each Service Account to 120 requests per minute.
  • The Admin API has lower rate limits, so don't call the Admin API on a per-player basis.

Cloud Code JavaScript scripts

  • Cloud Code scripts can't exceed 128 KB. Cloud Code rejects any requests to save or run scripts that exceed 128 KB.
  • You can't re-publish a Cloud Code script unless you make a change to the script.
  • The combined size of the POST request body (the script’s input parameters) when you execute a script can't exceed 1 MB.
  • A script's execution time can't exceed 15 seconds.

Cloud Code with other Unity services

  • All Unity services have a per-player rate limit to prevent API overuse. Cloud Code executes scripts in the same way a game client would with a player authentication token; therefore, the rate limit is shared between the game and the server code. For example, if you use Economy from both Cloud Code and the game, you may receive an unexpected rate limit error. It's important to account for both types of use when you debug these errors.
  • The environment in which you save the script is automatically the same environment when using other Unity services from within scripts. Scripts cannot access services in any other environment.

For more information on how to integrate with Cloud Code, refer to the Integrate with other Unity services page.