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

Note –

The number of LWPs swapped out might be greater than zero even if the system has an abundance of free memory. This situation happens when a sleeping LWP is swapped out and has not been awakened (for example, a process or LWP is sleeping, waiting for keyboard or mouse input).


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

The average number of swapped out LWPs. 

%swpocc

The percentage of time LWPs are swapped out. 

Example—Checking Queue Activity

The following abbreviated 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 venus 5.9 Generic sun4u    06/24/2001

08:45:18 runq-sz %runocc swpq-sz %swpocc
08:45:18        unix restarts
09:00:00     1.0       0     0.0       0
09:20:00     0.0       0     0.0       0
09:40:00     0.0       0     0.0       0

Average      1.0       0     0.0       0