question

brendan avatar image
brendan asked

UpdateUserData being throttled

As of midnight last night (UTC), I started seeing throttling on calls to UpdateUserData in my title, breaking game saves. I've re-written my title to optimize the saves, but I'm still seeing save issues periodically due to throttles and other null errors. I autosave every 60 seconds, and allow the player to manually save with a cool-down of 30 seconds. I also re-try the UpdateUserData request on a fail, up to an arbitrary number of times before abandoning the save attempt. Most of the time, saves work fine, but occasionally I'm having to abandon a save after 50 retries. How can I get error-free game saves?

Player Data
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

Only saving periodically is a good first step, and having a throttle on how often the player can force a save is also important, so that all sounds good. However, I had a quick look at the title to see what the issue could be, and what I'm seeing is that your use of UpdateUserData is actually far higher than that, so there may be a bug in the client that you'll want to look into. Currently, what I'm seeing is that you're issuing around 10,000 API requests per DAU. This far exceeds our fair use limit, which is why the rate limiting eventually kicked in and throttled the title - specifically, to protect the service. This was reflected in the request rate limit exceeded errors you were getting before the throttle kicked in - they're harder to see in your error chart right now, as the retry logic is creating an overwhelming number of errors, but you can see them back showing up consistently prior to that.

We've made an adjustment that should bring your error rate down temporarily, but it's critical that you update the title to reduce the call frequency, to prevent this from kicking back in again. I strongly suspect that the retries are the main issue (so, when the throttling kicked in, this exacerbated the problem, as suddenly all clients started hammering the call), but the main things to check are:

1. Make sure that the client is definitely following your design for save frequency (only once a minute, and throttling any player force-save attempts).

2. For the re-try, use an exponential backoff on the call. If the client, on a failure, is immediately re-trying the API call, that's only going to make things worse for all players. Instead, it should back off for an increasing period of time on each retry. Something like 2 seconds, then 4, 16, etc. Since you're trying to auto-save every minute, if it hasn't succeeded by then, backing off until the next automatic save attempt would be the best thing to do.

7 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.

bradgrimm avatar image bradgrimm commented ·

Thanks for the information. I will update the save functionality tomorrow. Do you know why the initial UpdateUserData requests occasionally fail in the first place?

,

Ok. Thanks for the information. I will update the save functionality tomorrow

0 Likes 0 ·
brendan avatar image brendan bradgrimm commented ·

I'm not seeing any case where a client makes its first call to UpdateUserData and has it fail. What I'm seeing is that the clients are flooding the service with the request, and so having all those rejected after they hit their rate limit. Once you've got the request rate down to a safe level, if there are still any issues, we can have a look to see what's up.

0 Likes 0 ·
bradgrimm avatar image bradgrimm commented ·

Testing the full implementation of your suggestions now.

0 Likes 0 ·
bradgrimm avatar image bradgrimm bradgrimm commented ·

I am not seeing any playfab request errors and have pushed the current version.

0 Likes 0 ·
bradgrimm avatar image bradgrimm bradgrimm commented ·

no retries yet either.

0 Likes 0 ·
Show more comments

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.