簡體   English   中英

在 azure 上托管的 .net 框架 MVC web 應用程序上更新請求超時

[英]Updating request timeout on .net framework MVC web app hosted on azure

I have an MVC .NET Framework (4.5) web app hosted on azure which is using ARR to implement a reverse proxy to an external API.

似乎無論我嘗試什么,長時間運行的請求都會在 2 分鍾后返回 502 並顯示消息:

The specified CGI application encountered an error and the server terminated the process.

我在 web.config 中有這個設置

  <system.web>
    <httpRuntime maxRequestLength="2097151" executionTimeout="3600" />
    <compilation debug="false" targetFramework="4.5.2">
  </system.web>

並在 azure 上的站點根目錄中進行此轉換:

<?xml version="1.0"?>
<configuration  xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.applicationHost>
    <webLimits xdt:Transform="SetAttributes(connectionTimeout)" 
               connectionTimeout="00:05:00" />
  </system.applicationHost>
</configuration>

我已驗證 applicationHost.config 在服務器上設置了 webLimit connectionTimeout,並重新啟動了 webapp。 但是,2 分鍾后我仍然得到 502。 我也可以在 2 分鍾后直接命中端點而不會超時,但通過反向代理,它每次都會在 2 分鍾處停止。

我可能會錯過什么超時設置?

從 web.config 配置在 Azure 應用服務中不起作用:

<system.web>
    <httpRuntime maxRequestLength="2097151" executionTimeout="3600" />
    <compilation debug="false" targetFramework="4.5.2">
  </system.web>

As App 服務的默認超時時間為 240 秒。

在我看來,您應該對請求的子狀態代碼進行故障排除。 此請求中的狀態碼是 502,查找子狀態碼並對此進行進一步的故障排除。

查看問題,似乎應用程序需要時間來響應,您可以通過使用Diagnostic and solve problem刀片從 azure 門戶本身冒泡並排除實際原因。

在診斷和解決問題中,查找Availability and performance部分並檢查 5** 錯誤。

希望能幫助到你。

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM