Roadmap › IIS — Internet Information Services and Hosting .NET Applications › Module: IIS Architecture
Lessons in this course (9)
3. Application pools — identity, pipeline mode, recycling and isolation
Intermediate★ Must knowLesson 3 of 9
| Setting | Options / default | Notes |
|---|---|---|
| .NET CLR version | v4.0 / v2.0 / No Managed Code | ASP.NET Framework 4.x → v4.0; ASP.NET Core → No Managed Code |
| Managed pipeline mode | Integrated / Classic | Integrated = ASP.NET modules in the IIS pipeline (use this); Classic = legacy ISAPI style |
| Identity | ApplicationPoolIdentity / NetworkService / LocalSystem / custom account | ApplicationPoolIdentity = virtual account IIS AppPool\ShopPool — grant folder permissions to it |
| Enable 32-bit applications | False | True only for old 32-bit native dependencies |
| Start mode | OnDemand / AlwaysRunning | AlwaysRunning + Application Initialization removes the first-request delay |
| Idle timeout | 20 minutes | Set 0 for always-warm apps |
| Regular recycling | 1,740 minutes | Schedule at a quiet time or disable if not needed |
| Rapid-fail protection | 5 failures in 5 minutes | Pool stops → 503 Service Unavailable |
| Maximum worker processes | 1 | >1 = "web garden" (in-process session/cache not shared) |
powershell
Set-ItemProperty IIS:\AppPools\ShopPool -Name managedRuntimeVersion -Value "" # No Managed Code (ASP.NET Core)
Set-ItemProperty IIS:\AppPools\ShopPool -Name startMode -Value AlwaysRunning
Set-ItemProperty IIS:\AppPools\ShopPool -Name processModel.idleTimeout -Value "00:00:00"
icacls C:\sites\shop /grant "IIS AppPool\ShopPool:(OI)(CI)RX" # read & execute for the pool identity
icacls C:\sites\shop\logs /grant "IIS AppPool\ShopPool:(OI)(CI)M" # modify for log folder
Restart-WebAppPool -Name ShopPoolRecycling starts a new worker process and drains the old one (overlapped recycle) — in-memory state (InProc session, caches, static variables) is lost. That's why web farms and recycles need out-of-process session (SQL/Redis).
Database access with ApplicationPoolIdentity: with Windows authentication to SQL Server on the same machine, create a login for IIS AppPool\ShopPool; for a remote SQL Server, the machine account (DOMAIN\WEBSERVER$) is used — or run the pool as a domain service account / use SQL authentication.