.NET Production Code Profiling Tool

Is there any .NET performance profiling tool that I can connect to a running Windows service and fetch the base stack? It would be great if the tool did not require installation, because I would need to get a lot of red ribbons, although the IT department of the client.

thanks


Nature of the performance problem: This program, which has performance problems, runs as a Windows service and processes revenue messages from over 200 mobile devices. Typically, this program can process at least 10 messages per second. Unfortunately, after a recent update, this program for some reason can no longer process messages fast enough, usually around 7 a.m. A message arrives and he can sit in the internal queue of the program for more than 10 minutes before it can be processed. We also notice that the program uses a higher than usual CPU. As a rule, it should be 5% on an octa-core computer, now it is 20-25%.

The program performs more than processing incoming messages, and also maintains a database and serves data for clients. It has five threads that process incoming messages, and any service job is executed in the thread.

The current workaround is to restart the service when a slowdown occurs. After rebooting, the program will start working normally again (CPU up to 5%). Until next morning at around 7am, this will happen. All messages in the queue were discarded after each restart. Usually 7 AM and 5 PM are the time when we get a lot of messages, but the problem only occurs within 7 hours.

Our team tried to reproduce the program in the house using simulated messages and compared the code to see if there was a critical bottleneck.

+4
source share
3 answers

Thanks for all the suggestions.

I tried several profiling tools, but they all require installation, and some of them cost money.

I tried using the Windows Debugging Tools "+" Process Explorer "+" Process Monitor "to see if I can get a snapshot of the current trace of the stream stack. Unfortunately, we can not make our managed character (pdb) file work. I see all the calls api kernels, but not one of my own codes.

Fortunately, our customer approved us for installing the profiler. If you received a version of Visual Studio Premium or Enterprise, it comes with a standalone profiler. I managed to get the profile report on the client machine and parse the report using Visual Studio.

0
source

I do not know of any profilers that you can use without installing them, so you may have to come to some agreement with the IT department of the client.

However, you can get some idea by looking at .NET performance counters. Perhaps the service for some reason is doing excessive garbage collection.

If this does not give any hints, you can use the Process Explorer from SysInternals. It can be started without pre-installation. In the properties window there are threads that will show you all the threads of the process, as well as their running time, which can be useful.

+2
source

See if AVICode (recently acquired by Microsoft) meets your needs. This product is designed to monitor application performance in production environments. I did not watch this product after 10 years, but when I watched it earlier, it emphasized the ability to receive information about exceptions and call stacks from applications running in production with minimal overhead. It was built on top of the .NET profiling APIs, so I wouldn't be surprised if it offers features for your processor usage scenario. I don’t know the details of what is required to install / enable on the server, so I’m not sure if it will easily remove the obstacles of the IT department.

Also check the performance counters for the .NET Framework that you can enable without touching the application or its configuration.

+1
source

Source: https://habr.com/ru/post/1347484/


All Articles