question

kaushikbhatt avatar image
kaushikbhatt asked

How to decode high number of API call errors

Hi,


We recently soft launched our game and are seeing high number of API call error on PlayFab side specifically with subtractVirtualCurrency API call and another with getInvetory.

Our uasge of Subtract currency is high based on how the player behaviour is; due to the fact that this is a casino based game so we need to deduct the amount immediately from player wallet on betting or other spend actions. Now if we have 1000 CCU and each player may hit the API several times in a min is that going to cause large API call errors?

Is there a way to check if we need to optimize how we use the API and find out the root cause of this issue. Our worry being when we do a Hard Launch the number of players hitting the API would reach 2x or 5x or even 10x.

Thanks

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.

Andy avatar image Andy ♦♦ commented ·

I'd like to take a look at your titles call history and what errors you're seeing today. Could you let me know your title id?

In general, we scale our services with your CCU. As you grow, we do as well to accommodate.

0 Likes 0 ·
kaushikbhatt avatar image kaushikbhatt commented ·

A0D3 is Title ID. This is happening since we were in development.. Initially my impression was coz of spamming the API; but now its Live and there is no question of spam.

So if you can pls check and let us know that would be awesome.

0 Likes 0 ·

1 Answer

·
brendan avatar image
brendan answered

If your usage case is a few calls per minute over the course of a player session, that wouldn't be a problem. From what you're describing, it sounds like what you actually have in mind is a high number of VC update calls per minute, per player. If that's the case, what you'll be better off with is a custom game server solution where the client connects to the server and has a high rate of data updates with it, with the server periodically updating the backend data store.

But let's check the specifics: What is your worst-case for the frequency of updates? That would allow us to advise you more specifically.

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

kaushikbhatt avatar image kaushikbhatt commented ·

Worst case would be 5 players play super quick when their turn comes, so say 1 updated per sec per user x number of betting rounds. The betting round is diff for diff tables as each table has a Pot limit.

So with base bet being 10 it would take 1024 bets to reach Pot limit with 5 players that would be 200 bets back to back in super quick succession.

If you can look at the error reasons and let us know that would give me a better idea if this is the real problem.

0 Likes 0 ·
brendan avatar image brendan kaushikbhatt commented ·

Can you clarify what that means in terms of an API call rate? The simple answer to your question is that, as stated above, a few calls per minute per player overall wouldn't be a problem. If you have a significantly higher call rate requirement, it's possible that you'll need to consider a custom game server solution.

0 Likes 0 ·
kaushikbhatt avatar image kaushikbhatt brendan commented ·

its difficult to forecast as I tried to explain. Its entire on how fast a user presses the Bet button. I dont think that is the problem but I cant see the reason why there are so many API call errors only with

/admin/subtractuservirtualcurrency

and

/admin/getuserinventory

so unless I get to know whats the cause of failing I cant say our VC update calls are the root cause.

Can you email me the error log if possible for the API errors?

0 Likes 0 ·
Show more comments
kaushikbhatt avatar image kaushikbhatt commented ·

Still this does not completely answer my question. What is the cause of this error? Are you seeing error because the clients are calling the API too often OR the playerID is wrong? OR something else? There would be different error codes showing on your servers for diff issues. I need to know whats the error root cause.

Do you think that is something you can help me debug? Or I just assume its too many calls?

0 Likes 0 ·
Andy avatar image Andy ♦♦ kaushikbhatt commented ·

Taking a look at the API Call chart on your dashboard, it appears the most common error is InvalidParams on both the SubtractUserVirtualCurrency and GetUserInventory calls. This means you're passing us bad data in your request. To debug further, you could try mimicking your requests in postman (tutorial here: https://api.playfab.com/docs/tutorials/execute-playfab-api-via-postman). Examining the response body should give you more info to go on.

0 Likes 0 ·
Andy avatar image Andy ♦♦ kaushikbhatt commented ·

I also noticed that these calls appear to be coming form the Admin API, not the client. Do you have a server or some other tool that's making them?

0 Likes 0 ·
kaushikbhatt avatar image kaushikbhatt Andy ♦♦ commented ·

Perfect. Thanks for that info. Apologies I later realized that the same info can be extracted from PF Dashboard too where you can filter the API events etc.

My hunch is that our AI players are trying to update their wallets from cutom server and thats whats causing the invalid param. I've added the check and will observe the results on Dev env and push a patch in couple of days.

Thanks guys.

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.