onstat -g laq command: Print secondary server queues

Use the onstat -g laq command to print information about queues on the secondary server that apply log information received from the primary server.

In a high-availability cluster, the primary server sends log records to one or more secondary servers over the network. Each secondary server continuously replays the transaction logs from the primary server to ensure that data is replicated on the secondary server. Each tblspace on the primary server is assigned a queue on the secondary server in which to receive log records. A thread, called an apply thread, applies the logs stored in the queue to the secondary server. The logs are applied in the order in which they were received.

You use the onstat -g laq command to monitor the performance of the queues on the secondary server. Use this command if you suspect that the primary server performance is slowed because logs are not replaying quickly enough on the secondary server. The Avg Depth (average depth) column indicates the average number of logs in the queue at the time that the last queue insert operation occurred.

The onstat -g laq command is valid only on secondary servers. Running the command on the primary server returns only the onstat header output.

Figure 1: Syntax:

1  onstat   -g  laq 

Example output

Figure 2: onstat -g laq command output
Log Apply Info:
Thread         Queue    Total      Avg
                Size   Queued    Depth
wreplay_1           0        9     5.00
wreplay_2           0        0     0.00
wreplay_3           0        7     3.43
wreplay_4           0        8     1.12
wreplay_5           0        4     1.50
wreplay_6           0        4     1.50
wreplay_7           0        6     1.33
wreplay_8           0       47     3.11
wreplay_9           0       37     9.46
wreplay_10          0       13     3.69

Secondary Apply Queue:         Total Buffers:12 Size:2048K Free Buffers:0
Log Recovery Queue:            Total Buffers:12 Size:20480K Free Buffers:0
Log Page Queue:                Total Buffers:512 Size:4K Free Buffers:1
Log Record Queue:              Total Buffers:1000 Size:16K Free Buffers:1

Transaction Latency: 1 seconds
Apply rate: 347887.41 recs/sec

Output description

Thread
The name of the apply thread assigned to receive the log record.
Queue Size
The number of log records queued for the apply thread.
Total Queued
The total number of queued log records for a given apply thread.
Avg Depth
The average number of logs in the queue at the time that the last queue insert operation occurred.
Secondary Apply Queue
The secondary apply queue receives log buffers from the primary server. The values displayed represent the total number of buffers allocated to receiving log buffer records, the size of the queue, and the number of unused buffers.
Log Recovery Queue
The log recovery queue receives output from the secondary apply queue. The log buffers are converted to a format compatible with the ontape utility. The values displayed represent the total number of stream buffers in the recovery queue, the size of the stream buffers, and the number of unused buffers.
Log Page Queue
The log page queue receives output from the log recovery queue. The ontape formatting is removed and the data is divided into individual log pages. The values displayed represent the total number of log pages in the queue, the size of the queue, and the number of unused buffers.
Log Record Queue
The log record queue receives output from the log page queue. The log pages are divided into individual log records. The values displayed represent the total number of log records in the recovery queue, the size of the queue, and the number of unused buffers.
Transaction Latency

Time difference between last replayed transaction commit time at primary server and local server. For this to be accurate, operating system time must match between primary and secondary servers.

Apply rate

Number of log records replayed per second. Apply rate is only shown with -r option.