Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to profile network utilization of a .NET application

I have a .NET windows service that does a lot of network magic (WMI, Ping, etc - the list is very long). I would like to profile, with as much ease and detail as possible, how much bandwidth the application uses in total as well each part in the code.

Are there any tools that can help me do that? Ants profiler for example will help me with memory profiling and processor utilization profiling. However it doesn't do much with network profiling. Is there anything like ANTs for network profiling? If not, then what are my options when it comes to getting this information?

Thanks

In Response to some answers: added for clarification

Whatever the tool, if it cannot directly link to the code (which I don't think is possible) it needs to be able to run unattended for days keeping track (logging to a file or database) of the network traffic used by a process. It must be able to directly specify the process (which wireshark cannot do). Microsoft Network Monitor can do that, however, it does so much more (so much parsing - frame by frame) that its not usable because of performance issues (after a few hours of running I already have a million frames to tally up. If i try to copy the stuff into excel or a database, the copy alone takes over 30 minutes).

Really, it would seem like such a simple thing to do, however, I’m having a surprisingly hard time finding a tool that would do what i want.

like image 528
Mark Avatar asked Oct 19 '09 14:10

Mark


2 Answers

You can make use of the utility Wireshark to capture all packets going out of the machine the service is running on. You can then filter those packets based on the content within it to limit to those packets that you care about. Using that information you can find the metrics you're looking for.

like image 177
Agent_9191 Avatar answered Oct 12 '22 22:10

Agent_9191


I quite like SocketSniff. It attaches to a single running process, and shows all socket related traffic. It doesn't have great decoding like WireShare does, but it removes a lot of the noise as well.

like image 29
brianegge Avatar answered Oct 12 '22 22:10

brianegge