Use top to analyze the CPU usage of each application thread.
top - 16:15:45 up 21 days, 2:27, 3 users, load average: 17.94, 12.30, 5.52 Tasks: 150 total, 26 running, 124 sleeping, 0 stopped, 0 zombie Cpu(s): 87.3% us, 1.2% sy, 0.0% ni, 27.6% id, 0.0% wa, 0.0% hi, 0.0% si Mem: 4039848k total, 3999776k used, 40072k free, 92824k buffers Swap: 2097144k total, 224k used, 2096920k free, 1131652k cached
The Cpus(s) row in this header section shows the CPU usage in terms of the following:
The "us", "sy" and "id" values are useful as the user, system (kernel) and idle CPU time respectively.
The next section shows the per-thread breakdown of the CPU usage.
PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 31253 user1 16 0 2112m 2.1g 1764 R 37.0 53.2 0:39.89 java 31249 user1 16 0 2112m 2.1g 1764 R 15.5 53.2 0:38.29 java 31244 user1 16 0 2112m 2.1g 1764 R 13.6 53.2 0:40.05 java 31250 user1 16 0 2112m 2.1g 1764 R 13.6 53.2 0:41.23 java 31242 user1 16 0 2112m 2.1g 1764 R 12.9 53.2 0:40.56 java 31238 user1 16 0 2112m 2.1g 1764 S 12.6 53.2 1:22.21 java 31246 user1 16 0 2112m 2.1g 1764 R 12.6 53.2 0:39.62 java 31248 user1 16 0 2112m 2.1g 1764 R 12.6 53.2 0:39.40 java 31258 user1 16 0 2112m 2.1g 1764 R 12.6 53.2 0:39.98 java 31264 user1 17 0 2112m 2.1g 1764 R 12.6 53.2 0:39.54 java 31243 user1 16 0 2112m 2.1g 1764 R 12.2 53.2 0:37.43 java 31245 user1 16 0 2112m 2.1g 1764 R 12.2 53.2 0:37.53 java 31255 user1 16 0 2112m 2.1g 1764 R 11.9 53.2 0:40.84 java 31265 user1 16 0 2112m 2.1g 1764 R 11.9 53.2 0:40.46 java 31239 user1 16 0 2112m 2.1g 1764 S 11.6 53.2 1:22.79 java 31254 user1 16 0 2112m 2.1g 1764 R 11.6 53.2 0:41.12 java 31266 user1 16 0 2112m 2.1g 1764 R 11.2 53.2 0:40.47 java 31261 user1 16 0 2112m 2.1g 1764 R 10.9 53.2 0:39.31 java 31262 user1 16 0 2112m 2.1g 1764 R 10.9 53.2 0:38.50 java ..
This provides the following information, some of which is for the whole process, and other inforamation relevant to the particular thread:
Note that the "Cpu(s)" line in the header of the output shows the percentage usage across all of the available CPUs, whereas the %CPU column represents the percentage usage of a single CPU. For example, on a four-CPU machine the Cpu(s) row will total 100% and the %CPU column will total 400%.