performance - 当服务器负载不大时,Azure API 时间缓慢/超时

标签 performance azure asp.net-web-api azure-web-app-service

我有一个运行 MVC Web API 的 Azure 应用服务。它连接到数据库和 Redis 缓存。对 API 的调用需要花费大量时间或超时。我已经剥离了几乎不做任何事情的方法。

    public HttpResponseMessage GetData()
    {
           Request.CreateResponse(HttpStatusCode.OK, "abc");
    }

我仍然遇到同样的问题。 Web 服务器没有任何压力,数据库也没有,都低于 30%。我不知道从哪里开始。

该方法调用次数较多,因此可能存在大量并发请求。我正在运行一个 S3 应用服务计划,这应该足够了。

非常欢迎有关如何排除故障的任何建议?我只能认为这取决于同时请求的数量。

最佳答案

据我所知,这个问题通常是由以下原因引起的:

requests taking a long time
application using high memory/CPU
application crashing due to an exception.

我建议您首先为您的网络应用程序启用诊断日志记录。 通过这种方式,您可以在您的Web应用程序中找到有关详细错误、失败请求跟踪、Web服务器日志记录的详细信息。 更多详情,您可以引用以下链接: Enable diagnostics logging for web apps in Azure App Service

您还可以使用 Azure 应用服务支持门户。 通过使用这种方式,您可以通过查看 HTTP 日志、事件日志、进程转储等来解决与 Web 应用程序相关的问题。

您可以使用我们的支持门户 http://.scm.azurewebsites.net/Support 访问所有这些信息

更多详情,您可以引用以下链接: New Updates to Support Site Extension for Azure Websites

此外,您还可以引用这篇文章:Troubleshoot slow web app performance issues in Azure App Service

关于performance - 当服务器负载不大时,Azure API 时间缓慢/超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43211904/

相关文章:

arrays - C++ clang 数组比 clang 向量和 gcc 向量和数组快得多

html - CSS 链接性能

python - Azure 数据湖 - 使用 Python 读取

powershell - "Unexpected Error"使用 Connect-MsolService -AccessToken 连接到 Azure AD

azure - 更改 Azure Web 应用程序设置

c# - 如何将业务层映射到 UML 中的模型对象?

Java 集合比 C++ 容器更快?

asp.net-core - 如何在 .net6 中使用 WebApplicationFactory(没有口语入口点)

asp.net-mvc - 我应该如何实现 Nlog 记录器以减少复制/粘贴的单调乏味?

Android TListBox 滚动不流畅