question

tarek avatar image
tarek asked

Triggered Azure functions execution time limit exceeded error

Hi,

We have noted that our triggered Azure functions are keep exceeding the execution time limit.

Note that some of these functions are simple and just calling one playfab API.

What is the suggested solution for this?

Thanks,

Tarek

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

Seth Du avatar image Seth Du ♦ commented ·

May I know your title ID? I will look into it.

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

Title ID: C0DAE
I have done further investigation with my team regarding this issue:

  • We have noted that this time limit error happens only the first time this function is called during the day (cold start?).
  • These errors are not new to us, we knew about them before but ignored them because we have noted that although we get the time limit error the function would execute successfully, so there were no worries.
  • But though it rarely happens, we just recently noted that it sometimes does not execute successfully - that's why we decided to take action and submitted a question here in playfab community.

What about using the queue trigger type instead of HTTP type? would that solve it?

0 Likes 0 ·
Seth Du avatar image
Seth Du answered

I have checked your title but as far as I can see that there aren't many errors in your title related to Cloud Script execution.

>> What about using the queue trigger type instead of HTTP type? would that solve it?

Yes, it will. Queued functions have a longer runtime limit.

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.

tarek avatar image tarek commented ·

Then we will just convert the critical functions into queue triggers. Thanks SethDu

0 Likes 0 ·
Caner Kara avatar image
Caner Kara answered

Hi, very similar situation in here. Function terminated message appears for exceeding 1000 ms on PlayStream Monitor but Function has completed its job. It has two PlayFab API call. I have checked Azure logs, Function's duration appears to about 350 ms.

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.

cosmin avatar image cosmin commented ·

Try moving your azure server in US it reduced a lot the cases where the timeout happened.

0 Likes 0 ·
Caner Kara avatar image Caner Kara cosmin commented ·

First quick test results seem reasonable. Thanks.

0 Likes 0 ·
cosmin avatar image
cosmin answered

Try moving your azure server in US it reduced a lot the cases where the timeout happened.

10 |1200

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

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.