Azure长响应时间瓶颈? [英] Azure Long Response Time bottleneck?

查看:121
本文介绍了Azure长响应时间瓶颈?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

一个如何诊断Azure中的性能(响应时间)瓶颈?

我在Azure上拥有一个.NET Core网站,该网站由一个Web应用程序服务和一个SQL数据库组成.

I've got a .NET Core website on Azure that consists of a web app service and one SQL database.

我已经设置了负载测试,并通过云将其部署到网站上.负载测试代理的配置属性为

I've set up load test and deployed it via the cloud to hit the website. Configuration properties for the load test agents are

  • 4个核心
  • 同时启动10个用户,每20秒增加10个,最多150个用户
  • 请求之间的思考时间为5秒

Web应用程序资源分配如下

Web app resource allocation is as follows

  • 2个实例
  • 4核,7GB RAM(S3标准)

此图显示了负载测试期间的硬件利用率(显示了2个测试,分别在1pm和1:30 pm左右)

This image shows the hardware utilization during the load test (2 tests shown, around 1pm and 1:30pm)

似乎合理,但我认为响应时间太慢,因为考虑到根本没有压力.例如,在10个用户处,我的响应时间开始于20毫秒,但是在150个用户处(在测试结束时),我看到了5秒的响应时间.

Seems reasonable, except my response times are, in my opinion, too slow, considering the hardware isn't stressed at all. For instance, at 10 users, my response time starts at 20ms, but at 150 users (at the end of the test), I'm seeing 5 second response times.

对于测试的最后一部分,我的每秒请求数约为50.

For the last portion of the test, My requests per second was at about 50.

在100DTU时,数据库性能似乎不是一个因素:

Database performance, at 100DTUs, doesn't seem to be a factor:

我还能做些什么来诊断响应时间慢?如果没有固定Web服务器硬件,甚至没有打喷嚏,我还可以使用哪些其他旋钮打开Azure?

What else can I do to diagnose slow response times? If the web server hardware isn't pegged, and the database isn't even sneezing, what other knobs can I turn on Azure?

推荐答案

响应时间长的瓶颈可能由多种原因引起,例如,带宽限制,源限制,不良的应用程序设计,紧密耦合组件的依赖性等.更多有关如何解决Web应用程序性能缓慢问题的信息,请参阅该文档.从文档中摘录了一些.

The long response time bottleneck can be caused by various reasons, for example, bandwidth restrictions, source limited, bad application design, dependency of tightly coupled component etc.More information about how to troubleshoot slow web app performance issues , please refer to the document. There are some snipped from the document.

为您的Web应用启用诊断日志记录.

WebApp提供了用于记录来自Web服务器和Web应用程序的信息的诊断功能. 我们可以启用详细错误日志记录",失败请求跟踪","Web服务器日志记录"以进行Web服务器诊断

Enable diagnostics logging for your web app.

WebApp provides diagnostic functionality for logging information from both the web server and the web application. We can enable Detailed Error Logging, Failed Request Tracing, Web Server Logging for web server diagnostic

使用Kudu调试控制台(https://.scm.azurewebsites.net/) Kudu为您的应用程序,日志流,诊断转储提供环境设置

Use Kudu Debug console (https://. scm.azurewebsites.net/) Kudu provides environment settings for your application, log stream, diagnostic dump

我们还可以使用Azure Application Insights监视应用程序的使用和性能,然后我们可以获得有关请求的更多详细信息,更多异常信息,响应时间等. 如果我们获得有关应用程序异常,请求失败,服务器日志和应用程序日志的更多详细信息,则对我们的诊断将更有帮助.

We also can use Azure Application Insights to monitor the usage and performance of our app, then we can get more detail info about request, more detail exception info, response time and so on. If we get more detail info about application exception, request failed, server logs and application log, it will be more helpful for us to diagnose.

也有一些有关如何诊断Web App以及如何使用应用程序见解的相关文章:

There are also some related articles about how to diagnostic Web App and how to use Application insights:

启用诊断日志记录适用于Azure App Service中的Web应用程序

监视Web应用程序中的性能

在您的网络中诊断异常具有应用洞察力的应用

在Application Insights中使用搜索

这篇关于Azure长响应时间瓶颈?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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