Azure Functions on a Consumption 计划是否为等待 Thread.Sleep() 所花费的时间计费?
Is an Azure Function on a Consumption plan billed for time spent waiting for Thread.Sleep()?
我正在编写一个 Azure Durable Function 来处理各种批量操作。 Te 代码可以在一个文件中进行 1000 次操作,它正在分解这些操作以调用相同的 activity 函数 1000 次。
问题在于,这会淹没 activity 函数使用的 API,直到我们的 activity 函数收到 429 - 来自 [= 的请求过多21=]。我们正在考虑阅读提供的 Retry-After header 并让线程在那段时间休眠。
在这种情况下,我们想知道 Azure 是否会为我们等待的秒数收费。另外,这个时间是否计入 Azure 函数的超时时间?
首先,使用耐用功能计时器,而不是 Thread.Sleep()
。然后,以下内容适用:
If your function app uses the Consumption plan, you will still be
billed for any time and memory consumed by the abandoned activity
function. By default, functions running in the Consumption plan have a
timeout of five minutes. If this limit is exceeded, the Azure
Functions host is recycled to stop all execution and prevent a runaway
billing situation. The function timeout is configurable.
https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-timers
我正在编写一个 Azure Durable Function 来处理各种批量操作。 Te 代码可以在一个文件中进行 1000 次操作,它正在分解这些操作以调用相同的 activity 函数 1000 次。
问题在于,这会淹没 activity 函数使用的 API,直到我们的 activity 函数收到 429 - 来自 [= 的请求过多21=]。我们正在考虑阅读提供的 Retry-After header 并让线程在那段时间休眠。
在这种情况下,我们想知道 Azure 是否会为我们等待的秒数收费。另外,这个时间是否计入 Azure 函数的超时时间?
首先,使用耐用功能计时器,而不是 Thread.Sleep()
。然后,以下内容适用:
If your function app uses the Consumption plan, you will still be billed for any time and memory consumed by the abandoned activity function. By default, functions running in the Consumption plan have a timeout of five minutes. If this limit is exceeded, the Azure Functions host is recycled to stop all execution and prevent a runaway billing situation. The function timeout is configurable.
https://docs.microsoft.com/en-us/azure/azure-functions/durable/durable-functions-timers