question

Cyril Lesourd avatar image
Cyril Lesourd asked

Cloud script and azure functions take a lot of time

Hi there, we are currently trying the new way to call cloud script with azure function and we notice that the time execution of functions is really heavy :

We implement the quick start example that you provided (https://docs.microsoft.com/en-us/gaming/playfab/features/automation/cloudscript-af/quickstart).

The execution time for just extracting the message and answering a text is taking more than 300ms (data seen on Azure supervision) which results in a total execution time of more than 1s on our side (network time it can be ok).

We just would like to know if it is expected (the 300 ms of execution for your example I mean) or if there is something wrong here?

Thank you

CloudScript
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

As this thread - Azure Function via PlayFab round trip time ~500 ms... How to improve? - Playfab Community said, the total execution time of Azure Functions is inversely related to the physical distance between PlayFab core services and Azure Functions resources. And our core services are in the West US. So, if currently, your Azure Function resources are in other locations, you can consider moving the logic to West US to let it closer to the datacenter where PlayFab operates to speed up the response speed between the Azure Functions and PlayFab.

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.

Ozan Yilmaz avatar image Ozan Yilmaz commented ·

@Sarah Zhang

I was going to ask a new question about it, but since I saw this, I'll ask here. I don't fully understand the new system. I have one worry about latency. If I deploy Azure Functions in West US, does that affect the latency between the players and PlayFab? For example, for a player from Europe or Asia, do they experience any latency when an Azure Function is needed to be executed? On the other hand, does it mean the players from America will have less latency than the others?

0 Likes 0 ·
JayZuo avatar image JayZuo ♦ Ozan Yilmaz commented ·

As PlayFab's core services are in the West US, so players from America will have less latency than the others. And this latency is not related to Azure Function, but just the fact that PlayFab's core services are in the West US.

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.