System Administration Guide: Advanced Administration

How to Check Queue Activity (sar -q)

Use the sar -q command to report the average queue length while the queue is occupied, and the percentage of time that the queue is occupied.


$ sar -q
00:00:00 runq-sz %runocc swpq-sz %swpocc

The following table describes the output from the -q option.

Table 24–15 Output From the sar -q Command

Field Name 

Description 

runq-sz

The number of kernel threads in memory that are waiting for a CPU to run. Typically, this value should be less than 2. Consistently higher values mean that the system might be CPU-bound. 

%runocc

The percentage of time that the dispatch queues are occupied. 

swpq-sz

No longer reported by sar.

%swpocc

No longer reported by sar.

Example—Checking Queue Activity

The following example shows output from the sar -q command. If %runocc is high (greater than 90 percent) and runq-sz is greater than 2, the CPU is heavily loaded and response is degraded. In this case, additional CPU capacity might be required to obtain acceptable system response.


$ sar -q
SunOS touchstone 5.9 Generic sun4u    03/04/2003

00:00:00 runq-sz %runocc swpq-sz %swpocc
01:00:00     0.0       0     0.0       0
02:00:00     0.0       0     0.0       0
03:00:00     0.0       0     0.0       0
04:00:00     1.0       0     0.0       0
05:00:00     0.0       0     0.0       0
06:00:00     0.0       0     0.0       0
07:00:00     1.0       0     0.0       0
08:00:00     0.0       0     0.0       0
08:20:01     0.0       0     0.0       0
08:40:00     0.0       0     0.0       0
09:00:00     1.0       0     0.0       0
09:20:01     1.6       3     0.0       0
09:40:01     1.5       8     0.0       0
10:00:02     1.6       7     0.0       0
10:20:03     1.5       2     0.0       0
10:40:01     1.9       1     0.0       0
11:00:01     1.4       0     0.0       0
11:20:01     1.6       0     0.0       0

Average      1.6       1     0.0       0