IISRESET vs. Recycling Application Pool

IISRESET:

When you run iisreset, this happens:

  1. 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.
  2. Restarts IIS services:
    • IIS services are restarted, reloading configurations and initializing resources.

Core Components Affected by IISRESET:

  1. sys:
    • While HTTP.sys is a kernel-mode driver and persists through most operations, during iisreset, it may temporarily stop listening for new connections.
  2. Worker Process (w3wp.exe):
    • All worker processes are terminated, and any in-memory data, such as sessions and cache, is lost.
  3. IIS Admin Services:
    • This service manages IIS configurations and stops briefly during iisreset.

Side Effects of IISRESET:

  1. Existing client connections are dropped, causing a hard downtime.
  2. During the restart, new browser requests are rejected until IIS is fully restarted.
  3. Application-level states, such as in-memory session data or cached objects, are lost.
  4. NET applications must recompile, causing an initial delay for users.
  5. 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:

  1. Only the selected application pool is affected, not the entire IIS server.
  2. A new worker process (w3wp.exe) is started, and the old one is gracefully terminated.
  3. Connections are not dropped, as the recycling is seamless to users with proper configurations (e.g., overlapping recycling).
  4. Faster than a full iisreset since it does not involve restarting core IIS services.

Advantages of Recycling App Pools:

  1. No downtime for other websites or application pools hosted on the server.
  2. No connection loss for users if properly configured.
  3. Only affects the specific application pool, preserving overall system stability.
  4. 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.