IISRESET:
When you run iisreset, this happens:
- Stops all IIS services:
- This includes the IIS Admin Service, the Windows Process Activation Service (WAS), and any related IIS processes.
- As a result, all websites, applications, and services hosted on the server are temporarily stopped.
- Restarts IIS services:
- IIS services are restarted, reloading configurations and initializing resources.
Core Components Affected by IISRESET:
- sys:
- While HTTP.sys is a kernel-mode driver and persists through most operations, during iisreset, it may temporarily stop listening for new connections.
- Worker Process (w3wp.exe):
- All worker processes are terminated, and any in-memory data, such as sessions and cache, is lost.
- IIS Admin Services:
- This service manages IIS configurations and stops briefly during iisreset.
Side Effects of IISRESET:
- Existing client connections are dropped, causing a hard downtime.
- During the restart, new browser requests are rejected until IIS is fully restarted.
- Application-level states, such as in-memory session data or cached objects, are lost.
- NET applications must recompile, causing an initial delay for users.
- Global downtime across all hosted sites and applications on the server.
When to Use IISRESET:
- After making configuration changes in IIS that require restarting core services.
- To recover from severe issues like a complete IIS failure, unresponsiveness, or a critical memory leak affecting multiple sites.
Recycling Application Pool:
When you recycle an application pool:
- Only the selected application pool is affected, not the entire IIS server.
- A new worker process (w3wp.exe) is started, and the old one is gracefully terminated.
- Connections are not dropped, as the recycling is seamless to users with proper configurations (e.g., overlapping recycling).
- Faster than a full iisreset since it does not involve restarting core IIS services.
Advantages of Recycling App Pools:
- No downtime for other websites or application pools hosted on the server.
- No connection loss for users if properly configured.
- Only affects the specific application pool, preserving overall system stability.
- Resolves issues like memory leaks or stale application states within a specific application without restarting all IIS services.
When to Use Recycling:
- To recover from application-specific memory leaks or unresponsiveness.
- After deploying application updates or making changes that don’t require a full IIS reset.
- To refresh the worker process while avoiding downtime for users.
Key Differences: IISRESET vs. Recycling Application Pool
Aspect | IISRESET | Recycle App Pool |
Scope | Entire IIS Server | Specific Application Pool |
Connection Loss | Yes, all connections are dropped | No, unless misconfigured |
Impact | Global downtime | Limited to specific application pool |
Speed | Slower | Faster |
Use Case | Severe issues or global configuration changes | App-specific issues or optimizations |
Which One Should You Choose?
- Choose IISRESET:
- When configuration changes require a complete restart of IIS services.
- To recover from severe issues affecting all applications or services.
- If IIS is entirely unresponsive or behaving unpredictably.
- Choose Recycling App Pool:
- For application-specific issues such as memory leaks or state corruption.
- To refresh a specific app without causing downtime for others.
- For routine maintenance or performance optimizations.
In most scenarios, application pool recycling is preferable due to its minimal impact and faster operation. Use iisreset sparingly, as it is more disruptive and affects all hosted applications.