How to debug high CPU usage? - c#-3.0

What tools to use to find out what cause a high CPU usage in .net application?
WPF / C# 3.0 / .net 3.5

Apply a profiler to understand where the CPU is being used: what parts of your code are "hot". You can then review the design of those parts of the code.
Note, the high CPU usage could be completely reasonable.

First you need to find out where your application spends most of the CPU time - I suggest you run a performance profiler such as:
JetBrains DotTrace
ANTS Performance Profiler
And see where you spend most of the time.
If you want to profile specific bottlenecks you can try using Stopwatch. I've written the details at my blog.

Agreed, you need a profiler. Visual Studio 2010 Premium or Ultimate Edition has a built-in profiler. I haven't used it but it should be useful as an alternative to DotTrace or ANTS.
http://msdn.microsoft.com/en-us/library/z9z62c29.aspx

VS2013 already comes with a very good build-in profiler

Related

JRuby/TorqueBox for high performance / mission critical application

We are evaluating few options for developing a telecommunication related application platform (and migrating/consolidating some of the standalone apps into the new platform). One of our main concerns is the ability to handle high volume of requests during peak hours.
We feel the TorqueBox seems to an interesting solution worthy of consideration because:
Speed (Next to pure Java performance)
Faster development time over Java
Maintainability
Support for threads/concurrency even though it's Ruby
Faster/Easier front end development with Rails
...
RedHat supported and runs on JBoss (scalability, future development and ability to call Java if necessary)
Has anyone developed/deployed similar application(s) with JRuby/TorqueBox?
Any serious performance bottlenecks ahead? (or why we shouldn't use JRuby and should stick with Java?)
The answer is YES but be aware of memory leaks (gems, threadsafety issues, etc). You have to be familiar with tools like VisualVM, Eclipse MAT and/or NewRelic.
We're successfully using Torquebox on production for some clients on amazon EC2 handling 60k-80k visits per day (new c3 instances are great for Java).
Deployment is also an issue. We're unable to setup any kind of rolling restart because of memory consumption. So every time we deploy using Capistrano a full JBoss restart is needed (no big issue for us).
Bests,
Antonio
yes any mature Java web-server with JRuby is a valuable option. the details of handling high-loads on peak hours will really depend on what kind of app you'll be running, how much "hardware" can you afford to use but in general it's achievable but be aware there might still be some "gotchas" e.g. Ruby libraries (gems) that do not handle thread-safety well. you simply need to understand how to proceed than - which seems you do since you're want to use 'Celluloid.IO' :)

Free Tools and ways for profiling ASP.NET MVC Web Server performance?

We ran Jmeter on our application and found that our web server was running relatively slow. I have asked this before but I was hoping to find some free tools can I use to profile it and identify bottlnecks ?
Also do I need to look at memory profiling on the server? What are the best steps I can take towards optimizing the web server performance ? Basically I am trying to optimize the web server to the fullest so just wanted to know all the steps can be taken to do it.
So,if anyone can list all the steps or optimizations than can be done on web server when using asp.net mvc 2.0, IIS 7.0 and SQL Server 2005.Thanks for all your help.
Check out the MVC mini profiler. Written by the StackOverFlow people
http://code.google.com/p/mvc-mini-profiler/
These are great tools and have a 14 day free trial:
http://www.red-gate.com/products/dotnet-development/ants-memory-profiler/
http://www.red-gate.com/products/dotnet-development/ants-performance-profiler/
http://www.jetbrains.com/profiler/buy/index.jsp - Definitely not free, but pretty intuitive and very helpful.

Good code measuring tools?

Are there any good code measuring tools available?
I found code measure pretty useful and interesting, but I don't think I can pay $1K/year for just using the measuring tool.
I imagine there might be a tool that is/can
open source software
language independent
OS independent
measure the metrics from different categories : LOC, LOC without blank lines, Number of functions ...
For basic line-count metrics like the ones you describe, try cloc.
My 2c-worth: code metrics are generally worse than useless. The only value I've ever gotten out of them is to measure the efficiency of one language against another.
Sonar is a Java based server side application for code measurement. It is mostly targeting Java, but support for other languages is available via plugins.
With 82 code metrics supported NDepend is the code metrics Roll's Royce tooling for .NET developers.

Redgate profilers equivalent for .Net Sharepoint

I was wondering whether there are any recommended open source performance and memory profilers equivalent to Redgate? This is for .Net and SharePoint development.
Thanks.
Chris.
Eqatech has a free performance profiler, but it only works down to the method level.
NProf statistical profiler for .NET applications.
Commercial (not free): Memprofiler and Redgate's ANTS profiler are both excellent and worth purchasing. As is JetBrain's dotTrace.

Profiling WebMethods services?

What techniques are available to profile services running in WebMethods Integration Server?
That is, to obtain data which would indicate which parts would benefit most from optimisation.
Check the 'Service Profiler for webMethods Integration Server' from http://www.wrightia.com/serviceprofiler.html
Have you thought of trying webMUnit?
You could add time logging around certain method calls to get an idea of how long things are taking to execute. However, the time logging itself will add overhead too, so just keep that in mind.
Or possibly memory profilers such as YourKit Profiler, JProfiler, JProbe etc? Im not sure about these, as I've never used them myself, but they might help by letting you know what's taking up a lot of memory etc
Another tool which will do it is Green Hat tester which is a commercial tool used for testing webMethods. If you use the reporting capabilities of that when running tests you get profiling information generated..
António Abreu's linked tool is a more dedicated profiling tool however and would be the simplest solution.
If you want an "out of the box" solution you could turn on service auditing for the called services and do the legwork yourself, but that's a bit of manual effort.
You can find here a new monitoring tool for IS services: Rich Statistics
I was involved only in development phase so i dont know details but our system was tested with heavy load-testing and hardware was monitored during the process, it actually gave some feedback about bottlenecks. JMeter and sar were used.