Wall clock analysis from Visual Studio Diagnostics Hub - visual-studio

The Performance and Diagnostics Hub in Visual Studio is an amazing feature. I use it for diagnosing Memory and high cpu issues while writing code. However, so far I am not able to figure out how to use this tool for troubleshooting low-cpu hang scenarios (or wall-clock analysis). Let's say my application takes long time on waiting a response back from a network or file I/O. Is there anyway of determining this from the Diagnostics windows in Visual Studio during a debugging sessions? I was hoping this analysis could be part of CPU Analysis section in there.

Like this blog here:
https://blogs.msdn.microsoft.com/devops/2014/02/28/new-cpu-usage-tool-in-the-performance-and-diagnostics-hub-in-visual-studio-2013/
The CPU Usage tool measures the CPU’s resources in terms of how much time each core in the CPU spends executing your code, it seems that it didn't provide the feature to resolve/collect the low-cpu hang issue.
Maybe you could think about using other tool like the PerfView or the suggestion of magicandre1981.
https://blogs.msdn.microsoft.com/vancem/2012/11/26/wall-clock-time-analysis-using-perfview/

Related

Windows instrumentation profiling of native app tool

Looking for something ideally as good as Visual Studio 2017 Diagnostic Tools CPU usage (while debugging very invaluable as one can profile the app between 2 breakpoints -> and you get profiling results in that interval) but for instrumentation. So I'm interested in function timings, no CPU usage in order to detect IO or other types of waitings in the app.
Concurrency Visualizer, an extension for Visual Studio fits the bill. It can report concurrency delays, one can see synchronisation points with the interthread dependencies, even has IO reported. A very goot tool, equivalent with Xperf for VS. Does not use instrumentation though, but because it exposes this synchronisation points it is more effective than instrumentation in concurrent apps.

Best way to profile long-term CPU usage of Windows process

I have an application of my own that increases the CPU usage of a process on Windows (in this case: audiodg.exe, which handles audio in 'some' way). I want to measure the overall CPU performance of this process over a minute or so.
It is possible to attach Visual Studio to this process (run as administrator and just do Attach to Process...), so I can view the CPU and memory performance. However, this isn't very useful. The process in constantly around 1-2% of the total CPU, so the graph doesn't give any interesting visual information.
Moreover, I'm interested in an average over ~1 minute, which the Performance Profiler can't do (I think?).
What is the best way to get accurate average CPU performance data out of a Windows process? Are there any tools for this or API that can get me this data?
I think Visual Studio is not the best tool for that usage as it's very heavy on its own.
I would use Windows Performance Recorder where you can select what you want to record:
Then you start the logging, replicate the issue and then stop the recording.
After that, you can open the log in Windows Performance Analyzer and try to understand why the issue is occurring.
Alternatively, you could take the process memory dump with ProcDump.exe when the CPU spikes above certain thresholds and then from the dump try to investigate the problem.

Using Visual Studio 2015 diagnostic tool to examine memory usage

So VS2015 has a cool new Diagnostic tool which shows memory and CPU usage while debugging, which should be very useful. However I'm having some confusion while using it.
I'm writing a Windows 8.1 XAML app, started with a blank template, I just hit F5 and the Diagnostic tool showed memory usage of 25MB (Process memory), so far so good.
After I started playing around with the code a bit (just some setups, no business logic, no networking, no images yet), I ran the code again and this time the tool showed memory usage of 35MB, which scared me a bit. So I tried running the profiling tool and it showed only about 50KB in the managed heap.
To add to the confusion, when I checked with the Task manager, it showed that my process was taking up only 16MB]2
What can be an explanation to all this and what figure should I believe in?

visual studio 2013 concurrency visualizer tool. How to determine core load balancing

I am using the visual studio 2013 concurrency visualizer tool extension and i am trying to determine the workload of each processor with regards to tasks/threads. However, although there is a lot of data being produced, it seems slightly strange that there is no detailed data on core utilisation, only a CPU utilization graph which doesnt give me the info on a processes threads - just the main process. Yes, there is the threads tab which gives details on the threads but no info on core allocation... and the cores tab only provides info on context switching.
I have also tried the windows performance analyser to try and build up the data but that seems a dead end as well. Is there a way to get the data i need out these vs tools?
Have a look at the Concurrency Visualizer: http://msdn.microsoft.com/en-us/library/ee329530.aspx
It provides graphical views of CPU utilization, threads, and cores, which seems to be exactly what you are looking for.
It used to be part of the profiler in VS, but for VS2013 it's available as additional addin: http://blogs.msdn.com/b/visualstudioalm/archive/2013/07/02/concurrency-visualizer-now-on-the-gallery-for-vs2013.aspx

what is normal for a site to use in terms of cpu and memory

We have a few sites running MVC3 on a windows 2008 server. We're seeing that in average these sites are using over 300 mb in memory each one, and high CPU. Each site easily goes to 20-25% CPU when they get requests.
Is this normal?
I know my question is very general, but if we were to spend time on optimization, etc.. what should we aim for? what is considered normal in terms of memory and cpu usage for a typical database driven MVC3 website?
Also, I was told that we should "profile" the application to troubleshoot the high CPU usage? Is this done via Visual Studio, or through some other tools?
thanks for your help in advance,
G.S
Without knowing the details of your application and what it's doing, it's impossible to say what's normal and what isn't. If performance is a problem, you should optimize, if it isn't, you shouldn't :)
Profiling is a general term for measuring the performance of different aspects of your application. You can profile memory, cpu usage, garbage collections and thread use (among other things) using a profiler.
There are several profilers around such as Ants, .Net memory profiler and some excellent ones built into visual studio. They are available in the pro versions of VS2012 and up.

Resources