question

Jon avatar image
Jon asked

Cloudscript Pricing + Server API calls count

So I am taking a look at the cloudscript pricing. Here the pricing is based on total execution + execution time. Straight forward and similar to other serverless, but here is what I don't understand. In the limits I see a 25 playfab API limit + 1m byte cloud script limit.

How are these factored in the billing per invocation of cloud script? Are playfab api requests billed when called from cloudscript? How about the size of the cloud script?

The reason I ask:

We have a custom cloudscript to upgrade player equipment (set some custom data). There is a cost associated with the upgrade (<item_level, upgrade_cost>. Previously we stored this in our dynamodb table (to share between client and server). With playfab it seems the right place would be in title data.

So if cloudscript calls playfab to get the upgrade cost, that is 1 api call + some execution time.

However, another option is to just hard code this data into the cloudscript.js (we generated this js file so the values can be updated on new builds easily). This would save 1 api call and execution time for the trade off of a slightly larger cloudscript.js file.

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

The 25 PlayFab API call limit, as well as the 1MB total script size limit (not runtime memory limit, since you could be loading other data) are part of the legacy Cloud Script system. We highly recommend that all developers move to using Azure Functions Cloud Script, as it has fewer limits (like longer running scripts, using queued functions) as well as provides the option to use languages like C#.

That said, those limits aren't factored into pricing - they're just limits on what the legacy system allows. All API calls to PlayFab, whether made from a client, a server, a script, or an admin tool you write for your team, all contribute to the consumption meters as described in the documentation (https://docs.microsoft.com/en-us/gaming/playfab/features/pricing/meters/meters).

Or, put simply, Cloud Script does not include any budget for API calls back into PlayFab as part of its pricing.

1 comment
10 |1200

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

Jon avatar image Jon commented ·

I see, thanks for clarifying. Will the legacy cloud script be deprecated in the future?

We have some serverless running on AWS lambda (js) that would work similarly on azure functions, but legacy cloud script was just easier to integrate with as we don't have any infrastructure on Azure at the moment.

In any case, will explore azure function integration as well. Thanks again!

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.