Previous Next

Thread: The FastCGI process exceeded configured activity timeout

Last post 07-31-2008 5:29 AM by canadaka. 6 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (7 items)

Sort Posts:

  • 07-26-2008, 1:41 AM

    • canadaka
    • Top 50 Contributor
    • Joined on 08-17-2006, 11:10 PM
    • Vancouver, Canada
    • Posts 63

    The FastCGI process exceeded configured activity timeout

    I was trying to do a phpbb3 conversion, but the script keeps timing out. I can't figure out how to increase the PHP timeout on IIS7.

    I tried adding the following code to the PHP script itself: ini_set('max_execution_time',6000);

    I tried increasing the FastCGI "RequestTimeout" to 6000 via the IIS7 tool provided with the admin pack. I also confirmed that this change was taking place in the applicationHost.config.

    <fastCgi>
    <application fullPath="C:\Program Files\PHP\php-cgi.exe" requestTimeout="6000" instanceMaxRequests="10000" />
    </fastCgi>

    I also increased the sites "Connection time-out" to 6000. yet the script keeps timing out in a reletively short period of time, maybe 30 seconds max. This is the error produced.

    HTTP Error 500.0 - Internal Server Error

    C:\Program Files\PHP\php-cgi.exe - The FastCGI process exceeded configured activity timeout

    Module FastCgiModule
    Notification ExecuteRequestHandler
    Handler PHP via FastCGI
    Error Code 0x80070102

  • 07-26-2008, 2:44 AM In reply to

    • ksingla
    • Top 10 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 561

    Re: The FastCGI process exceeded configured activity timeout

    Seems like you are running into activity timeout which defaults to 30 seconds and not request timeout. You can try increasing that.

    -Kanwal-

  • 07-26-2008, 3:03 AM In reply to

    • canadaka
    • Top 50 Contributor
    • Joined on 08-17-2006, 11:10 PM
    • Vancouver, Canada
    • Posts 63

    Re: The FastCGI process exceeded configured activity timeout

    where is that? general IIS, fastCGI setting or PHP setting?

    I did a search in applicationHost.config for the word "activity" and nothing was found, same with php.ini

    I remember in IIS6 in FCGIext.ini there was an "ActivityTimeout" variable, but I don't know what it would be in IIS7. 

  • 07-26-2008, 5:30 PM In reply to

    • ksingla
    • Top 10 Contributor
    • Joined on 06-13-2006, 11:02 PM
    • Redmond, WA
    • Posts 561

    Re: The FastCGI process exceeded configured activity timeout

    "activityTimeout" is a FastCGI module setting in IIS. If you use the FastCGI UI, you will see it there. Your fastCGI section in appHost config will look something like

    <fastCgi>
      <application fullPath="<path>" arguments="<args>" activityTimeout="<value"> ...<otherValues>.... />
    </fastCgi>

    -Kj

  • 07-30-2008, 10:22 PM In reply to

    • canadaka
    • Top 50 Contributor
    • Joined on 08-17-2006, 11:10 PM
    • Vancouver, Canada
    • Posts 63

    Re: The FastCGI process exceeded configured activity timeout

    thanks.

    But how can one set different activityTimeout's for different sites? Say i have one site that sends newsletters and the script takes minutes to run, so it will need a high activityTimeout. but i don't want this high value across my entire server, because thats bad right? Could waste resources on slow loading scripts.

  • 07-31-2008, 1:16 AM In reply to

    • ruslany
    • Top 25 Contributor
    • Joined on 07-01-2007, 3:38 PM
    • Redmond, WA
    • Posts 204

    Re: The FastCGI process exceeded configured activity timeout

    You can use the approach similar to the one described in this article http://learn.iis.net/page.aspx/208/#Per-site (look for the section "Per-site PHP process pools")

    The configuration will looks similar to this:

    <fastCgi>
      <application fullPath="C:\PHP\php-cgi.exe" arguments="-d my.website=site1" activityTimeout="<value1>"  />
      <application fullPath="C:\PHP\php-cgi.exe" arguments="-d my.website=site2" activityTimeout="<value2>" />
    </fastCgi>

    The for each web site define a handler mapping for PHP as below:

    Site1:

    <system.webServer>
        <handlers accessPolicy="Read, Script">
            <add name="PHP via FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe|-d my.website=site1" resourceType="Unspecified" requireAccess="Script" />
        </handlers>
    </system.webServer>

    Site 2:

    <system.webServer>
        <handlers accessPolicy="Read, Script">
            <add name="PHP via FastCGI" path="*.php" verb="*" modules="FastCgiModule" scriptProcessor="C:\PHP\php-cgi.exe|-d my.website=site2" resourceType="Unspecified" requireAccess="Script" />
        </handlers>
    </system.webServer>

    http://ruslany.net
  • 07-31-2008, 5:29 AM In reply to

    • canadaka
    • Top 50 Contributor
    • Joined on 08-17-2006, 11:10 PM
    • Vancouver, Canada
    • Posts 63

    Re: The FastCGI process exceeded configured activity timeout

    hmm ok thanks, i might do this.

    But I am thinking this might be a bit to maintain and I still can't do it per script with this. Might be a better option to set a relatively high value for the fastCGI timeout then set the php.ini timeout to a lower value. then use the ini_set('max_execution_time',VALUE); command when i need a specific script to have a long timeout.

    I am just wondering if there are any concerns with having a long timeout for the fastcgi value?

Page 1 of 1 (7 items)
Page view counter