question

Deekshith avatar image
Deekshith asked

Limitation on number of cloudscript calls from Front end

Is there any limitation on number of cloudscript functions that can be called from front end?

example: Consider there are 1000 users and each users makes around 100 cloudscript calls in 1 min .

So will there be any issues or limitation?

CloudScript
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

1 Answer

·
brendan avatar image
brendan answered

Yes, there's a rate limit of 5 calls to ExecuteCloudScript in 10 seconds per client. However, even that is only meant as the burst rate limit. Presumably, each of those calls is going to need to read and/or write data in the service. PlayFab's data systems are not in-memory hosted, like Redis (which would be necessary for what you describe to not cost a small fortune). But even if you didn't need to use any memory, that would still mean consuming nearly 100% of a Cloud Script VM per connected client, which also isn't what the service is designed to support (we would have to charge a lot more per MAU, if that were the case).

If you need to have high-frequency exchanges with the client, you'll need to use a dedicated server that hosts the information. When the client connects, the server would read all the necessary data from the service to host the state of the simulation for the player. The client device could then talk to the server at any rate you like, and the server would update the service when the session is done (or every couple of minutes, if your sessions are long).

2 comments
10 |1200

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.

Deekshith avatar image Deekshith commented ·

So it means if I try calling 6 ExecuteCloudScript within 10 seconds then the 6th call won't work, right?

Also Will Playfab be throwing any specific error for that 6th ExecuteCloudScript call?

0 Likes 0 ·
brendan avatar image brendan Deekshith commented ·

Yes, if you try to exceed any API rate limit, the client will get the error APIClientRequestRateLimitExceeded.

0 Likes 0 ·

Write an Answer

Hint: Notify or tag a user in this post by typing @username.

Up to 2 attachments (including images) can be used with a maximum of 512.0 KiB each and 1.0 MiB total.