Python FastCGI进程超过配置的请求超时-Azure应用程序服务
我正在Azure上的python/flask网站上工作,该网站连接到ms sql数据库。某些请求会产生以下错误: D:\home\python361x64\python.exe-FastCGI进程超出了配置的请求超时 我假设这是一个超时问题,但我找不到在Azure上配置请求超时的方法。有人有什么建议吗?非常感谢:-) 问候Python FastCGI进程超过配置的请求超时-Azure应用程序服务,python,azure,flask,azure-web-app-service,fastcgi,Python,Azure,Flask,Azure Web App Service,Fastcgi,我正在Azure上的python/flask网站上工作,该网站连接到ms sql数据库。某些请求会产生以下错误: D:\home\python361x64\python.exe-FastCGI进程超出了配置的请求超时 我假设这是一个超时问题,但我找不到在Azure上配置请求超时的方法。有人有什么建议吗?非常感谢:-) 问候 Christian似乎是关于fastcgi活动超时设置,而不是语法错误,因为同一代码有时有效,有时无效 您可以尝试将applicationHost.xdt文件上载到路径:D:
Christian似乎是关于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>
当然,您可以关注根,优化数据库查询方案
希望对您有所帮助。似乎是关于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>
当然,您可以关注根,优化数据库查询方案
希望它能帮助您。上面的脚本不再有效。在azure中使用此扩展(它会自动生成)
如果不能,则此脚本:
<?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>
将此文件放在站点文件夹中
之后,从门户重新启动应用程序(必要)上述脚本不再工作。在azure中使用此扩展(它会自动生成)
如果不能,则此脚本:
<?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>
将此文件放在站点文件夹中
然后从门户重新启动应用程序(必要)非常感谢。我无法解决activityTimeout设置的问题。我优化了所有数据库查询和数据库本身,以便不再出现超时。@chrigi是的,我认为优化数据库查询和设置activityTimeout都是解决超时问题的方法。我已经在回答中更新了。非常感谢。我无法解决activityTimeout设置的问题。我优化了所有数据库查询和数据库本身,以便不再出现超时。@chrigi是的,我认为优化数据库查询和设置activityTimeout都是解决超时问题的方法。我已经在回答中更新了。