5

We are seeing a very high amount of CPU and memory usage from one of our .NET MVC apps and can't seem to track down what the cause of it is. Our group does not have access to the web server itself but instead gets notified automatically when certain limits are hit (90+% of CPU or memory). Running locally we can't seem to find the problem. Some items we think might be the culprit

  • The app has a number of threads running in the background when users take certain actions
  • We are using memcached (on a different machine than the web server)
  • We are using web sockets

Other than that the app is pretty standard as far as web applications go. Couple of forms here, login/logout there, some admin capabilities to manage users and data; nothing super fancy.

I'm looking at two different solutions and wondering what would be best.

  1. Create a page inside the app itself (available only to app admins) that shows information about memory and CPU being used. Are there examples of this or is it even possible?
  2. Use some type of 3rd party profiling service or application that gets installed on the web servers and allows us to drive down to find what is causing the high CPU and memory usage in the app.
Jason
  • 17,276
  • 23
  • 73
  • 114

3 Answers3

2

i recommed the asp.net mvc miniprofiler. http://miniprofiler.com/

it is simple to implement and to extend, can run in production mode, can store its results to SQL Server. i used it many times to find difficult performance issues.

Another possibility is to use http://getglimpse.com/ in combination with the miniprofiler glimpse-plugin https://github.com/mcliment/miniprofiler-glimpse-plugin

both tools are open source and don't require admin access to the server.

NickD
  • 2,672
  • 7
  • 37
  • 58
  • Can you explain *why* you recommend this. – ChrisF Mar 25 '13 at 23:14
  • we use miniprofiler for perforamnce/code paths on production, it helped us identify what was slow and as a bonus what user actually used. Just override the IStorage and store the last 200 or so miniprofiles. Then created a simple web page that displayed them. worked great – Choco Smith Apr 10 '14 at 06:21
1

You can hook up Preemptive's Runtime Intelligence to it. - http://www.preemptive.com/

Otherwise a profiler, or load test could help find the problem. Do you have anything monitoring the actual machine health? (Processor usage, memory usage, disk queue lengths, etc..).

http://blogs.msdn.com/b/visualstudioalm/archive/2012/06/04/getting-started-with-load-testing-in-visual-studio-2012.aspx

Visual studio has a built-in profiler (depending on version and edition). You may be able to WMI query the web server that has the issues, or write/provide diagnostic recording/monitoring tools to hand them over to someone that does have access.

Do you have any output caching? what version of IIS? Is the 90% processor usage you are getting alerted to showing that your web process is actually the one doing it? ( Perhaps it's not your app if the alert is improperly configured)

Community
  • 1
  • 1
Maslow
  • 18,464
  • 20
  • 106
  • 193
  • you can also make an MVC page that calls the wmi diagnostics and displays them there if you can't remote query the wmi. – Maslow Dec 21 '12 at 13:11
  • as for an example of the wmi querying -http://aspalliance.com/806_CodeSnip_Get_memory_size_usage_using_WMI_and_NET_20 if you need help translating the VB just let me know – Maslow Dec 21 '12 at 13:14
-2

I had a similar situation and I created a system monitor to my app admins based on this project

  • 1
    Link only answers aren't good answers. It's a lot better if you include the answer here with any links being used as backup. – ChrisF Mar 25 '13 at 23:15