Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    text
    copied!<p>Yes, each application pool is <em>typically</em> a single process<sup>1</sup>, but can contain multiple threads. You can assign multiple sites to an application pool, and those sites will all run under the same process, however they will run under different "app domains", which are security contexts that separate the code of one site from another, even if they're running on the same app pool.</p> <p>Two users hitting the site at the same time can run on different threads, meaning they can run concurrently. That means any logging can have values interspersed. You might want to add a session value to your logging so you can sort based on session.</p> <p>App pool restarts (recycling) are normal, 20 restarts in a day does not seem unusual. They can happen multiple times per day, and IIS controls when app pools are restarted. It does this whenever it feels it needs to clean up the pool.<sup>2</sup> Your applications should be written in such a way as to recover gracefully from this (ie, do not keep anything in session that cannot be easily recreated if the app pool restarts).</p> <p>The app pool can also restart when an unhandled exception occurs in your app. In that case, you want to address the cause of this. Such exceptions are usually logged in the event log.</p> <hr> <p><sup>1 &ndash; While you <em>can</em> configure an application pool to have multiple worker processes (this is known as a <strong>Web Garden</strong>), this is not a typical (nor generally recommended) configuration in my experience.</sup></p> <p><sup>2 &ndash; Note that using IIS Manager you can configure an application to <a href="https://stackoverflow.com/a/27254320/1497596">log recycle events to the Windows Event Log</a>. You can also use IIS Manager to set the threshold for when several of the different types of recycle events occur.</sup></p>
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload