title: Isolating processes through Application Pools
body: <p>If I have a site which is (unintentionally) consuming vast amounts of CPU, but the memory consumed is within normal parameters, it adversely affects performance of all other sites in separate App Pools. These other sites are fighting to get a small fraction of CPU time, resulting in requests that normally take milliseconds to complete, end up taking > 10 secs.</p>
  
  <p>The ideal would be that each process (or App Pool) will have access to an equal share of the CPU should one App Pool become hot; enabling them to continue to serve requests in a timely manner.</p>
  
  <p>In theory, application pools help isolate sites which are consuming too many resources (CPU or Memory) from affecting other sites under different App Pools.</p>
  
  <p>Many sites state this, and here is an excerpt of one which indicates this to be true.</p>
  
  <blockquote>
    <p>Excerpt:
    <a href="http://www.windowsnetworking.com/articles-tutorials/netgeneral/Working-Application-Pools-Internet-Information-Server.html" rel="nofollow">http://www.windowsnetworking.com/articles-tutorials/netgeneral/Working-Application-Pools-Internet-Information-Server.html</a></p>
    
    <p><em>Conclusion</em></p>
    
    <p><em>"In this article (linked), I have explained that a problem with one Web
    site can effect other Web sites hosted by the server. However, you can
    prevent these problems by placing each hosted Web site into its own
    application pool."</em></p>
  </blockquote>
  
  <p>In reality this doesn't quite happen as suggested. I have spoken with Microsoft experts and they have also said that if the CPU is exhausted by a process, the other App Pools will not get a share - ie it prioritises the process that is consuming the CPU; but I can't quite come to believe that there is no solution or protection against this.</p>
  
  <p>The suggestions I have received is to initiate the 'CPU limit' option in the App Pool settings. This enables you to kill the process if it has exceeded the limit for a certain interval. Great, but other sites will still experience a degraded service for 5/10 minutes until this is detected and kicks in.</p>
  
  <p>My other problem with this is high CPU load could be caused from a legitimate task; I do not want the process to be reset in mid flow, and I do want to enable other App Pools to get a share of CPU time. Lowering the process priority to 'below normal' while these tasks complete enables other sites to become responsive; however this process will get limited or no share of the CPU if another App Pool with a higher priority starts to run hot.</p>
  
  <p>Is there any way of setting up IIS7 so that App Pools can have a share of the CPU when there is limited CPU resources available? Does IIS8 improve on this? Are there any alternative solutions to maintain performance / equally dish out resources to w3wp processes?</p>
  
  <p>P.S. I am looking for a way to improve server performance when events such as these occur; I don't actually have tons of hot processes running on my server every 5 minutes, but need to protect against the unexpected occasional occurrence.</p>