Previous Next

Thread: Where is the FastCgiModule Time Out setting?

Last post 06-09-2008 1:43 AM by anilr. 10 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (11 items)

Sort Posts:

  • 01-26-2008, 12:40 AM

    Where is the FastCgiModule Time Out setting?

    Hi

    I need to run a long process php script that updates a database. I have set the php.ini file timout setting to a big number however FastCGI always keeps timing out on me after like 30 to 60 seconds.

    How do I prevent this? Where can I increase the FastCGI timout?

    I am running Windows Server 2008 RC1
     

  • 01-27-2008, 11:11 PM In reply to

    • mvolo
    • Top 10 Contributor
    • Joined on 09-17-2003, 1:48 PM
    • Philadelphia, PA
    • Posts 583
    • mvolo

    Re: Where is the FastCgiModule Time Out setting?

    Hi greekshowpony,

    You need to set two configuration settings in the <fastCgi> configuration section for your FastCGI application:

    1) activityTimeout - the timeout between activity detected from the php-cgi.exe process (sending response data).  If your script doesnt flush any data until its done, you need to increase it to be a little larger than the expected maximum runtime of your script.

    2) requestTimeout - the maximum script execution time. You need to increase it to be a little larger than the expected maximum runtime of your script

    You can set this with AppCmd as follows:

    appcmd set config /section:system.webServer/fastCGI /[fullPath='c:\php\php-cgi.exe'].activityTimeout:<SECONDS>

    appcmd set config /section:system.webServer/fastCGI /[fullPath='c:\php\php-cgi.exe'].requestTimeout:<SECONDS>

    Be sure to replace  'c:\php\php-cgi.exe' with the path to your php-cgi.exe.

    See http://www.iis.net/articles/view.aspx/IIS7/Hosting-Web-Applications/PHP/Using-FastCGI-to-host-PHP-applications-on-IIS7 for more information on configuring FastCGI application settings.

    Thanks,

    Mike Volodarsky

    Program Manager
    IIS Core Server
    Visit mvolo.com for more IIS 7.0 posts, tools, and info

    This posting is provided "AS IS" with no warranties, and confers no rights.
  • 03-15-2008, 9:15 PM In reply to

    • tisakovich
    • Not Ranked
    • Joined on 03-16-2008, 1:11 AM
    • Posts 3
    • tisakovich

    Re: Where is the FastCgiModule Time Out setting?

     Hi Mike,

     I am running to the same issue and adjusting C:\Windows\System32\inetsrv\fcgiext.ini as follows did not solve it:

    [Types]
    php=PHP

    [PHP]
    ExePath=c:\PHP5\php-cgi.exe
    InstanceMaxRequests=10000
    EnvironmentVars=PHP_FCGI_MAX_REQUESTS:10000
    RequestTimeout=1800
    ActivityTimeout=1800
    InstanceTimeout=1800
     

    The error I receive is:

    C:\PHP5\php-cgi.exe - The FastCGI process exceeded configured activity timeout

    It appears about 30 seconds after trying the operation I am performing.

    I've searched the Internet high and low...cannot find an answer to this yet that works. Can you kindly advise? 

     Thank you in advance for your assistance very much!

  • 03-15-2008, 9:20 PM In reply to

    • tisakovich
    • Not Ranked
    • Joined on 03-16-2008, 1:11 AM
    • Posts 3
    • tisakovich

    Re: Where is the FastCgiModule Time Out setting?

    By the way, I am running the official release of Windows Server 2008 32-bit edition.

     Thanks!!

    Tom
     

  • 03-16-2008, 9:05 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 989
    • anilr

    Re: Where is the FastCgiModule Time Out setting?

    The ini file is only used by the fastcgi for iis6 - fastcgi for iis7 uses IIS configuration - look at the system.webServer/fastCgi section (to find list of all properties, look in %windir%\system32\inetsrv\config\schema\iis_schema.xml)

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 03-17-2008, 3:07 AM In reply to

    • tisakovich
    • Not Ranked
    • Joined on 03-16-2008, 1:11 AM
    • Posts 3
    • tisakovich

    Re: Where is the FastCgiModule Time Out setting?

     Hi Anil,

    Thank you. I see the FastCGI configuration in the IIS_schema.xml file you mentioned:

     

      <sectionSchema name="system.webServer/fastCgi">
        <collection addElement="application">
          <attribute name="fullPath" type="string" expanded="true" required="true" isCombinedKey="true" validationType="nonEmptyString" />
          <attribute name="arguments" type="string" defaultValue="" isCombinedKey="true" />
          <attribute name="maxInstances" type="uint" defaultValue="4" validationType="integerRange" validationParameter="1,10000" />
          <attribute name="idleTimeout" type="uint" defaultValue="300" validationType="integerRange" validationParameter="10,604800" />
          <attribute name="activityTimeout" type="uint" defaultValue="30" validationType="integerRange" validationParameter="10,3600" />
          <attribute name="requestTimeout" type="uint" defaultValue="90" validationType="integerRange" validationParameter="10,604800" />
          <attribute name="instanceMaxRequests" type="uint" defaultValue="200" validationType="integerRange" validationParameter="1,10000000" />
          <attribute name="protocol" type="enum" defaultValue="NamedPipe">

     

    The problem is most certainly that activityTimeout default value of 30. But, how can I edit this? I tried editing the schema.xml file in NotePad, but it will not allow a save, nor file replacement, even with IIS7 off and the IIS7 admin service disabled. Looks like the IIS_schema.xml file is locked down pretty securely.

    Any ideas on how I can edit this file? Any specific instructions would be wonderful! :-)

    Thank you,

    Tom 

  • 03-17-2008, 10:26 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 989
    • anilr

    Re: Where is the FastCgiModule Time Out setting?

    That file just contains the schema for the configuration - the actual configuration lives in %windir%\system32\inetsrv\config\applicationhost.config or (for certain delegated settings) in web.config files in the content directory - you should probably read up a bit on the IIS7 configuration system.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 06-04-2008, 10:35 AM In reply to

    • Glenn86
    • Not Ranked
    • Joined on 06-04-2008, 2:32 PM
    • Posts 2
    • Glenn86

    Re: Where is the FastCgiModule Time Out setting?

    I have the same problem as the topicstarter. 

     I've tried to find the "activityTimeout" parameter %windir%\system32\inetsrv\config\applicationhost.config. Nothing found.

     I also search for the specific web.config file of the website. There is no web.config available in the content directory of the website.

     
    How to solve this problem?
     

  • 06-04-2008, 12:53 PM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 989
    • anilr

    Re: Where is the FastCgiModule Time Out setting?

    The list of all possible settings (and their default values) live in %windir%\system32\inetsrv\config\schema\iis_schema.xml - in most cases, if default value is desired, it is not explicitly mentioned in applicationhost.config to keep the file clean and concise - the safest way to change value would be to use appcmd/AHAdmin to change the value (like the example given above) rather than editing the config file directly and risking making an invalid change.

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
  • 06-08-2008, 10:10 AM In reply to

    • Glenn86
    • Not Ranked
    • Joined on 06-04-2008, 2:32 PM
    • Posts 2
    • Glenn86

    Re: Where is the FastCgiModule Time Out setting?

     Thanks. I've set the settings on the way you describe. I got this message:

    Applied configuration changes to section "system.webServer/fastCgi" for "MACHINE
    /WEBROOT/APPHOST" at configuration commit path "MACHINE/WEBROOT/APPHOST"
     

    I've set it to 1800 seconds. After above message and a restart of the World Wide Web Publishing Service I got still the same error after 40 seconds.

    What's going wrong?

  • 06-09-2008, 1:43 AM In reply to

    • anilr
    • Top 10 Contributor
    • Joined on 05-23-2006, 6:13 PM
    • Redmond, WA
    • Posts 989
    • anilr

    Re: Where is the FastCgiModule Time Out setting?

    What is the output of

    appcmd list config -section:system.webServer/fastCGI

     

    Anil Ruia
    Senior Software Design Engineer
    IIS Core Server
Page 1 of 1 (11 items)
Page view counter