Is there any .NET performance profiling tool out there that I can attach to a running Windows service and do basic stack call sampling? It would be great if the tool require no installation because I will need to get though a lot of red tapes though the client's IT department.
Thank you
Nature of the performance problem: This program that having performance issue runs as a windows service and it process income messages from 200+ mobile devices. Typically this program can handles at least 10 message per second. Unfortunately after a recent upgrade, this program for some reasons no longer able to process the messages fast enough usually around 7 AM. A message come in and it could sit in the program internal queue for more than 10 min before it can be processed. We also notice the program is using higher than normal CPU. Typically it should be 5% on the eight core machine, now it is 20-25%.
The program does a more than handling incoming messages, it also maintains the database and serve data to clients. It has five threads handles the incoming messages and any maintenance job runs on its on thread.
The current workaround is to restart the service when the slow down happens. After a restart, the program would run normal again (CPU under 5%). Until the next morning around 7 AM, it would happen agins. All the messages in the queue were di开发者_StackOverflowscarded after each restart. Usually 7 AM and 5 PM is the time when we receive a lot of messages, but the issue seems only happen during 7 AM.
Our team has tried to reproduce the program in house using simulated messages, and did code comparison to see if there any critical bottleneck.
Time has passed and there is another tool to list: CodeTrack. Usable without installation.
I don't know of any profilers you can use without installing them, so you may eventually have to come to some agreement with the client's IT department.
However, you may be able to get some insight by looking at .NET performance counters. Perhaps the service is doing excessive garbage collection for some reason.
If that doesn't yield any clues, you could use Process Explorer from SysInternals. It can be run without prior installation. The properties window has a Threads that will show you all the threads in the process as well as their running time, which could be helpful.
See if AVICode (recently acquired by Microsoft) meets your needs. That product is all about monitoring performance of applications in production environments. I haven't looked at that product in 10 years, but when I looked at it before, it emphasized the ability to get exception info and call stacks from apps running in production with minimal overhead. It was built on top of .NET profiling APIs, so I wouldn't be surprised if it offers capabilities for your CPU utilization scenario as well. I don't know the details of what is required to install/enable it on a server, so I'm not sure whether it will easily clear your IT department hurdles.
Also check out the performance counters for the .NET Framework, which can be enabled without touching your application or its configuration.
Thanks for all the suggestions.
I tried a number of profiling tools, but all of them require installation, and some costs money.
Tried using "Windows Debug Tools" + "Process Explorer" + "Process Monitor" to see if I can get a snapshot of the running thread's stack trace. Unfortunately can't get our own managed symbols file (pdb) to work. I can see all the calls to the kernel api, but none of my own code.
Fortunately our client has approved us to install a profiler. If you got Visual Studio Premium or Enterprise version, it comes with a stand alone profiler. I was able to get a profile report on the client machine and analysis the report using Visual Studio.
精彩评论