Thursday, January 08, 2009

If you met High CPU utilization on your Application server...

I found the "Performance analysis for java Webistes" mentioned high CPU utilization problem analysis, it is useful and very practical for our performance work.



During our local performance testing, if we found:
1. High User CPU%
High user CPU% means the server is very busy handling requests from the web application:
----Heavy Load
----Bad code design and implementation
----Poor hardware
so from performance testing perspective, we should consider:
----Does the performance testing load pattern realistic or make sense to the real world model? if not, adjust it first, including user load, user distribution and test scenarios
----take Thread Dump snapshot or use some profiling tool to detect what kind of tasks /methods every thread is doing(especially for methods which the slowest action related ), then do the code review after identify the bottlenecks
----if nothing can be done by anyone, upgrade your hardware to meet your target :)

2. High System CPU% (Task manager: kernel mode; Perfmon: privileged mode)
----Http server listener will impact your App server CPU%, need to separate your web server and App server
----"Kill" or Reduce other unnecessary processes (in task manager, user name of these processes called System), like Anti-virus process or csrss.exe.

3. HIgh wait CPU% (total CPU%-User CPU%-System CPU%=wait CPU%??)
----take thread Dump to see if most of threads are "waiting on a monitor entry " or "waiting on a condition" , if so , then you might focus on your tuning work at once
----you might need to check your logging settings or code related to logging part
----you might check disk availability on the server
----you might check database efficiency, (Sql profiler may give some help on this)
---- you might check asynchronous process design, if its implementation is properly
----Check Network or remote issues?

enjoy!

No comments:

Post a Comment