You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

Azure托管Python应用FastCGI超时:如何修改web.config解决

报错信息

The FastCGI process exceeded configured activity timeout

详细错误内容:

D:\home\python364x64\python.exe - The FastCGI process exceeded configured activity timeout .

Error screen shot

解决FastCGI超时问题的web.config配置修改

针对Azure托管的Python应用,你需要调整web.config中的FastCGI相关超时参数,具体修改项如下:

1. 调整FastCGI进程活动超时

在<system.webServer>节点下的<fastCgi>配置段中,找到对应Python解释器(路径为D:\home\python364x64\python.exe)的条目,增加或修改activityTimeout和requestTimeout属性,设置更长的时长(单位为秒,示例设置为300秒即5分钟):

<system.webServer>
  <fastCgi>
    <application fullPath="D:\home\python364x64\python.exe" 
                 activityTimeout="300"
                 requestTimeout="300"
                 instanceMaxRequests="10000">
      <!-- 保留原有其他配置项 -->
    </application>
  </fastCgi>
</system.webServer>

2. 同步调整ASP.NET请求超时(如适用)

如果应用依赖ASP.NET请求处理逻辑,需在<system.web>节点下修改executionTimeout,确保其时长不小于FastCGI的超时设置:

<system.web>
  <httpRuntime executionTimeout="300" />
</system.web>

3. 配置Azure平台级请求超时

除了web.config,还需在Azure门户调整应用服务的平台设置:

  • 进入目标应用服务资源
  • 打开“配置”>“常规设置”标签页
  • 将“请求超时”设置为与web.config匹配的时长(如5分钟)

注意:超时时长需根据业务实际需求设置,避免过长导致服务器资源浪费。

内容的提问来源于stack exchange,提问作者Sai Kumar Nagunuri

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.08.02 00:31:13