Thread Performance

G

Guest

Hi all,

I'm having problem with high processor load on the system where I'm running
my application. The system is a P4 3.0 GHz with 1 GB RAM. I would like to log
the thread activity of my application using performance counters to try to
find out which thread that is causing the high processor load.

Any ideas how to do this?

How can I identify what part of my code a specific thrad is executing?

Thanks

Henrik
 
N

Nicholas Paldino [.NET/C# MVP]

Henrik,

Have you looked at the PerformanceCounter class in the
System.Diagnostics namespace? It should allow you to create a new
performance counter and set the values.

Hope this helps.
 
S

Steven Cheng[MSFT]

Hi Henrik,

If this is the first time your application(in production environment )
suffers high CPU utilization, you can consider throubleshoot the issue
through the following steps:

1. Use system taskmanager to inspect the exact process that consume most or
all of the cpu time.

2. Use performance counters to trace the process and thread statistics of
that problem process. You can find the following useful performance counter
categories in the perfmon:

* Process
*Processor
*Thread
*ASP.NET(if target application is a web application)
*ASP.NET Application(if target app is a web application)

3. All the above steps(#1 and #2) can only isolate the issue to
process/thread level. If you still want to get the problem cause at code
level, we need to use some live or production debugging tools (such as the
windows debugging tools---windbg). Generally, the microsoft product support
team mostly use this debugger to analysis such production environment
issues( application crash or hang).

Here are some good stuff introducting performing such production issue
analysis(with windbg) for ASP.NET application. However, the basic theory
and strategy is suitable for normal .net applications:

#Troubleshooting ASP.NET using WinDbg and the SOS extension
http://support.microsoft.com/kb/892277/en-us

#Quick things to check when you experience high memory levels in ASP.NET
http://support.microsoft.com/kb/893660/en-us

Hope this helps some.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 
S

Steven Cheng[MSFT]

Hi Henrick,

How are you doing on this issue? Does the information in my last reply
helps you a little? If there is still anything we can help, please feel
free to post here.

Regards,

Steven Cheng
Microsoft MSDN Online Support Lead


==================================================

When responding to posts, please "Reply to Group" via your newsreader so
that others may learn and benefit from your issue.

==================================================


This posting is provided "AS IS" with no warranties, and confers no rights.



Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top