Jmeter Load test of 50 users requesting Azure API Management endpoint - Error: ClientConnectionFailure: at transfer-response

Jmeter Load test of 50 users requesting Azure API Management endpoint - Error: ClientConnectionFailure: at transfer-response

我们有一个 Azure 应用程序,其中 Functions Apps(后端)与 Azure SQL 服务器通信并通过 API 管理服务作为前端(并且我们有应用程序网关 APIs 被调用)。 应用程序本身运行良好,但一旦我们对 50 到 100 个并发用户进行负载测试,我们就会看到一些请求带有 (ClientConnectionFailure: 在传输响应)。

[{"severityLevel":"Error","outerId":"0","message":"Client connection was unexpectedly closed.","type":"ClientConnectionFailure","id":"0","parsedStack":[{"method":"transfer-response","level":0,"line":0}]}]

我已经检查了 Application Insights 上的跟踪 table,但我没有看到任何故障,所以我不确定这是否是 JMeter 负载测试客户端造成的,即连接在响应到来之前就断开了来自负载下的服务器。

有人遇到过这样的问题并找到了解决方法吗?我们是 运行 高级服务计划,因此没有发现我们的服务或 SQL 电话存在重大问题。

感谢您的帮助。

谢谢,

如果错误仅在负载下可重现,我会假设在某个时刻您的函数或数据库响应时间超过了 JMeter 的超时。

默认情况下,JMeter 的 HTTP Request 采样器没有定义任何超时,这意味着 JMeter 将永远等待响应,但是 JDK 和操作系统级别可能存在超时,因此它可能在那里设置一些合理的值是个好主意。

超时设置位于“高级”选项卡下。如果您有多个 HTTP 请求采样器 - 考虑引入 HTTP Request Defaults so you could amend the setting at one place and the change will be propagated to all the HTTP Request samplers in the HTTP Requests Defaults scope.

如果这没有帮助 - 检查您的网络基础设施:路由器、网关、防火墙、负载平衡器等,因为它们中的每一个都可能有自己的超时设置。

关注 reporting this issue, and besides the fact that the comments and response are talking about the timeout in the backend, there was no evidence that the backend was performing poorly. I check the logs and as I mentioned in the original thread, the backend and the client apps had low response times (<1min) to cause the timeout. So I started to explore a different option, in this case, the number of requests performed at the same time to the APIM, and I would say if you perform a significant number of requests at the same time, some of them will start to queue, and depending on how long they will be queued, potentially the client will start to timeout. So as far as I remember, I throttled the scalability of the azure functions to do not scale massively. Or if you do not want to go in that direction, you can try the Premium Plan on Azure Functions