Use this when an IIS app crashes, recycles or lacks permissions.
Application Pools
An IIS application pool is a worker process (w3wp.exe) with its own identity, .NET CLR version and pipeline mode that runs one or more sites, isolating them so one crashing app does not take down others.
1. Get-IISAppPool — state.
2. Stopped → rapid-fail protection (WAS events 5002).
3. Identity and its permissions.
4. .NET CLR version and pipeline mode.
5. Recycling settings.
app pool → w3wp under identity → runs the app
Context & applicabilityCommon mistakes · platform/version boundaries
Operational reference
Fast context before you go deeper.
Get-IISAppPool | Select Name,State,ManagedRuntimeVersionVerification & Troubleshooting
Start with the observed symptom, prove the nearest boundary, and move outward only when the current state is understood.
Use the operational verification above to establish the expected state.
Capture the concrete output, symptom, packet, log or counter before changing anything.
Step 1 Commands Verify boundary
Get-IISAppPool | Select Name,State,ManagedRuntimeVersion
appcmd list apppool
Restart-WebAppPool -Name AppPool1
Step 2 Verification path Verify boundary
Import-Module IISAdministration
Get-IISAppPool | Select-Object Name, State, ManagedRuntimeVersion, ManagedPipelineMode, StartMode
# Identity, recycling and rapid-fail settings of one pool
$p = Get-IISAppPool -Name 'AppPool1'
$p.ProcessModel | Select-Object IdentityType, UserName, IdleTimeout
$p.Recycling.PeriodicRestart | Select-Object Time, Memory, PrivateMemory, Requests
$p.Failure | Select-Object RapidFailProtection, RapidFailProtectionMaxCrashes, RapidFailProtectionInterval
# Running worker processes and their pools
& "$env:windir\System32\inetsrv\appcmd.exe" list wp
# WAS events about pools (identity failures, rapid-fail, recycles)
Get-WinEvent -FilterHashtable @{LogName='System'; ProviderName='Microsoft-Windows-WAS'} -MaxEvents 20 | Select-Object TimeCreated, Id, Message
Step 3 Common mistakes Narrow the fault
- Several applications sharing one app pool.
Step 4 Where it fails Narrow the fault
Failure analysis for IIS → Application Pools follows the Windows chain of components: target identity/version → persistent configuration/source of truth → provider/service/control plane → runtime/effective state → user/workload-visible result → event/log evidence.
Evidence · 1 on this Topic
Expected observations and documentation recipes are reference material. Record actual output, device identity, scope and time before claiming a verified result.
- Each application pool runs its own w3wp.exe with its own identity.
- Recycling restarts the worker and drops in-memory sessions.
- The pool identity needs read access to the site files.
Get-Website— sites, state, bindingsGet-IISAppPool— application pools and stateGet-WebBinding— bindingsGet-ChildItem IIS:\SslBindings— certificate bindingsGet-Content C:\inetpub\logs\LogFiles\W3SVC<id>\*.log -Tail 20— request log
ReferenceWhat it is1 section · depth on demand
Direct Answer
An application pool is the worker process (w3wp.exe) and identity an application runs under. Give each application its own pool, use ApplicationPoolIdentity (or a gMSA for network access) and No Managed Code for ASP.NET Core/PHP. A pool that crashes 5 times in 5 minutes is stopped by rapid-fail protection and the site returns 503; default recycling is every 29 hours.
ReferenceWhy it matters1 section · depth on demand
Commands
Get-IISAppPool
Restart-WebAppPool -Name AppPool1
appcmd list wp
Run each application in its own pool with ApplicationPoolIdentity.
ReferenceImportant terms & boundaries1 section · depth on demand
In depth
An application pool is a group of applications served by the same worker process(es) (w3wp.exe) with the same identity, runtime settings and recycling rules. Pools isolate applications from each other: a crash, memory leak or permission in one pool does not affect another.
Key settings
| Setting | Default / options | Notes |
|---|---|---|
| Identity | ApplicationPoolIdentity (virtual account IIS AppPool\<pool>) | Grant file and database permissions to this identity; use a domain account or gMSA when the app needs network access as a specific user |
| .NET CLR version | v4.0 or No Managed Code | ASP.NET Core and PHP pools should use No Managed Code |
| Pipeline mode | Integrated (default) or Classic | Classic only for very old ASP.NET apps |
| Start mode | OnDemand (default) or AlwaysRunning | AlwaysRunning plus preload avoids slow first requests |
| Idle time-out | 20 minutes | Worker shuts down when idle; set to 0 for apps that must stay warm |
| Regular recycling | Every 29 hours (1,740 minutes) | Recycle at a fixed quiet time instead, or not at all for well-behaved apps |
| Memory/request limits | 0 (disabled) | Optional recycling triggers |
| Rapid-fail protection | On: 5 crashes in 5 minutes | Stops the pool — the site then returns 503 |
| Queue length | 1000 | Requests waiting in HTTP.sys for this pool |
| Maximum worker processes | 1 | >1 is a web garden; breaks in-memory session state |
Recycling
IIS starts a new worker process, lets the old one finish in-flight requests (overlapped recycle) and then stops it. In-memory state (sessions, caches) is lost. Recycling hides memory leaks; it does not fix them.
ReferenceConfiguration & state1 section · depth on demand
Lifecycle and ownership
- One pool per application (or per site) with its own identity.
- Identity changes require updating file ACLs, database logins and, for Kerberos, SPNs.
- Recycling schedule agreed with the application owner; log recycle events (
logEventOnRecycle). - After repeated crashes (rapid-fail) find the cause in Application/System event logs or crash dumps before simply restarting the pool.
Additional reference context Scope · expected state · examples · history · terminology Open only when you need the supporting context
Verification history & basis
When and against what this Topic was checked. Later text edits do not count as a new check.
Authoritative/upstream documentation reviewed for bounded claims in IIS → Application Pools. Documentation verification only; this is not observed lab or production Evidence.
Basis: https://learn.microsoft.com/en-us/iis/ · confidence 94%Terms & aliases
Hover a linked term for a quick definition; click it to open its glossary entry. Aliases are other names that find this Topic in search.
Deep reference
Healthy vs suspicious evidence
Output interpretation
| Observation | Meaning |
|---|---|
Pool Stopped after errors, site returns 503.0 | Rapid-fail protection tripped, or the identity cannot log on (expired password) — read WAS events |
| WAS event about identity / logon failure | Custom identity password changed or account locked |
appcmd list wp shows no process | OnDemand pool idle or never started — normal until the first request |
| Frequent recycles in the log | Memory/request limits or config changes trigger recycling |
| Slow first request after quiet periods | Idle time-out or recycle; use AlwaysRunning + preload |