The IIS App Pool That Drifted Into Business Hours
The problem
I got pulled into a production availability incident where users were reporting a brief but complete outage — everything was down for about 20 seconds in the middle of the working day. No deployments had happened, no patches, no config changes anyone could point to. The first instinct from the team was "must be a fluke." My instinct was to look at IIS recycle events, because 20 seconds of downtime with a clean recovery screams app pool restart to me.
Symptoms
- All web-facing services simultaneously unavailable for approximately 20 seconds
- Clean recovery — no errors after the window, no data corruption
- No deployment or infrastructure change logged around the time
- Incident repeated on multiple days, but not every day, and at different times
- Gradually the outage window had been creeping forward in the day — previous incidents were overnight or early morning
Diagnostic path
I pulled the Windows Application event log on the IIS host and filtered for EventID 1033 (app pool shutdown) and 1032 (app pool startup). The timestamps told the story immediately:
[15:31:36] ApiGateway shutdown
[15:31:36] ReportServer shutdown
[15:31:36] WebApp shutdown
[15:31:49] ApiGateway started
[15:31:58] WebApp started
Every app pool recycled at the same second. That's not a crash — that's a scheduled recycle. I then checked the IIS Advanced Settings for the app pools and found the culprit: Regular Time Interval set to 1740 minutes (29 hours).
Here's the math that makes this nasty. A 29-hour interval doesn't anchor to midnight — it anchors to whenever IIS last started, then fires every 1740 minutes from that point. Since 1740 minutes is 29 hours, the recycle time advances by approximately 5 hours per calendar day:
| Day | Recycle time (UTC) |
|---|---|
| Day 1 | 04:30 |
| Day 2 | 09:30 |
| Day 3 | 14:30 |
| Day 4 | 19:30 |
| Day 5 | 00:30 |
| Day 6 | 05:30 |
| Day 7 | 10:30 |
| Day 8 | 15:30 ← business hours |
So every 5–6 days, the recycle drifts back into peak usage time. Past incidents that were logged as "middle of the night brief hiccup" were the same root cause — just earlier in the drift cycle when nobody noticed.
I confirmed this by checking the IIS recycle history across previous weeks. The pattern was there perfectly. The setting had likely been misconfigured during initial server setup — someone typed 1740 instead of 1440 (24 hours), or just left the default non-zero interval in place.
To check the current interval via PowerShell:
Get-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' `
-filter "system.applicationHost/applicationPools/add[@name='YourAppPool']/recycling/periodicRestart" `
-name "time"
Any non-zero value here means interval-based recycling is active and subject to drift.
The fix
Two changes: disable the Regular Time Interval entirely, and add an explicit Specific Times entry set to 02:00 AM. Specific Times don't drift — IIS fires them at that wall-clock time every day, regardless of when the service last restarted.
In IIS Manager: Application Pools → Advanced Settings → Recycling:
- Set Regular Time Interval to 0
- Add 02:00:00 under Specific Times
Or via PowerShell for all affected pools at once:
$appPool = "YourAppPoolName"
# Disable interval recycling
Set-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' `
-filter "system.applicationHost/applicationPools/add[@name='$appPool']/recycling/periodicRestart" `
-name "time" -value "00:00:00"
# Add 2am specific recycle
Add-WebConfigurationProperty -pspath 'MACHINE/WEBROOT/APPHOST' `
-filter "system.applicationHost/applicationPools/add[@name='$appPool']/recycling/periodicRestart/schedule" `
-name "." -value @{value="02:00:00"}
Applied across all app pools on the server. Monitored for two weeks — no further mid-day outages.
Lesson
Interval-based IIS recycling is a trap. It looks harmless in the config, but "1740 minutes" sitting in that field is a time bomb that detonates on a rotating schedule. The correct approach is always Specific Times anchored to a low-traffic window. When inheriting a server setup, the IIS recycle config is now on my standard checklist — it's the kind of misconfiguration that was set once years ago and nobody ever questioned it because the outages were rare and brief enough to dismiss as noise. If you have recurring 20-second "mystery" outages that happen at different times of day and gradually shift forward, check this first.