onstat -g wst command: Print wait statistics for threads

Use the onstat -g wst command to show the wait statistics for the threads within the system.

The WSTATS configuration parameter must be set to 1 to enable wait statistics collection. For more information, see WSTATS configuration parameter .

Figure 1: Syntax:

1  onstat   -g wst

Example output

Version 11.70.F  -- On-Line -- Up 18:52:59 -- 78856 Kbytes
name   tid    state            n         avg(us)    max(us)
msc vp 0 5    ready            6               9        17 
msc vp 0 5    run              6            1107      2215 
msc vp 0 5    IO Idle          5          2985.9s   1496.1s

main_loo 7    IO Wait          55           6496     16725 
main_loo 7    yield time       44929         1.2s    343.1s
main_loo 7    ready            44998      206085     343.1s
main_loo 7    run              44985           5       436 

...

sqlexec  63   IO Wait          2            1118      2165 
sqlexec  63   other cond       6           34237    204142 
sqlexec  63   ready            9               7        16 
sqlexec  63   run              7             1.1s      7.7s

Output description

name (string)
Thread name
tid (decimal)
Thread ID
state (string)
State the thread waited in for this line of output. A single thread can have multiple lines of output if it waited in more than one state. Values that can appear in the state field include:
  • chkpt cond: The thread waited for a checkpoint condition.
  • cp mutex: The thread waited for checkpoint mutex to become available.
  • deadlock mutex: The thread waited for a deadlock mutex to become available.
  • empty Q: The thread waited for an empty buffer on a queue.
  • fork: The thread waited for a child thread to run.
  • full Q: The thread waited for a full buffer on a queue.
  • IO Idle: The I/O thread was idle.
  • IO Wait: The thread yielded while it waited for I/O completion.
  • join wait: The thread waited for another thread to exit.
  • lock mutex: The thread waited for lock mutex to become available.
  • lockfree mutex: The thread waited for a lock-free mutex to become available.
  • logflush: Logical log flushing occurred.
  • log mutex: The thread waited for logical log mutex to become available.
  • logcopy cond: The thread waited for logical log copy condition.
  • logio cond: The thread waited for a logical log condition.
  • lrus mutex: The thread waited for a buffer LRU mutex to become available.
  • misc: The thread waited for a miscellaneous reason.
  • other cond: The thread waited for an internal condition.
  • other mutex: The thread waited for an internal system mutex to become available.
  • other yield: The thread yielded for an internal reason.
  • OS read: The thread waited for an operating system read call to complete.
  • OS write: The thread waited for an operating system write call to complete.
  • ready: The thread was ready to run.
  • run: The thread ran.
  • sort io: The thread waited for sort I/O completion.
  • vp mem sync: The thread waited for synchronization of virtual processor memory.
  • yield bufwait: The thread yielded while it waited for a buffer to become available.
  • yield 0: The thread yielded with an immediate timeout.
  • yield time: The thread yielded with a timeout.
  • yield forever: The thread yielded and stays that way until it wakes up.
n (decimal)
Number of times the thread waited in this state
avg(us) (floating point)
Average user time the thread spent waiting in this state per wait occurrence. Time is in microseconds; an s after the value indicates user time in seconds.
max(us) (floating point)
Maximum user time the thread spent waiting in this state for a single wait occurrence. Time is in microseconds; an s after the value indicates user time in seconds.