Reputation: 57159
Situation: ASP.NET live website that's occasionally too busy.
Adding full profiling to the code will be too heavy an impact on the performance. Using performance monitor, we've quickly find a saw-teeth figure in the "bytes in all heaps" counter, which pair with the GC counters. We consider certain pieces of code as being the culprit.
Is there a way or possibility to temporarily "inject" profiling, either for certain pages, libs, functions or whatever? Preferably as lightweight as possible, as any additional overhead might bring down this fragile system. I'm aware that .NET does not support method callback hooks (as is common with AOP).
Upvotes: 2
Views: 1083
Reputation: 18654
A few ideas:
In case it's helpful, you might also be interested in the performance tips from my book: Ultra-Fast ASP.NET.
Edit: you might also try using .NET Memory Profiler (free trial available) to attach to the running process. It's fairly invasive compared to counters, but if you need to capture a snapshot of the current state of memory to debug your problem, there may not be a better choice.
Upvotes: 2
Reputation: 5952
I recently posted a possible solution to a similar challenge:
Profiling a multi-tiered, distributed, web application (server side) shows a high level approach (profiling on the URL level) that is:
The idea is to use existing web logs and convert them into a "one-picture is worth a 1000 words" kind of chart.
This approach is not sufficient for use-cases requiring more fine-level detail, but it helped me personally, and may be worth exploring in your case.
Upvotes: 1
Reputation: 40659
Can you do this on ASP .NET? It's a good quick way to find out what's going on.
Upvotes: 0
Reputation: 101330
Yes, you can take a memory dump of the application as it's running and see what it's holding in memory. This should reinforce or deny your assumptions.
Upvotes: 1