Microsoft Azure PlayFab logo
    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Add-ons
    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA
  • Runs on PlayFab
  • Pricing
    • Blog
    • Forums
    • Contact us
  • Sign up
  • Sign in
  • Ask a question
  • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges
  • Home /
  • API and SDK Questions /
avatar image
Question by Dawid Burek · Oct 28, 2020 at 08:55 AM ·

API request limit reached when getting games list

I am creating a word game with async online multiplayer. My current design is to use SharedGroupData for game data storage and User Data for SharedGroupData references (player data can store up to 100 active games in a form of SharedGroupData Ids).

The problem I have is with custom GetGamesList function I wrote. It takes IDs of active games list from User Data and calls GetSharedGroupData for each. This triggers "PlayFab API request aborted, because API call count limit exceeded" error. As I understand, free tier allows for up to 15 API calls in a single request. Higher tier probably would allow me to handle the planned limit of 100 games, but I have a distinct feeling my design is wrong.

Will it scale at all or should I go the Photon Turnbased route or maybe even use custom solution with some kind of DB connection for games list storage?

Comment

People who like this

0 Show 0
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users

2 Replies

· Add your reply
  • Sort: 
avatar image
Best Answer

Answer by SethDu · Oct 28, 2020 at 09:37 AM

I am not sure which platform you are implementing the game, but in many SDK, PlayFab API is designed to be called asynchronously. If you are simply using a loop to iteratively call GetSharedGroupData or any other API, it is very easy to exceed the limit.

The suggestion is to create a “Page” feature on the display. After the list of Shared Group ID has been retrieved, you may divide them into several pages in the client. Then, each data refreshing is on the basis of each page. For example, 5 groups are refreshed at a time.

Comment

People who like this

0 Show 0 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image

Answer by Dawid Burek · Oct 29, 2020 at 01:22 AM

I am using Unity3D SDK, but the issue itself is in one of my CloudScripts. It takes UserData and iterated on its contents, getting SharedGroupData. My concern here is that even if I had paging, each time player refreshes games list, for each game there would be GetSharedGroupData call, just to check if anything changed. For example if player has 30 pending games, there would be 1 request to GetPlayerData endpoint (resulting in string containing 30 SharedGroupData id's) and 30 requests to GetSharedGroupData endpoint. If I would split it then would it scale to thousands of players? I can imagine situation where hundreds of players query games list at the same time, where each has at least a few games pending, which would result in thousands of GetSharedGroupData calls in short time.

Maybe it would be a better idea to store games list references in special SharedGroupData for each player?

Comment

People who like this

0 Show 4 · Share
10 |1200 characters needed characters left characters exceeded
▼
  • Viewable by all users
  • Viewable by moderators
  • Viewable by moderators and the original poster
  • Advanced visibility
Viewable by all users
avatar image SethDu ♦ · Oct 29, 2020 at 02:05 AM 1
Share

Please understand for client API calls, the limit is on the basis of single player, which means one player's limits won't affect other players'.

It also means when a player gets data via your method in the client and no error is prompted, in most of the cases, other players won't have errors.

avatar image subsoap · Oct 29, 2020 at 05:44 AM 1
Share

Use a paged system and then enforce a wait cooldown in game client for changing page tabs.

avatar image SethDu ♦ · Oct 30, 2020 at 02:08 AM 1
Share

More importantly, costs in PlayFab are specifically usage-based, and it is highly recommended optimizing the call rates to be as low as you can manage while implementing any features. Having a single “summary” file that contains references to the various "savegame" files might be a workaround.

avatar image Dawid Burek SethDu ♦ · Oct 30, 2020 at 09:48 AM 0
Share

That's exactly what I was worried about. I guess I will have to implement both paging and data update timestamp in player profile, so that I don't have to get all SharedGroupData that did not change since last query.

Thanks both for your valuable input!

Your answer

Hint: You can notify a user about this post by typing @username

Up to 2 attachments (including images) can be used with a maximum of 524.3 kB each and 1.0 MB total.

Navigation

Spaces
  • General Discussion
  • API and SDK Questions
  • Feature Requests
  • PlayStream
  • Bugs
  • Add-on Marketplace
  • LiveOps
  • Follow this Question

    Answers Answers and Comments

    3 People are following this question.

    avatar image avatar image avatar image

    PlayFab

    • Multiplayer
    • LiveOps
    • Data & Analytics
    • Runs on PlayFab
    • Pricing

    Solutions

    • For Any Role

      • Engineer
      • Designer
      • Executive
      • Marketer
    • For Any Stage

      • Build
      • Improve
      • Grow
    • For Any Size

      • Solo
      • Indie
      • AAA

    Engineers

    • Documentation
    • Quickstarts
    • API Reference
    • SDKs
    • Usage Limits

    Resources

    • Forums
    • Contact us
    • Blog
    • Service Health
    • Terms of Service
    • Attribution

    Follow us

    • Facebook
    • Twitter
    • LinkedIn
    • YouTube
    • Sitemap
    • Contact Microsoft
    • Privacy & cookies
    • Terms of use
    • Trademarks
    • Safety & eco
    • About our ads
    • © Microsoft 2020
    • Anonymous
    • Sign in
    • Create
    • Ask a question
    • Create an article
    • Post an idea
    • Spaces
    • PlayStream
    • Feature Requests
    • Add-on Marketplace
    • Bugs
    • API and SDK Questions
    • General Discussion
    • LiveOps
    • Explore
    • Topics
    • Questions
    • Articles
    • Ideas
    • Users
    • Badges