简体   繁体   English

Azure功能和文档数据库

[英]Azure Function & Document DB

I'm curious how the scaling working on the Azure Functions with relation to outputting to Document DB. 我很好奇如何扩展Azure功能与输出到Document DB的关系。

Basically what happens when Document DB returns a 429 because I'm exceeded my allocated throughput? 基本上当Document DB返回429时会发生什么,因为我超过了我分配的吞吐量? 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. 我问,因为当我将Azure功能的最低级别与文档数据库的最低级别相结合并在20秒内调用该函数1000次时,我只看到700-800个实际文档插入到我的文档数据库集合中。 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. 当我再次使用相同的最低功能级别将Document DB扩展到最大值时,我在doc db集合中只收到了700-800个文档。 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. 然而,当我将函数扩展到最大值时,文档db在最大值时我得到所有1000.当我将doc db下降到min时我只得到了300. ....虽然它看起来好像我已经锁定了doc db帐户,它仍在重试插入,直到它成功。

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. 是的,它目前在429上重试,根据DocDB响应等待建议的时间。 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? 在你的第一个场景中,如果你等了足够长的时间来移除油门,那么最终会出现1000个?

I'd like to try replicating this -- are you sticking 1000 items in a queue before enabling your function? 我想尝试复制一下 - 在启用功能之前,您是否在队列中粘贴了1000个项目? 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 如果你很好奇,正在运行的特定重试代码在这里: https//github.com/Azure/azure-webjobs-sdk-extensions/blob/master/src/WebJobs.Extensions.DocumentDB/DocumentDBUtility.cs#L36

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM