onstat -g sle Sleeping Threads
The onstat -g sle command displays threads that are currently on the sleep queue along with the number
of seconds remaining before the thread awakens (is placed on the ready queue by the ADM virtual processor).
Sleeping threads with timeouts: 4 threads
tid v_proc rstcb name time
6 1 140d3018 main_loop() 1
151 1 14a59158 onmode_mon 1
11 1 0 sm_discon 2
143 1 14a585d8 btclean 54
||The thread ID.
||The ID of the virtual processor where this thread last ran.
||The in-memory address of the thread's rstcb.
||The name of the sleeping thread.
||The amount of time left in seconds for this thread to sleep before being moved to the ready queue.
A thread is put to sleep for a specific period of time or forever.
Time in the later engines is displayed as a two digit decimal.
Monitoring and Tuning
Threads will be placed onto the sleep queue when they need to sleep for a specific period of time
as with the BTree cleaner thread which wakes up every 60 seconds to perform its work. sqlexec
threads will end up on the sleep queue if they execute a SET LOCK MODE TO WAIT statement either
with or without a specified number of seconds and the resource they are after is locked. For example, if
an sqlexec thread set its lock mode to wait 30 seconds and it encounters a lock, it will be placed
on the sleep queue until either 30 seconds has elapsed or the lock has been released.
Some threads are placed on the sleep queue with the number of seconds set to forever. These threads
are usually threads waiting for an event to occur, such as being signalled that data they were waiting
for is now ready for processing.