maximum thread execution time RRS feed

  • Question

  • User-892055527 posted


    I was wondering if it was possible on IIS6 to set the maximum execution time of a thread.

    Let's say the thread is running for long enough that the initial request has timed out.

    Can I configure IIS such that if a thread runs for >X minutes, to kill it and return it to the pool so I can minimize the diminishing resources on the system?

    I'm working on a new system with alot of .net code (many wcf services). Despite trying to do extensive testing, there are alot of new components, and I'd like to be able to constrain the impact of any given error on the rest of the system so that if some kind of loop or hang occurs it doesn't poison the thread pool by hanging onto resources, since the response cannot be made anyway.

    I'd rather kill the thread rather than the whole app pool because building up the cache is a moreless expensive process that I'd have to do again if the pool was recycled.

    Thanks for any input.


    Friday, April 25, 2014 6:16 PM


  • User-947460206 posted

    Hi todd.c,

    When it is necessary to conserve system resources by terminating unused worker processes, you can configure a worker process to gracefully close after a specified period of time. You can use this feature to better manage the resources when the processing load is heavy, when identified applications consistently fall into an idle state, or when new processing space is not available. You can also start additional worker processes to replace a worker process that is finished.

    So, please try to set the Idle time out, more information please refer to:

    • Marked as answer by Anonymous Tuesday, September 28, 2021 12:00 AM
    Monday, April 28, 2014 4:40 AM