FastCGI进程超出配置的请求超时 - Azure App Service

时间:2018-03-05 18:14:33

标签: python azure flask azure-web-sites fastcgi

我在Azure上连接到ms sql db的python / flask网站上工作。某些请求会产生以下错误:

D:\ home \ python361x64 \ python.exe - FastCGI进程超出配置的请求超时

我认为这是一个超时问题,但我找不到在Azure上配置请求超时的方法。有人有建议吗?非常感谢你: - )

此致 基督教

2 个答案:

答案 0 :(得分:1)

似乎这是关于fastcgi活动超时设置而不是语法错误,因为相同的代码有时会工作,有时也不会。

您可以尝试将applicationHost.xdt文件上传到路径:D:\home\site\applicationHost.xdt

<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.webServer>
    <fastCgi>
      <application xdt:Locator="Match(fullPath)" xdt:Transform="SetAttributes(activityTimeout)"
            fullPath="D:\home\python361x64\python.exe" activityTimeout="600"/>
    </fastCgi>
  </system.webServer>
</configuration>

更多详情,请参阅此doc

当然,您可以专注于根,优化数据库查询方案。

希望它对你有所帮助。

答案 1 :(得分:0)

上面的脚本不再起作用。在天蓝色使用此扩展名(它会自动生成)   https://github.com/shibayan/IISManager

如果您无法执行此脚本,则:

    <?xml version="1.0" encoding="utf-8"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
  <system.webServer>
    <fastCgi>
      <application fullPath="D:\Python27\python.exe" xdt:Locator="Match(fullPath)" activityTimeout="900" requestTimeout="601" instanceMaxRequests="10000" xdt:Transform="SetAttributes(activityTimeout,requestTimeout,instanceMaxRequests)" />
      <application fullPath="D:\Python34\python.exe" xdt:Locator="Match(fullPath)" maxInstances="4" activityTimeout="900" requestTimeout="601" instanceMaxRequests="10000" xdt:Transform="SetAttributes(maxInstances,activityTimeout,requestTimeout,instanceMaxRequests)" />
    </fastCgi>
  </system.webServer>
</configuration>

将此文件放置在站点文件夹中

之后,从门户重新启动应用程序(必要)

相关问题