As a Hoster, you definitely want to recycle on Memory & Time, potentially Request limits and CPU. You want to be pretty aggressive about these limits, but make sure you publish them to your clients.
Memory - 512 for an x86 box, maybe 768. For x64, you can set this much higher depending on the number of hosts per server. You just have to be careful and watch your app pool recycle events on memory issues.
Time - We typically recycle at 1 am in the morning, plus or minus (first site 1:01, second 1:11, third 1:21, just so you don't have all recycling at the same time)
Request limit - 35,000 was the default for IIS6, but this number is quite arbitrary, and very dependant on the site in question. For small usage sites, the nightly recycle will hit long before you get 35k requests.
CPU - 95%/1 minute limit/KillW3WP, but use this carefully. My understanding of this is that if the CPU hits 95%+ over the 1 minute limit for this worker process, the worker process gets killed and is unable to restart for the remainder of the limit when Action is set to KillW3WP. You might want to try NoAction initially and just watch your event logs carefully.
Recycle Event Logs - You want to make sure you are logging app pool recycles for each event threshhold that you set - i.e. if you limit based off of requests limits, make sure that Request Limit logging is enabled.
One thing to remember is that you should set retail="true"
in the <deployment>
element in your machine.config:
<system.web>
<!--
<deployment
retail = "false" [true|false]
/>
-->
<deployment retail="true" />
</system.web>
Not setting this will allow a site to turn debugging on, which allows unlimited timeouts in requests - not exactly ideal for a hoster...
Yes, setting the idle timeout value to zero will disable idle timeouts.
Oddly this isn't documented in the MS docs but my evidence for this arises from:
IIS Settings Schema
If you have a look at the IIS settings schema in:
C:\Windows\System32\inetsrv\config\schema\IIS_schema.xml
The schema definition for idleTimeout
under
<sectionSchema name="system.applicationHost/applicationPools">
it looks like:
<attribute name="idleTimeout"
type="timeSpan"
defaultValue="00:20:00"
validationType="timeSpanRange"
validationParameter="0,2592000,60"/>
If you look at the validationParameter
attribute we see a range of 0 to 2592000 seconds (the ,60
specifies the granularity of the setting, in this case the value must be divisable by 60 [one minute]).
If you see a starting permissible value of 0
then that usually indicates the setting can be disabled.
IIS7 Application Pool Idle Time-out Settings
Brad Kingsley is the founder and CEO of OrcsWeb who are a fairly well known, respected and trusted Microsoft hoster and Gold Partner.
Then there's also the empirical evidence of the fact that it "just works".
Best Answer
No.
This is from the Documentation for IIS6 and I am sure it applies for IIS7.
If your web service requests are long-running, you might consider increasing the shutdown timeout.