System Administration Guide, Volume 2

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
01:00:00

Note -

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


Output from the -q option is described in the table below.

Table 36-15 Output From the sar -q Command

Field Name 

Description 

runq-sz

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

%runocc

The percentage of time 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 may be required to obtain acceptable system response.


$ sar -q
SunOS venus 5.8 Generic sun4u    09/07/99

00:00:00 runq-sz %runocc swpq-sz %swpocc
01:00:00                                
02:00:02                                
03:00:00     1.0       0                
04:00:00                                
05:00:01     1.0       0                
06:00:00

Average      1.3       0