如何增加Azure函数吞吐量并且是函数还是ApacheBench的问题? [英] How to increase Azure Functions throughput and is the function or ApacheBench the problem?

查看:54
本文介绍了如何增加Azure函数吞吐量并且是函数还是ApacheBench的问题?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个由HttpRequest触发的Azure功能应用程序。  功能应用程序读取请求,将其一份副本存入存储表以便妥善保管,并将另一份副本发送到队列,以便由
系统的另一个元素进一步处理。  我有一个运行ApacheBench测试的客户端报告每秒处理大约148个请求。 
这个处理率对我们的预期负载来说是不够的。 

I have an Azure function app triggered by an HttpRequest.  The function app reads the request, tosses one copy of it into a storage table for safekeeping and sends another copy to a queue for further processing by another element of the system.  I have a client running an ApacheBench test that reports approximately 148 requests per second processed.  That rate of processing will not be enough for our expected load. 

我对功能应用的理解是它应该产生尽可能多的实例来处理发送给它的负载。 
但是这个功能应用可能没有足够快地扩展,因为它只处理每秒148个请求。 
我需要它每秒处理至少200个请求。 

My understanding of function apps is that it should spawn as many instances as is needed to handle the load sent to it.  But this function app might not be scaling out quickly enough as it’s only handling that 148 requests per second.  I need it to handle at least 200 requests per second. 

尽管如此,我并非100%确定问题出在我的身边。  在分析我的功能应用程序的性能时,我发现了很多429个错误。 
我在网上找到的内容,尤其是
https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits
,表明这些错误可能是由于请求太多而导致的从单个IP发送。 
在给定的一天内,几个ApacheBench 10K和20K请求加载测试会导致429错误吗?

I’m not 100% sure the problem is on my end, though.  In analyzing the performance of my function app I found a LOT of 429 errors.  What I found online, particularly https://docs.microsoft.com/en-us/azure/azure-resource-manager/resource-manager-request-limits, suggests that these errors could be due to too many requests being sent from a single IP.  Would several ApacheBench 10K and 20K request load tests within a given day cause the 429 error?

但是,如果不是这样,如果问题出在我的身上功能应用程序,如何强制我的功能应用程序更快地生成更多实例?我认为这是每秒获得更多吞吐量的方法。 
但我仍然非常擅长使用功能应用程序,所以如果有不同的方式,我会非常欢迎您的意见。 

However, if that’s not it, if the problem is with my function app, how can I force my function app to spawn more instances more quickly? I assume this is the way to get more throughput per second.  But I’m still very new at working with function apps so if there is a different way, I would more than welcome your input. 

也许公开预览的高级应用服务计划会处理更多的吞吐量? 
我已经考虑过切换到那个并运行快速测试,但我不确定我是否能够切换回来?

Maybe the Premium app service plan that’s in public preview would handle more throughput?  I’ve thought about switching over to that and running a quick test but am unsure if I’d be able to switch back?

也许EventHub是某种东西我需要调查一下吗?  是否可以通过捕获更多请求并持续使用它们来增加我的表观吞吐量,直到功能应用程序可以接受并处理它们为止?

Maybe EventHub is something I need to investigate?  Is that something that might increase my apparent throughput by catching more requests and holding on to them until the function app could accept and process them?

提前感谢您的任何帮助可以给。

Thanks in advance for any assistance you can give.

推荐答案

每秒200个请求是非常容易管理的,我相信它可以通过遵循正确的做法和配置来处理比这更多的数字。

关注帖子  处理
Azure函数每秒100,000个事件
 

Azure功能产品团队
,讨论各种模式和配置以实现高吞吐量。 

Follow the post Processing 100,000 events per second on Azure Functions by Azure Function Product team which discuss about various patterns and configuration to achieve high throughput. 

值得注意的是,自原始实施以来,消费计划中的
HTTP触发功能的规模特征已经显着改善。请参阅以下文章:

It’s worth noting that the scale characteristics of HTTP triggered functions on the consumption plan have been improved significantly since the original implementation. See this post of this:

https://www.azurefromthetrenches.com/azure-functions-significant-improvements-in-http-trigger-scaling/

https://codez.deedx.cz/projects / high-throughput-azure-functions-on-http /

https://codez.deedx.cz/projects/high-throughput-azure-functions-on-http/


这篇关于如何增加Azure函数吞吐量并且是函数还是ApacheBench的问题?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆