简体   繁体   English

Azure Webapp 请求在 4 分钟后返回 502

[英]Azure Webapp Request returning 502 after 4 min

I know this has been asked before, but I tried all known solutions and still no luck.我知道以前有人问过这个问题,但我尝试了所有已知的解决方案,但仍然没有运气。 I have a request that returns roughly 26MB of JSON.我有一个返回大约 26MB JSON 的请求。 It is returning a 502 on my azure web app.它在我的 azure web 应用程序上返回 502。 I have set maxRequestLength and maxAllowedContentLength to their max allowed values as detailed here.我已将 maxRequestLength 和 maxAllowedContentLength 设置为它们的最大允许值,详见此处。

How to set the maxAllowedContentLength to 500MB while running on IIS7? 在 IIS7 上运行时如何将 maxAllowedContentLength 设置为 500MB?

I have also set the applicationHost.xdt on the site folder of my webapp and verified it is applied as detailed here.我还在我的 web 应用程序的站点文件夹上设置了 applicationHost.xdt 并验证它是否按照此处的详细说明应用。

ApplicationHost.xdt in Azure Web Apps Azure Web 应用中的 ApplicationHost.xdt

None the less, my request timeout at exactly 4 minutes every time.尽管如此,我的请求每次都在 4 分钟内超时。 I can run the same request against my localhost running on iisexpress pointed to the Azure SQL database and it returns the data, so I know this is something azure webapp speciic.我可以对运行在 iisexpress 上的本地主机运行相同的请求,指向 Azure SQL 数据库并返回数据,所以我知道这是 azure webapp 特有的东西。

I have enabled all types of logging in "App Service Logs" section of my webapp.我在我的 web 应用程序的“应用服务日志”部分启用了所有类型的日志记录。 I see other failed request traces for 401 when session expires, but this request doesn't log a failed request trace, or an application error.当会话过期时,我看到 401 的其他失败请求跟踪,但此请求没有记录失败的请求跟踪或应用程序错误。 In live log stream it shows the request as a 200 response in the web server logs.在实时日志流中,它将请求显示为 Web 服务器日志中的 200 响应。

Any other ideas?还有其他想法吗?

Thanks for a detailed question and sharing the solutions that you have already tried.感谢您提出详细问题并分享您已经尝试过的解决方案。 I'm unsure if " Always ON " feature is turned on on your WebApp.我不确定您的 WebApp 是否开启了“始终开启”功能。 Such time-out error may occur due this,so kindly enable it and let us know for further investigation.由于此原因可能会发生此类超时错误,因此请启用它并让我们知道以进行进一步调查。

Additional information, Azure Load Balancer has a default idle timeout setting of approximately four minutes (230 sec);附加信息,Azure 负载均衡器的默认空闲超时设置约为四分钟(230 秒); this is a general idle request timeout that will cause clients to get disconnected after 230 seconds.这是一个一般的空闲请求超时,将导致客户端在 230 秒后断开连接。 However, the command will still continue running server-side after that.但是,此后该命令仍将继续在服务器端运行。 For a typical scenario, this is generally a reasonable response time limit for a web request.对于典型场景,这通常是 Web 请求的合理响应时间限制。 In such scenarios, you could look at async methods to run additional reports.在这种情况下,您可以查看异步方法来运行其他报告。 WebJobs or Azure Functions is another option. WebJobs 或 Azure Functions 是另一种选择。

If 'Always On' config is not turned On, please do turn it on.如果“始终开启”配置未打开,请打开它。 The AlwaysOn would help keep the app loaded even when there's no traffic, it will send a request to the ROOT of your application.即使在没有流量的情况下,AlwaysOn 也有助于保持应用程序加载,它会向应用程序的根发送请求。 Whatever file is delivered when a request is made to / is the one which will be warmed up and this feature comes with the App Service Plan is not charged separately向/发出请求时传送的任何文件都是将被预热的文件,并且此功能随应用服务计划一起提供,不单独收费

1) From the Azure Portal, go to your WebApp. 1) 从 Azure 门户,转到您的 WebApp。

2) Select Settings> Configuration > General settings. 2) 选择设置> 配置> 常规设置。

3) For Always On, select On. 3) 对于始终开启,选择开启。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM