question

brendan avatar image
brendan asked

API request throttled - how to fix

Question from a developer:

We're using PlayFab for our game, and just launched our alpha. But shortly after launch, we started getting this error:

>>> The client has exceeded the maximum API request rate and is being throttled

We call GetTitleData from the client every 5 seconds, so we don't know what's wrong. How can we determine what theissue is and how to fix it? Is there something we need to upgrade?

Title DataIn-Game Economy
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

Specifically, that message is telling you that one or more clients tried to use one or more API calls at a rate that exceeded what your title is provisioned for, and so was throttled. Those throttles are in place to ensure that no one game can cause a disruption to the service. When you see this, the thing to do would be to have a look at your title, to see what it's doing and why that might be happening.

In this case, have a look at the API requests chart on the dashboard for your title. As you can see, while you only have a handful of players signed in, you're hitting GetTitleData and GetUserInventory at a high rate - far higher than once every 5 seconds, it looks like. Can you have a look at the client code to confirm how it's using those calls?

But also, why is that even necessary? Title data should only be changing rarely, so checking it once per session, or at the start of a match, is normally sufficient. How exactly are you trying to use Title Data? User inventory is similar - once you have it locally, the only changes would be due to consuming, granting, or buying items, and you'll have responses for each of those with the updated items. So for both, you should be able to request them once, and only rarely need to re-request them.

10 |1200

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

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.