Search code examples
pythonazureflaskazure-web-app-servicefastcgi

FastCGI process exceeded configured request timeout - Azure App Service


im working on a python/flask website on Azure which connects to a ms sql db. Some requests produce the following error:

D:\home\python361x64\python.exe - The FastCGI process exceeded configured request timeout

I assume that this is a timeout problem but i cant find a way to configure the request time out on Azure. Does anybody have an advice? Thank you very much :-)

Regards Christian


Solution

  • It seems that it's about fastcgi activity timeout settings instead of syntax error because of the same code works sometimes and sometimes not.

    You could try to upload an applicationHost.xdt file to path: 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>
    

    More details ,please refer to this doc.

    Of course, you could focus on the root, optimize the database query scheme.

    Hope it helps you.