We are excited to announce that the IIS.NET Forums are moving to the new Microsoft Q&A experience. Learn more >

Where is the FastCgiModule Time Out setting? [Answered]RSS

10 replies

Last post Jun 09, 2008 01:43 AM by anilr

  • Where is the FastCgiModule Time Out setting?

    Jan 26, 2008 12:40 AM|greekshowpony|LINK

    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
     

  • Re: Where is the FastCgiModule Time Out setting?

    Jan 27, 2008 11:11 PM|mvolo|LINK

    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

    Mike V.
    CTO at LeanSentry, Former IIS PM

    Expert guides:
    1. Restart IIS correctly
    2. Expert guide to IIS logs
    3. Tune IIS thread pool
  • Re: Where is the FastCgiModule Time Out setting?

    Mar 15, 2008 09:15 PM|tisakovich|LINK

     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!

  • Re: Where is the FastCgiModule Time Out setting?

    Mar 15, 2008 09:20 PM|tisakovich|LINK

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

     Thanks!!

    Tom
     

  • Re: Where is the FastCgiModule Time Out setting?

    Mar 16, 2008 09:05 PM|anilr|LINK

    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
    Software Design Engineer
    IIS Core Server
  • Re: Where is the FastCgiModule Time Out setting?

    Mar 17, 2008 03:07 AM|tisakovich|LINK

     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 

  • Re: Where is the FastCgiModule Time Out setting?

    Mar 17, 2008 10:26 AM|anilr|LINK

    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
    Software Design Engineer
    IIS Core Server
  • Re: Where is the FastCgiModule Time Out setting?

    Jun 04, 2008 10:35 AM|Glenn86|LINK

    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?
     

  • Re: Where is the FastCgiModule Time Out setting?

    Jun 04, 2008 12:53 PM|anilr|LINK

    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
    Software Design Engineer
    IIS Core Server
  • Re: Where is the FastCgiModule Time Out setting?

    Jun 08, 2008 10:10 AM|Glenn86|LINK

     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?

  • Re: Where is the FastCgiModule Time Out setting?

    Jun 09, 2008 01:43 AM|anilr|LINK

    What is the output of

    appcmd list config -section:system.webServer/fastCGI

     

    Anil Ruia
    Software Design Engineer
    IIS Core Server