question

Zhi Kang Shao avatar image
Zhi Kang Shao asked

Looking for details to reduce Profile Reads

Since the new pricing model our costs have gone up, primarily due to what's listed in the bill as Profile Reads. I'd like to optimize our game to do less reads, but it would be useful if I could access data such as:
  • Which PlayFab API calls are contributing the most for our title
  • Which custom CloudScript functions we wrote those calls originate from

Is there a way to obtain this kind of data?

CloudScriptpricing
10 |1200

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

Sarah Zhang avatar image
Sarah Zhang answered

There are some documentations about PlayFab Pricing. You can refer to this doc -- https://docs.microsoft.com/en-us/gaming/playfab/features/pricing/meters/profile-reads to check the APIs that cause the Profile read meter to increment.

Then you can check this doc -- https://docs.microsoft.com/en-us/gaming/playfab/features/pricing/consumption-best-practices#profile for the best practices of consumption.

Generally, some server, entity, multiplayer APIs would be called in the CloudScript. Please collect the API you used in your custom CloudScript functions, then retrieve them in the API lists that in the Pricing documentation.

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.

Zhi Kang Shao avatar image Zhi Kang Shao commented ·

Thank you Sarah. Is there a way to access for our specific title, the counts of the APIs as they have happened?

And do I understand correctly that an API call such as GetUserInventory adds a fixed value to the profile read meter? Or is the size of the data also taken into account?

0 Likes 0 ·
Sarah Zhang avatar image Sarah Zhang Zhi Kang Shao commented ·

>> Is there ...have happened?

Yes, you can navigate to this page -- https://developer.playfab.com/en-US/r/t/[YourTitleID]/reports/DailyApiUsageDetailsReport, replace the [YourTitleID] to your actual TitleID. In this [Reports] page you can find the Daily API Usage Details Report. The report will not be permanently saved on PlayFab, you can download their CSV files in the Game Manager or using admin API GetDataReport to get the download URLs. Using the report, you will be able to check whether the data was too large, or that a handler worked inefficiently. You can further utilize the report to tune the performance of CloudScript execution by adjusting its behavior and associated data.


>> And ... account?

The meter "ticks" for profile represent 1KB of data" a possible but not verified example is, one Profile read or write request contains 10 KVP with totally 11KB, so the avg size is 1.1KB, the meter number should be 10*1.1=11.

This thread is also a reference.

As PlayFab Support Overview says, we may discuss more technical questions in the community. More advanced questions about billing, you can submit them on the contact page for the professional support. Thanks.

0 Likes 0 ·
Zhi Kang Shao avatar image
Zhi Kang Shao answered

Hi Sarah,


Thank you for the very useful information. After inspecting the API usage reports for our title, we've come to the conclusion that our custom Cloudscript calling GetCatalogItems and GetUserInventory are the main contributors for profile reads. We have progression systems such as account leveling and rewards and many of their components need to retrieve catalog items to inspect the tags and custom data, or user inventory to read/write item custom data.

What's unfortunate in our case is that often we only need one item, or a subset of items, from the catalog/inventory, but PlayFab's API as far as we know don't have filtering options when retrieving them. Having a filtering option such as GetCatalogItemsByClass, GetCatalogItemsWithTag alone would cut our profile reads meter down by at least 60% (and save PlayFab bandwidth usage). A similar feature would be desirable for user inventory.

I read a reply from Brendan from 2016 in which he mentions that catalog retrieval with filtering was being considered as a new feature. Is this still in the works? Since PlayFab's new pricing model incentivizes optimizing network traffic, I hope the API feature set will also be updated to match that.

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.

Sarah Zhang avatar image Sarah Zhang commented ·

Currently, there is no ETA about such features. For any updates about the new features, please keep an eye on our blog, roadmaps, and release notes.

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.