Monitor memory usage before enabling memory-based recycle triggers.
Use AlwaysRunning + preloadEnabled to avoid slow first requests.
Avoid InProc session state if you recycle frequently—prefer SQL or StateServer.
Use monitoring tools (e.g., Event Viewer, SCOM, App Insights) to detect failures early.
Usage
Parameters
Parameter
Type
Default
Description
-AuditOnly
Switch
N/A
Only audits settings. No changes made.
-FixAll
Switch
N/A
Fixes all App Pools using provided or default best practice values.
-FixAppPools
string[]
N/A
Names of specific App Pools to fix. Use with overrides.
-QueueLength
int
2000
Max number of queued requests before rejecting new ones.
-StartMode
string
"AlwaysRunning"
Pool startup mode (AlwaysRunning, OnDemand).
-IdleTimeout
int
0
Idle timeout in minutes (0 disables timeout).
-PingEnabled
bool
$false
Whether IIS pings the worker process.
-PrivateMemory
int (KB)
0
Private memory limit (0 = unlimited).
-RecycleTime
int (min)
0
Periodic recycle interval (0 = disable).
-HtmlOutput
string
N/A
Full file path to generate audit report in HTML format.
Audit Examples
Basic Audit to Console
Audit with HTML Output
Fix Examples
Fix All App Pools to Default Recommendations
Fix All Pools + Audit to HTML
Fix All Pools with Custom Parameters
Targeted App Pool Fixes
Fix Only Specific Pools (Default Values)
Fix Specific Pools with Custom Settings
Advanced Automation Example
Audit and Fix Targeted Pools, Export to HTML with Timestamp
What Is Audited and Fixed
Setting
Description
Why It Matters
QueueLength
Max queued requests
Prevents overload rejections
StartMode
App pool startup behavior
AlwaysRunning ensures availability
IdleTimeout
Auto shutdown delay
Disabling avoids mid-use shutdown
PingEnabled
Process health ping
Avoid false recycling triggers
PrivateMemory
Memory-based recycle
Unlimited reduces unnecessary resets
RecycleTime
Periodic recycle timer
Disabling prevents unexpected resets
HTML Report Includes
Table: Per-App Pool current vs. recommended values
Color indicators: ✅ OK, ⚠️ Needs Attention
Full recommendations section with rationale for each setting
Detailed Explanation of App Pool Settings
Queue Length
Definition: The maximum number of requests that IIS will queue for an application pool before rejecting new requests.
Default: 1000
Recommended: 2000 (or higher depending on expected concurrent traffic)
Why it matters:
Increasing the queue length helps prevent dropped requests during traffic spikes. A low queue length can cause 503 errors when the limit is reached, especially during WSUS scan storms or high-load conditions.
Start Mode
Definition: Determines whether the application pool should be started immediately when IIS starts (AlwaysRunning) or only when the first request arrives (OnDemand).
Default: OnDemand
Recommended: AlwaysRunning
Why it matters:
With AlwaysRunning, application pools are ready to serve requests immediately, reducing cold-start latency. This is especially important for APIs or services like WSUS, where performance and availability are critical.
Idle Timeout
Definition: The amount of idle time (in minutes) after which IIS shuts down the worker process to conserve resources.
Default: 20 minutes
Recommended: 0 (Disabled)
Why it matters:
Disabling idle timeout ensures that the worker process remains alive even during periods of inactivity. This is critical for services like WSUS where unpredictable scan patterns could otherwise trigger process shutdown and slow restarts.
Ping Enabled
Definition: Indicates whether IIS periodically pings the worker process to check if it is healthy.
Default: True
Recommended: False
Why it matters:
While pings can help detect unresponsive processes, they may falsely classify long-running WSUS scans or metadata loads as unresponsive, causing premature app pool recycling. Disabling pings avoids these false positives.
Private Memory Limit
Definition: The maximum amount of private (non-shared) memory the worker process can use before being recycled (in KB).
Default: 1,843,200 KB (~1.8 GB)
Recommended: 0 (Unlimited)
Why it matters:
WSUS and similar services can require large in-memory caches (10–24 GB+). Limiting private memory can trigger frequent recycling, disrupting service and cache rebuilds. Setting to 0 allows the app pool to grow as needed.
Recycle Time (Regular Time Interval)
Definition: The interval (in minutes) after which IIS automatically recycles the application pool, regardless of memory usage or activity.
Default: 1740 minutes (29 hours)
Recommended: 0 (Disabled)
Why it matters:
Automatic recycling can unexpectedly interrupt client operations or cause metadata reloads, especially during critical WSUS scans. Disabling it increases stability, provided memory and CPU are properly monitored.