tags:

views:

388

answers:

5

We are experiencing random intermittent slow-downs in our ASP.NET application. Most pages take between 100-500ms to render (depending on which modules are used on the page). Occasionally however - perhaps 1 in 100 requests, these figures are more like 5000-10000ms. This is not a database related issue - I have checked for slow queries, and is not related to the complexity of the page - e.g. a page which takes 100ms is just as likely to take 10000ms when it slows down. I don't think the app-pool is recycling either - would normally see this in task manager. Could it possibly be GC? Any ideas? The w3wp application usually uses a steady 800MB-1GB of memory at all times.

Thanks Marcus

+2  A: 

The best thing I can tell you to do is to attach a profiler (search this site for a good .NET profiler, I personally use ANTS) to identify bottlenecks. Without good profile data all of our suggestions here will simply be speculation.

Andrew Hare
A: 

Does the application use the Cache at all for maintaining a large piece of static data? Even if the app-pool is not recycling, it's possible that some large objects in cache are being expired and then the next hit that requires that Cache has to refill it.

Jay S
A: 

To determine if it is the Garbage Collector (GC) kicking in, I suggest capturing the perfmon counters for GEN 0, 1 and 2 collections and see if there is any correspondence with the slow down. It does sound like a GEN2 collection spike (it's essentially single threaded even on multi CPUs), but your comment about memory being stable would perhaps suggest not.

Mitch Wheat
A: 

According to Tess Ferrandez, (ASP.NET Escalation Engineer) you're at that magic point on a 32bit server where you are likely to start seeing Out of Memory Exceptions - it's possible that this is having an affect too.

She has a number of useful posts on this topic:

  1. TechEd Resources
  2. Debugging Memory
  3. Debugging Memory Leaks

As others have also said, profilers, and tracing will also help.

Zhaph - Ben Duguid
A: 

have you tried running your web application in in-proc session state mode, and see if there is any difference?

mangokun