question

matthilson avatar image
matthilson asked

Question on workflow between PlayFab and Azure on a large number of users

We have a scheduled task that calls an Azure Function which goes over the ‘All Players’ segment. We are wondering if calling the following flow on a large number of users will cause any throttling or hit any limits, or if there could be any improvements made on the flow.

For each user in the segment the following will happen inside an Azure function:

  • Grab the users player data
  • Read a title data key
  • Do some calculations on that player data
  • Update a statistic
  • Send an email
  • Potentially write back to the users player data

What would happen if this is called on the ‘All Players’ segment and that contains 100,000 users or even up to 1,000,000 users?

How can we test this to gain confidence on the flow before going live? Could we create 50,000 users with some dummy data to iterate over?

Thanks,

Matt

10 |1200

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

Richard Bates avatar image
Richard Bates answered

(I work with the OP)
We looked at Azure insights and noticed that the incoming requests are only 10 per second - this doesn't seem fast enough to trigger any scaling on the Azure side.
Is this the expected throughput?
Also - I upgraded our Playfab plan so that I could move this discussion to a support ticket (and be more open about our goals) but apparently that will only began on 1st November.


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

Gosen Gao avatar image Gosen Gao commented ·

Since you are using queue triggered function, the requests will be sent to the queue storage first. And then, the Azure Function will pick up the requests and process them based on your config. Can you check the queue to see how many requests we sent?

0 Likes 0 ·
matthilson avatar image matthilson commented ·

In addition to the above. We are looking to run this on up to 500k players at a time and within that Azure function app, call a couple of PlayFab API. What’s a realistic time we could be looking at for this to execute on all those users?

And is there anything on the Azure side we can configure to increase concurrency when PlayFab is triggering these calls. Or perhaps any other workflow optimisations we could be looking at?

0 Likes 0 ·
Adam Cheong avatar image Adam Cheong commented ·

Hi, We're seeing outbound requests from playfab entering the the Azure message queue at about 10 players per second which seems pretty slow if we have any significant amount of players, does that sound right?

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao Adam Cheong commented ·
0 Likes 0 ·
Gosen Gao avatar image
Gosen Gao answered

If your Scheduled Task executes an Azure Function on a lot of users, it may take a long time to complete the Task, based on how many users effected and how complex the Azure Function is. Also, it will incur more charges. Please consider that if it is necessary to do it for all players, even for the players that are not active. Can it be done only when player login or only for the active players?

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.

matthilson avatar image matthilson commented ·

Hi Gosen,

We're not too worried about the execution time, unless we hit a timeout threshold of a scheduled task? Just to make it clear, for each user in the ‘AllPlayers’ segement this Azure Function will get called and inside that function we’ll be querying the following PlayFab APIs: GetUserData, GetTitleData, UpdateStatistic and SendEmail. So it'll only be running on one user at a time.

On average this will happen twice a day.

Does that all sound OK from your point of view?

Thanks,

Matt

0 Likes 0 ·
Gosen Gao avatar image Gosen Gao matthilson commented ·

The workflow sounds all right. As for “Could we create 50,000 users with some dummy data to iterate over?”, title in Development Mode can create up to 100k users per title. So it should be fine to create 50k fake users to do some test.

0 Likes 0 ·
matthilson avatar image
matthilson answered

Hi Gosen,

We're now looking to optimise our function app execution times, we're seeing about 200 users being processed per minute using an QueueTrigger, is there any way we can run this concurrently? We are currently running a scheduled task on the 'All Players' segment and running an azure function on each player.

1 comment
10 |1200

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

Gosen Gao avatar image Gosen Gao commented ·

The processing speed of the queue triggered function is determined by your function config. Please refer to Azure Queue storage trigger and bindings for Azure Functions overview | Microsoft Learn for more info. And if you have further questions about setting Azure Function, you may contact Azure Function support.

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.