{"id":623,"date":"2026-08-14T23:44:42","date_gmt":"2026-08-14T23:44:42","guid":{"rendered":"https:\/\/windows-vps.org\/blog\/?p=623"},"modified":"2026-08-14T23:44:42","modified_gmt":"2026-08-14T23:44:42","slug":"iis-application-pool-recycling-best-practices","status":"publish","type":"post","link":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/","title":{"rendered":"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">Every IIS application pool recycles itself on a schedule \u2014 by default every 1,740 minutes (29 hours) \u2014 but the default is rarely the right answer for your workload. Recycling is IIS&#8217;s way of releasing leaked memory, closing stale connections, and clearing corrupted state, and it happens far more often than most administrators realize. This article explains each recycling condition, how to configure them through IIS Manager and <code>appcmd<\/code>, and how to deploy application updates with zero dropped requests using overlapping recycling and <code>app_offline.htm<\/code>. These techniques apply to any Windows Server running IIS, including the <a href=\"https:\/\/windows-vps.org\/\">Windows VPS hosting<\/a> setups covered elsewhere on this site.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">What actually triggers a recycle<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">IIS recycles a worker process (w3wp.exe) when any of these conditions are met:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Time interval:<\/strong> the pool has run for the configured number of minutes (default 1,740).<\/li>\n<li><strong>Specific times:<\/strong> a fixed daily schedule, e.g. 03:00.<\/li>\n<li><strong>Virtual memory limit:<\/strong> the process exceeds a configured MB threshold \u2014 the classic fix for 32-bit worker processes that balloon over time.<\/li>\n<li><strong>Private memory limit:<\/strong> same idea, but only the process&#8217;s private bytes count.<\/li>\n<li><strong>Requests limit:<\/strong> the pool has served N requests (useful for long-running, request-heavy apps).<\/li>\n<li><strong>Configuration change:<\/strong> editing applicationHost.config or the pool&#8217;s settings triggers a recycle so changes take effect.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">Each condition can be combined. The default 29-hour interval is a compromise tuned for nothing in particular; most production teams set one primary condition and disable the rest so recycling behavior is predictable.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Configure recycling in IIS Manager<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">In IIS Manager, select <strong>Application Pools<\/strong> \u2192 your pool \u2192 <strong>Advanced Settings<\/strong>. Under <strong>Recycling<\/strong>, three settings matter:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Regular Time Interval (minutes):<\/strong> set to 0 to disable time-based recycling.<\/li>\n<li><strong>Specific Times:<\/strong> add e.g. 03:00 for a nightly recycle during low traffic.<\/li>\n<li><strong>Virtual Memory Limit (KB) \/ Private Memory Limit (KB):<\/strong> set to 0 to disable, or a sane ceiling such as 1,048,576 KB (1 GB) for a small app.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">From PowerShell, the equivalent using the WebAdministration module is:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>Import-Module WebAdministration\nSet-ItemProperty \"IIS:\\AppPools\\MyApp\" -Name recycling.periodicRestart.time -Value \"00:00:00\"\nSet-ItemProperty \"IIS:\\AppPools\\MyApp\" -Name recycling.periodicRestart.schedule -Value @(\"03:00:00\")\nSet-ItemProperty \"IIS:\\AppPools\\MyApp\" -Name recycling.periodicRestart.privateMemory -Value 1048576<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">Or with <code>appcmd<\/code>, which works on Server Core:<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>appcmd set apppool \"MyApp\" \/recycling.periodicRestart.time:00:00:00\nappcmd set apppool \"MyApp\" \/+recycling.periodicRestart.schedule.[value='03:00:00']\nappcmd set apppool \"MyApp\" \/recycling.periodicRestart.privateMemory:1048576<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\">Recycling conditions: a reference table<\/h2>\n\n\n\n<figure class=\"wp-block-table\"><table><thead><tr><th>Condition<\/th><th>Setting<\/th><th>Best for<\/th><th>Recommended value<\/th><\/tr><\/thead><tbody><tr><td>Time interval<\/td><td>Regular Time Interval<\/td><td>Legacy apps that leak slowly<\/td><td>1,440 (24 h) or 0 if using Specific Times<\/td><\/tr><tr><td>Fixed schedule<\/td><td>Specific Times<\/td><td>Predictable low-traffic windows<\/td><td>03:00 daily<\/td><\/tr><tr><td>Virtual memory<\/td><td>Virtual Memory Limit<\/td><td>32-bit pools with runaway memory<\/td><td>~1.5\u00d7 observed peak<\/td><\/tr><tr><td>Private memory<\/td><td>Private Memory Limit<\/td><td>Most managed .NET apps<\/td><td>~1.5\u00d7 observed peak, min 1 GB<\/td><\/tr><tr><td>Requests served<\/td><td>Request Limit<\/td><td>High-traffic stateless apps<\/td><td>Often left disabled<\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p class=\"wp-block-paragraph\">To find a pool&#8217;s observed peak memory, run <code>Get-Process w3wp -ErrorAction SilentlyContinue | Sort WorkingSet64 -Descending | Select -First 5<\/code> during peak hours for a few days, then set the limit to 1.5\u00d7 that value. A limit that is too tight causes constant recycling and cold-start latency; too loose, and you are back to the leak you were trying to contain.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Zero-downtime deployments with overlapping recycling<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">The default recycle kills the old worker process and starts a new one. Between those two moments, incoming requests either queue or fail \u2014 a visible blip for users. Two settings fix this:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Disallow Overlapping Rotation = False (default):<\/strong> the new worker process starts and warms up <em>before<\/em> the old one is terminated, so no request is ever left without a listener. Do not disable this unless you have a hard reason.<\/li>\n<li><strong>Recycle on Configuration Change = True:<\/strong> the pool recycles when applicationHost.config changes, so your <code>web.config<\/code> edits take effect without a manual recycle.<\/li>\n<\/ul>\n\n\n\n<p class=\"wp-block-paragraph\">For application code deployments (new DLLs, static assets), the cleanest pattern is:<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>Drop an empty <code>app_offline.htm<\/code> file into the site root. IIS immediately stops the app pool and serves the file for all requests.<\/li>\n<li>Copy your new files over the old ones.<\/li>\n<li>Delete <code>app_offline.htm<\/code>. IIS restarts the pool and serves the new version.<\/li>\n<\/ol>\n\n\n\n<p class=\"wp-block-paragraph\">This is the pattern behind most CI\/CD pipelines that deploy to IIS, and it guarantees users see a maintenance page at worst \u2014 never a 503 from a half-copied deployment. If you want the full CI\/CD picture, the build-agent article on this blog covers the server side of that pipeline.<\/p>\n\n\n\n<h2 class=\"wp-block-heading\">Warm-up: the hidden cost of every recycle<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Every recycle clears the JIT cache, the ASP.NET view state cache, and any in-memory caches your app built since startup. A .NET application can take 10\u201360 seconds to reach full speed again after a recycle, and during that window your users see slow page loads. Mitigations, in order of effort:<\/p>\n\n\n\n<ul class=\"wp-block-list\">\n<li><strong>Application Initialization module:<\/strong> configure a warm-up page so IIS sends a request to the app immediately after startup. With <code>appcmd set config \"MySite\" \/section:system.applicationHost\/applicationPools \/+[name='MyApp'].processModel.startupTimeLimit:120<\/code> and the module&#8217;s <code>doAppInitAfterRestart<\/code> setting, the pool pre-loads before serving traffic.<\/li>\n<li><strong>Schedule recycles for low traffic:<\/strong> a 03:00 recycle on a global audience site is far less painful than a noon one.<\/li>\n<li><strong>Watch the event log:<\/strong> recycle events (Event IDs 5074\u20135076 from WAS, plus 1000\/1002 from the .NET Runtime on crash) tell you whether recycles are happening on schedule or being forced by memory limits.<\/li>\n<\/ul>\n\n\n\n<h2 class=\"wp-block-heading\">What recycling will not fix<\/h2>\n\n\n\n<p class=\"wp-block-paragraph\">Recycling is a bandage, not a cure. If your pool hits its memory limit every hour, the underlying leak is in unmanaged code, a misconfigured cache, or a driver \u2014 recycling just hides the symptom while costing you warm-up time. Track the pool&#8217;s memory across a week; if the pattern is &#8220;climb, recycle, climb, recycle,&#8221; fix the leak instead of tuning the limit. Likewise, connection-pool exhaustion in SQL Server is not solved by recycling; the app pool restart actually makes it worse by tearing down healthy pooled connections.<\/p>\n\n\n\n<p class=\"wp-block-paragraph\">A deliberate recycling policy \u2014 one primary condition, a fixed schedule, overlapping rotation enabled, and a warm-up page \u2014 keeps IIS predictable and your deployments boring. That predictability is exactly what you want from the web server in front of your application. If you are setting up IIS on a fresh server, <a href=\"https:\/\/windows-vps.org\/\">our Windows VPS plans<\/a> come with Server 2022 or 2025 images where all of these settings are one console away.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Every IIS application pool recycles itself on a schedule \u2014 by default every 1,740 minutes (29 hours) \u2014 but the default is rarely the right answer for your workload. Recycling is IIS&#8217;s way of releasing leaked memory, closing stale connections, and clearing corrupted state, and it happens far more often than most administrators realize. This &#8230; <a title=\"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments\" class=\"read-more\" href=\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/\" aria-label=\"Read more about IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments\">Read more<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"iawp_total_views":5,"footnotes":""},"categories":[5],"tags":[],"class_list":["post-623","post","type-post","status-publish","format-standard","hentry","category-tutorials-guides"],"yoast_head":"<!-- This site is optimized with the Yoast SEO Premium plugin v26.1 (Yoast SEO v26.1) - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments - Windows VPS Blog<\/title>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments\" \/>\n<meta property=\"og:description\" content=\"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments\" \/>\n<meta property=\"og:url\" content=\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/\" \/>\n<meta property=\"og:site_name\" content=\"Windows VPS Blog\" \/>\n<meta property=\"article:published_time\" content=\"2026-08-14T23:44:42+00:00\" \/>\n<meta name=\"author\" content=\"windows-vps\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"windows-vps\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"5 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"WebPage\",\"@id\":\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/\",\"url\":\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/\",\"name\":\"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments - Windows VPS Blog\",\"isPartOf\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\"},\"datePublished\":\"2026-08-14T23:44:42+00:00\",\"author\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\"},\"breadcrumb\":{\"@id\":\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/windows-vps.org\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#website\",\"url\":\"https:\/\/windows-vps.org\/blog\/\",\"name\":\"Windows VPS Blog\",\"description\":\"\",\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/windows-vps.org\/blog\/?s={search_term_string}\"},\"query-input\":{\"@type\":\"PropertyValueSpecification\",\"valueRequired\":true,\"valueName\":\"search_term_string\"}}],\"inLanguage\":\"en-US\"},{\"@type\":\"Person\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58\",\"name\":\"windows-vps\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g\",\"caption\":\"windows-vps\"},\"sameAs\":[\"https:\/\/windows-vps.org\/blog\"],\"url\":\"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/\"}]}<\/script>\n<!-- \/ Yoast SEO Premium plugin. -->","yoast_head_json":{"title":"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments - Windows VPS Blog","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/","og_locale":"en_US","og_type":"article","og_title":"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments","og_description":"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments","og_url":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/","og_site_name":"Windows VPS Blog","article_published_time":"2026-08-14T23:44:42+00:00","author":"windows-vps","twitter_card":"summary_large_image","twitter_misc":{"Written by":"windows-vps","Est. reading time":"5 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"WebPage","@id":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/","url":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/","name":"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments - Windows VPS Blog","isPartOf":{"@id":"https:\/\/windows-vps.org\/blog\/#website"},"datePublished":"2026-08-14T23:44:42+00:00","author":{"@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58"},"breadcrumb":{"@id":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/windows-vps.org\/blog\/iis-application-pool-recycling-best-practices\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/windows-vps.org\/blog\/"},{"@type":"ListItem","position":2,"name":"IIS Application Pool Recycling: Configuration, Best Practices, and Zero-Downtime Deployments"}]},{"@type":"WebSite","@id":"https:\/\/windows-vps.org\/blog\/#website","url":"https:\/\/windows-vps.org\/blog\/","name":"Windows VPS Blog","description":"","potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/windows-vps.org\/blog\/?s={search_term_string}"},"query-input":{"@type":"PropertyValueSpecification","valueRequired":true,"valueName":"search_term_string"}}],"inLanguage":"en-US"},{"@type":"Person","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/44caceed916d0db318aa08d5623a7a58","name":"windows-vps","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/windows-vps.org\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/3f2573db5afcd1a6ab9abcc5d48fc8e42584bc87ab9d98cc156e5b2097766dd9?s=96&d=mm&r=g","caption":"windows-vps"},"sameAs":["https:\/\/windows-vps.org\/blog"],"url":"https:\/\/windows-vps.org\/blog\/author\/myxiechengxuan\/"}]}},"_links":{"self":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/623","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/comments?post=623"}],"version-history":[{"count":1,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/623\/revisions"}],"predecessor-version":[{"id":624,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/posts\/623\/revisions\/624"}],"wp:attachment":[{"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/media?parent=623"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/categories?post=623"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/windows-vps.org\/blog\/wp-json\/wp\/v2\/tags?post=623"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}