question

duartedd avatar image
duartedd asked

getting around limits of playfab/azure

Hello

I need a good way to go through all the players daily doing these procedures:

-grab the player title data

-make some HTTP post JSON data Calls to a graphql server

-process the response into JSON data format

-update the player title data appropriately with the json data

it works fine but the graphql database for the user can be quite large with 1000 items as a possibility.

This takes around 10 seconds to perform in functions/playfab.

I can split the calls up seperately (for example 10 different calls with 100 items each) it would then be 10 calls per player if they have that many items which should be rare.

But i was wondering what would be the best approach to have some scheduled task perform this?

I believe its only a 2 second maximum with scheduled tasks done through playfab right?

If so, then i think the only way would be to create a unity backend server and using a secret key playfab for that server to grab all the players and iterate through them to grab the playfab user title data that i need.

thanks for your help!

Daniel

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

·
Sarah Zhang avatar image
Sarah Zhang answered

>> I believe its only a 2 second maximum with scheduled tasks done through playfab right?

For the Legacy CloudScript or the CloudScript using Azure Functions (HTTP-triggered) that triggered by actions, the limitation of maximum execution time is not 2 seconds, but is 1 second. You can navigate to your title’s [Game Manager]->[Title settings]->[Limits] or https://developer.playfab.com/en-US/[YourTitleId]/limits (please use the real title Id to replace the [TitleId]) to check this limitation.

>> If so, then i think the only way would be to create a unity backend server…

Your workaround is feasible. Besides, although there is the above limit on the CloudScript using Azure Functions (HTTP-triggered). As this documentation - PlayFab CloudScript using Azure Functions - PlayFab | Microsoft Docs said, if you use the Queue-triggered Azure Functions, it can run for the extended periods of time. For your case, you can consider registering the queue-triggered Azure Functions to your title, and using the action to trigger them. For more information about the queue-triggered Azure Functions, please refer to the Azure documentation - Azure Queue storage trigger and bindings for Azure Functions overview | Microsoft Docs.

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.

duartedd avatar image duartedd commented ·

Thanks Sarah looking into the queue - triggered functions - it looks like it only has a 1 second as max or maybe i am missing something?

Queue function Queue payload

1

https://docs.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/quickstart

but i do read this:

  1. Ability to write queued Cloudscript functions that can run for extended periods of time since we asynchronously wait for it to complete.

so does this mean I can have this script run for 10 minutes or something if i iterate through all players to run the script daily?

0 Likes 0 ·
Seth Du avatar image Seth Du ♦ duartedd commented ·

There can be issues on this document page, and I will send a report to the team.

>>iterate through all players to run the script daily

This is not suggested, and it is preferred to use Scheduled Task in the common scenario. Please refer to Scheduled tasks quickstart - PlayFab | Microsoft Docs. You may select "Run actions on each player in a segment" so that you don't need to iterate players.

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.