Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

High CPU and Memory usage from .NET MVC app

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.
like image 483
Jason Avatar asked Nov 13 '22 22:11

Jason


1 Answers

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.

like image 187
NickD Avatar answered Nov 15 '22 12:11

NickD