Monitorin法号大全g CPU with UNIX
本文摘要:A common question is why is my 100% utilization at 100%. There is a great deal of concern about the measurement of CPU at the Oracle server level. If you suspect a CPU utilization problem, see these important notes on 100% CPU and Oracle

 
A common question is "why is my 100% utilization at 100%".  There is a great deal of concern about the measurement of CPU at the Oracle server level.

If you suspect a CPU utilization problem, see these important notes on 100% CPU and Oracle.  Also see Oracle and CPU utilization metrics.

Also see my notes on OS Busy scripts.

Once we understand the CPU resources are scarce (just like RAM resources), and not to be wasted), we need to understand how to tell if our Oracle server is making optimal usage of his computing hardware.

There are many OS utilities that allow us to see CPU utilization statistics, including these, but also with uptime and procinfo.

Each of these tools display CPU processor metrics at a finer level of detail than Oracle.  This is because the OS does not reveal all processor details to applications (To UNIX, Oracle is just another application), and the best place to see what's going on inside your server is to use the operating systems CPU monitors.  These will report different metrics on CPU utilization:

The runqueue - This is the far left-hand column of the vmstat command display (labeled with an "r").  It reports the total length of the CPU dispatcher queue.  When the runqueue exceeds the number of CPU's on the server, you have have an overloaded server with a CPU bottleneck.
 

The load average - This is defined as the sum of the run queue length and the number of jobs currently running on the CPUs. In each display of the load average consists of three numbers.  Most often, the load average numbers show a descending order from left to right, with the load average for 1, 5, and 15 minutes in the past. Occasionally, however, an ascending order appears (e.g. like that shown in the top output).

There are a host of UNIX commands that display CPU and memory consumption.  While there are dialect-specific utilities such as glance, we will look at the common vmstat and top utilities.

 

Using top to monitor CPU

The "top" command can be used to display CPU utilization.  The metrcis are:

load average - The load average is computed as

CPU states - This show percentage metrics for current processor usage.

Monitorin法号大全g CPU with UNIX

 

System: corp-hp1                                      Thu Jul  6 09:14:23 2000

Load averages: 0.04, 0.03, 0.03

340 processes: 336 sleeping, 4 running

Cpu states:

CPU   LOAD   USER   NICE    SYS   IDLE  BLOCK  SWAIT   INTR   SSYS

 0    0.06   5.0%   0.0%   0.6%  94.4%   0.0%   0.0%   0.0%   0.0%

 1    0.06   0.0%   0.0%   0.8%  99.2%   0.0%   0.0%   0.0%   0.0%

 2    0.06   0.8%   0.0%   0.0%  99.2%   0.0%   0.0%   0.0%   0.0%

 3    0.06   0.0%   0.0%   0.2%  99.8%   0.0%   0.0%   0.0%   0.0%

 4    0.00   0.0%   0.0%   0.0% 100.0%   0.0%   0.0%   0.0%   0.0%

 5    0.00   0.2%   0.0%   0.0%  99.8%   0.0%   0.0%   0.0%   0.0%

---   ----  -----  -----  -----  -----  -----  -----  -----  -----

avg   0.04   1.0%   0.0%   0.2%  98.8%   0.0%   0.0%   0.0%   0.0%

 

Memory: 493412K (229956K) real, 504048K (253952K) virtual, 767868K free  Page# 1

/49

 

CPU TTY  PID USERNAME PRI NI   SIZE    RES STATE    TIME %WCPU  %CPU COMMAND

 0   - 26835 applmgr  154 20 30948K 11936K sleep    0:49  3.91  3.90 f45runw

 2   - 27210 applmgr  154 20 31316K 12836K sleep    0:49  1.91  1.91 f45runw

w88优德:Monitorin法号大全g CPU with UNIX