Monitor threads with onstat –u output
Use the onstat –u command to display information about active threads that require a database server task-control block.
Active threads include threads that belong to user sessions, as well as some that correspond to database server daemons (for example, page cleaners). Figure 1 shows an example of onstat -u output.
Also use the onstat -u command to determine if a user is waiting for a resource or holding too many locks, or to get an idea of how much I/O the user has performed.
The utility output displays the following information:
- The address of each thread
- Flags that indicate the present state of the thread (for example,
waiting for a buffer or waiting for a checkpoint), whether the thread
is the primary thread for a session, and what type of thread it is
(for example, user thread, daemon thread, and so on)
For information on these flags, see the HCL Informix® Administrator's Reference.
- The session ID and user login ID for the session to which the
thread belongs
A session ID of 0 indicates a daemon thread.
- Whether the thread is waiting for a specific resource and the address of that resource
- The number of locks that the thread is holding
- The number of read calls and the number of write calls that the thread has executed
- The maximum number of current, active user threads
If you execute onstat -u while the database
server is performing fast recovery, several database server threads
might appear in the display.
Figure 1. onstat -u output
Userthreads
address flags sessid user tty wait tout locks nreads nwrites
80eb8c ---P--D 0 informix - 0 0 0 33 19
80ef18 ---P--F 0 informix - 0 0 0 0 0
80f2a4 ---P--B 3 informix - 0 0 0 0 0
80f630 ---P--D 0 informix - 0 0 0 0 0
80fd48 ---P--- 45 chrisw ttyp3 0 0 1 573 237
810460 ------- 10 chrisw ttyp2 0 0 1 1 0
810b78 ---PR-- 42 chrisw ttyp3 0 0 1 595 243
810f04 Y------ 10 chrisw ttyp2 beacf8 0 1 1 0
811290 ---P--- 47 chrisw ttyp3 0 0 2 585 235
81161c ---PR-- 46 chrisw ttyp3 0 0 1 571 239
8119a8 Y------ 10 chrisw ttyp2 a8a944 0 1 1 0
81244c ---P--- 43 chrisw ttyp3 0 0 2 588 230
8127d8 ----R-- 10 chrisw ttyp2 0 0 1 1 0
812b64 ---P--- 10 chrisw ttyp2 0 0 1 20 0
812ef0 ---PR-- 44 chrisw ttyp3 0 0 1 587 227
15 active, 20 total, 17 maximum concurrent