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

FastCGI Maximum ActivityTimeout [Answered]RSS

10 replies

Last post May 18, 2012 02:00 PM by faca5

  • FastCGI Maximum ActivityTimeout

    Nov 24, 2008 01:14 PM|Gengar003|LINK

    Hello... on my IIS7 server, I have php implemented via fastCGI.

    [i](Windows Server 2008 build 6001, IIS7 version 7.0.6)[/i]

    Some of my scripts I need to run for extended periods of time, up to several hours.

    While PHP itself has no qualms about this, IIS7's FastCGI "ActivityTimeout" setting refuses to allow itself to be set to more than 3600 seconds (1 hour).

    This is inadequate. Using the management console, I cannot set the value to more than 3600, and when I edit the .xml file directly and restart the server, the .xml file is changed to contain 3600, instead of the value I chose.

    [b]What can I do to allow a php script to run for more than 3600 seconds (FastCGI's maximum ActivityTimeout)?[/b]

    A good deal of the script in question's time is spent sleep()ing - is it possible to have FastCGI not count that time toward the activity timeout? Or is there a way to send IIS7 some "activity" from a php script, and thus re-set the timer?

    Are there any updates or workarounds that will solve this for me?

    Thanks in advance

    PHP FastCGI IIS 7.0 activitytimeout time limit timeout maximum

  • Re: FastCGI Maximum ActivityTimeout

    Nov 25, 2008 08:22 PM|ksingla|LINK

    IIS schema enforces this limit and cannot be overridden. Are you fine blocking a fastcgi application instance to just one request for several hours? Is the script going to be requested only once by one user? If your scenario is valid, we can definitely change schema to allow higher values for activityTimeout for the next release.

    Fastcgi handler doesn't know about whats happening in the php script. It only monitors activity on the stdout, stderr stream and if the handler don't see any activity for an extended period, it assumes something wrong happened and kill the process.

    Thanks,
    Kanwal

  • Re: FastCGI Maximum ActivityTimeout

    Nov 26, 2008 04:01 AM|Gengar003|LINK

    I am fine blocking a fastCGI instance to just one request for several hours. The script in question will be requested by one user and won't ever have more than one, [i]possibly[/i] two hours-long instances running at once. The server running the scripts has enough memory and processing power to dedicate a couple fastcgi instances to a script for several hours. I would be immensely pleased if higher values (ideally, arbitrary values) were allowed in future releases.
  • Re: FastCGI Maximum ActivityTimeout

    Dec 11, 2008 02:02 PM|ksingla|LINK

    Hi,

    We have changed the allowed maximum to 30 days in win7.

    Thanks,
    Kanwal

  • Re: FastCGI Maximum ActivityTimeout

    Dec 13, 2008 11:00 AM|Gengar003|LINK

    I am pleased to hear it! However, is there any hope of a patch or update for Windows Server 2008 (x64)'s IIS7 that would allow for a greater timeout?
  • Re: FastCGI Maximum ActivityTimeout

    Jan 14, 2009 10:52 PM|safakkaya|LINK

    Hi, i'm waiting this patch too...

    I'm very happy with my php systems on IIS7 but i need to execute some phps from cronjobs (after now from task scheduler:) for several hours.

     Thanks!

  • Re: FastCGI Maximum ActivityTimeout

    Jan 15, 2009 04:09 AM|ksingla|LINK

    Hi,

    If you need an official fix, you need to contact microsft support. If you are administrator on the server, you can take ownership of schema file (system32\inetsrv\config\iis_schema.xml) and change the max allowed value yourself. Another way would be to write a native module which sets "ignoreInvalidRanges" metadata to true.

    Thanks,
    Kanwal

  • Re: FastCGI Maximum ActivityTimeout

    Jan 16, 2009 01:19 AM|Gengar003|LINK

    ksingla

    Another way would be to write a native module which sets "ignoreInvalidRanges" metadata to true.
    I would be very interested to hear more about this - can you point me to some literature or documentation about what "writing a native module" entails, and/or where I would find the "ignoreInvalidRanges" setting?
  • Re: FastCGI Maximum ActivityTimeout

    Jan 16, 2009 05:03 AM|safakkaya|LINK

    ksingla

    Hi,

    If you need an official fix, you need to contact microsft support. If you are administrator on the server, you can take ownership of schema file (system32\inetsrv\config\iis_schema.xml) and change the max allowed value yourself. Another way would be to write a native module which sets "ignoreInvalidRanges" metadata to true.

    Thanks,
    Kanwal

     Thanks Kanwal,

    I can setup my php script (fastcgi) to run about 3-4 hours now.

  • Re: FastCGI Maximum ActivityTimeout

    Jun 26, 2010 06:09 PM|Gengar003|LINK

    Apologies for posting in so old a thread, but many a time I myself stumble across forum threads with a question, a few suggestions, and then silence from the original poster...

     I'd like to say that taking ownership of the IIS_Schema.xml file in %windir%/System32/inetsrv/Config/Schema and manually changing the ActivityTimeout line allowed me to use the management console to set my ActivityTimeout to anything that I wanted.

     So if anyone else ever stumbles across this thread with a similar problem, that approach worked.
     

  • Re: FastCGI Maximum ActivityTimeout

    May 18, 2012 02:00 PM|faca5|LINK

    Hello.

    I can't found in IIS folder file "iis_scheme.xml". This file i get only in windows\winsxs\amd64_..., which is meybe not correct.  Search found more files in different subfolders.