Sunday, April 24, 2005

Periodic Slowness in ASP.NET Apps

This one came up on the FlexWiki mailing list the other day. I should have known it, but I missed it, and it's worth spreading around.


A user complained that their FlexWiki install would periodically respond very slowly. The wiki was under very light load, so it didn't seem like a traffic problem. I was initially a bit confused, because the user reported that they hadn't changed the <processModel> element. Changing <processModel> to recycle the ASP.NET worker process periodically would have explained the problem, but the default is not to do that.


At that point, Michael Teper pointed out what I should have remembered: under IIS6, <processModel> is ignored in favor of the IIS6 metabase settings. If you go into the Internet Services Manager and pull up properties for an application pool, you'll see right there that by default, IIS will recycle the worker process every 29 hours (yes, 29), and after 20 minutes of inactivity. So on a lightly-loaded server, you're going to see a lot of recycling, and the consequent periodic delays. If you're supporting an internal web server that doesn't get hit that often, changing this value might be a good idea.

4 comments:

  1. Oh wow! I've had this problem before. Thanks!

    ReplyDelete
  2. Yeah, I figured at least one other person has run into this, and probably a lot more than one.



    Party on.

    ReplyDelete
  3. Thanks Craig. But, am I the only one that feels we are still in the reboot-for-optimization mindset?



    How difficult would a feedback mechanism be for this setting? I like that much more as a default then a hard-reboot every xx minutes.

    ReplyDelete
  4. I can actually sympathize with Microsoft on this one. Since they're writing a host process, they are in the unfortunate position of having the perceived stability of IIS depend on all the crappy, leaky, buggy apps that people run under it. So it is perhaps understandable that they set the default to this, assuming that any *real* system would be administered by someone that knows better.



    But maybe you're suggesting something better: what do you mean by "a feedback mechanism"?

    ReplyDelete