« Previous Next »

Thread: FastCGI Maximum ActivityTimeout

Last post 01-16-2009 5:03 AM by safakkaya. 8 replies.

Average Rating Rate It (5)

RSS

Page 1 of 1 (9 items)

Sort Posts:

  • 11-24-2008, 1:14 PM

    • Gengar003
    • Not Ranked
    • Joined on 04-20-2008, 10:09 PM
    • Posts 6

    FastCGI Maximum ActivityTimeout

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

    (Windows Server 2008 build 6001, IIS7 version 7.0.6)

    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.

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

    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

  • 11-25-2008, 8:22 PM In reply to

    • ksingla
    • Top 10 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 862

    Re: FastCGI Maximum ActivityTimeout

    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

    Follow me on twitter at http://twitter.com/kjsingla
  • 11-26-2008, 4:01 AM In reply to

    • Gengar003
    • Not Ranked
    • Joined on 04-20-2008, 10:09 PM
    • Posts 6

    Re: FastCGI Maximum ActivityTimeout

    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, possibly 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.
  • 12-11-2008, 2:02 PM In reply to

    • ksingla
    • Top 10 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 862

    Re: FastCGI Maximum ActivityTimeout

    Hi,

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

    Thanks,
    Kanwal

    Follow me on twitter at http://twitter.com/kjsingla
  • 12-13-2008, 11:00 AM In reply to

    • Gengar003
    • Not Ranked
    • Joined on 04-20-2008, 10:09 PM
    • Posts 6

    Re: FastCGI Maximum ActivityTimeout

    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?
  • 01-14-2009, 10:52 PM In reply to

    • safakkaya
    • Not Ranked
    • Joined on 01-14-2009, 10:46 PM
    • Posts 2

    Re: FastCGI Maximum ActivityTimeout

    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!

  • 01-15-2009, 4:09 AM In reply to

    • ksingla
    • Top 10 Contributor
    • Joined on 06-14-2006, 3:02 AM
    • Redmond, WA
    • Posts 862

    Re: FastCGI Maximum ActivityTimeout

    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

    Follow me on twitter at http://twitter.com/kjsingla
  • 01-16-2009, 1:19 AM In reply to

    • Gengar003
    • Not Ranked
    • Joined on 04-20-2008, 10:09 PM
    • Posts 6

    Re: FastCGI Maximum ActivityTimeout

    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?
  • 01-16-2009, 5:03 AM In reply to

    • safakkaya
    • Not Ranked
    • Joined on 01-14-2009, 10:46 PM
    • Posts 2

    Re: FastCGI Maximum ActivityTimeout

    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.

Page 1 of 1 (9 items)
Microsoft Communities