title: Why does AppHostSvc ocassionally get stuck using up 100% CPU?
body: <p>I have a Windows Server 2008 R2 server running IIS 7.5 and serving web applications.</p>
  
  <p>I've noticed that a <code>svchost.exe</code> process is consuming a lot of CPU (an entire cpu core was at 100%). That specific process was hosting the <a href="http://technet.microsoft.com/en-us/library/dd364269%28v=ws.10%29.aspx" rel="nofollow">IIS Application Host Helper Service (AppHostSvc)</a>. Once the problem starts, it doesn't matter what the server is doing (it could be completely idle otherwise and the service will stake eat up CPU).</p>
  
  <p>If I kill the process the problem goes away - after the service is restarted automatically by IIS it uses a minimal amount of CPU.</p>
  
  <p>The AppHostSvc service is responsible for <a href="http://technet.microsoft.com/en-us/library/dd364276%28v=ws.10%29.aspx" rel="nofollow">IIS Host History Configuration</a> and automatically backs up the configuration (I believe every two minutes by default), I thought maybe the problem starts after an IIS configuration change. I tried to change some configuration settings and it had no effect (even after several minutes of waiting).</p>
  
  <p>Eventually I found what triggers it, but it seems like a bug. See my own answer below.</p>