且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

Azure 函数文档数据库

更新时间:2023-02-14 09:11:41

是的,它目前在 429 重试,等待 DocDB 响应建议的时间量.目前没有绝对的超时,因此重试将继续,直到它们通过(我现在正在仔细检查这是否是预期的行为).

在您的第一个场景中,如果您等待足够长的时间来移除节流阀,最终是否会全部显示 1000 个?

我想尝试复制这一点——您是否在启用功能之前将 1000 个项目放入队列中?还是以其他方式称呼它?

如果您好奇的话,正在运行的特定重试代码在这里:https://github.com/Azure/azure-webjobs-sdk-extensions/blob/master/src/WebJobs.Extensions.DocumentDB/DocumentDBUtility.cs#L36p>

I'm curious how the scaling working on the Azure Functions with relation to outputting to Document DB.

Basically what happens when Document DB returns a 429 because I'm exceeded my allocated throughput? I ask because when I had the lowest level of Azure Functions combined with the lowest level of Document DB and proceeded to call the function 1000 times in 20 sec I was only seeing 700-800 actual documents inserted into my document db collection. When I scaled Document DB up to the max with the same lowest Function level again I only received 700-800 documents in my doc db collection. However when I scaled the Function up to the max with the document db at the max I get all 1000. When I drop doc db down to the min I only got 300ish....though it does seem like I've locked the doc db account up and that it's still retrying the insert until it can succeed.

So I'm just confused as to this is scaling and if I could get some insight so I could better tune various aspect of the function or app.

Yes, it does currently retry on 429, waiting the suggested amount of time as per the DocDB response. There's currently no absolute timeout so the retries will continue until they get through (I'm double-checking right now if this is the expected behavior).

In your first scenario, if you wait long enough for the throttle to be removed, do all 1000 eventually show up?

I'd like to try replicating this -- are you sticking 1000 items in a queue before enabling your function? Or calling it some other way?

The specific retry code that's running is here if you're curious: https://github.com/Azure/azure-webjobs-sdk-extensions/blob/master/src/WebJobs.Extensions.DocumentDB/DocumentDBUtility.cs#L36