Monitoring Threads

Onstat -g ath Print all Threads

This option to onstat will print all information about all user threads in the instance.

$onstat -g ath
Informix Dynamic Server Version 7.30.UC3   -- On-Line -- Up 2 days 22:12:02 -- 18464 Kbytes
Threads:
 tid     Tcb      rstcb    prty status                vp-class      name
 2       c19ab050 0        2    sleeping forever        3lio          vp 0
 3       c19ab2c0 0        2    sleeping forever        4pio          vp 0
 4       c19ab558 0        2    sleeping forever        5aio          vp 0
 5       cl9ab7f0 0        2    sleeping forever        6msc          vp 0
 6       c19aba88 0        2    sleeping forever        7aio          vp 1
 7       c19abe40 cl8da018 4    sleeping secs: 1        1cpu        main_loop()
 8       cl9c3810 0        2    running                 1cpu        soctcppoll
 9       cl9c3e20 0        3    sleeping forever        1cpu        soctcplst
 10      cl9c64c8 cl8da4cc 2    sleeping forever        1cpu        flush_sub(0)
 11      cl9c6c20 0        2    sleeping forever        8aio          vp 2
 12      cl9c6eb8 0        2    sleeping forever        9aio          vp 3
 13      c19C7150 0        2    sleeping forever       10aio          vp 4
 14      cl9c73e8 0        2    sleeping forever       llaio          vp 5
 15      cl9c7680 0        2    sleeping forever       12aio          vp 6
 16      cl9c7918 0        2    sleeping forever       13aio          vp 7
 17      cl9c7bb0 0        2    sleeping forever       14aio          vp 8
 18      c19c7e48 0        2    sleeping forever       15aio          vp 9
 19      cl9db128 0        2    sleeping forever       16aio          vp 10
 20      c19db390 0        2    sleeping forever       17aio          vp 11
 21      c19db628 0        2    sleeping forever       18aio          vp 12
 22      cl9db8c0 0        2    sleeping forever       19aio          vp 13
 23      c19dbb58 0        2    sleeping forever       20aio          vp 14
 24      c19dbdf0 0        2    sleeping forever       21aio          vp 15
 25      cl9de228 0        2    sleeping forever       22aio          vp 16
 26      cl9de468 0        2    sleeping forever       23aio          vp 17
 27      cl9deeb0 c18da980 3    sleeping forever        1cpu        aslogflush
 28      cl9df268 cl8dae34 2    sleeping secs: 43       1cpu        btclean
 44      cla23560 cl8dbc50 4    sleeping secs: 1        1cpu        onmode_mon
 70      c1be8bd0 c18db79c 2    cond wait  networm      1cpu         sqlexec
 76      c1bf0ef8 c18db2e8 2    cond wait  networm      1cpu         sqlexec

Meanings of the fields are:

• tid Thread ID
• tcb Address of the thread within the thread control block
• rstcb Address within the RSAM task-control block
• prty Priority of the thread
• status Status of the thread
 Common status flags:
 cond wait: netnorm Engine thread is waiting for client to give a command over tcp
 cond wait: smread Engine thread is waiting for client to give a command over shared memory connection
• vp-class VP class and VP number the thread last ran on
• name Descriptive name of the thread

These field meanings are the same for these three onstat -g subcommands:

  • onstat -g wai

  • onstat -g ath

  • onstat -g rea

  • onstat -g act

Onstat -g wai Print Waiting Threads

This invocation is a subset of the onstat -g ath command that shows only threads which are waiting for something. Field meanings are the same as onstat -g ath (above).

$ onstat –g wai
Informix Dynamic Server Version 7.30.UC3   -- On-Line -- Up 2 days 22:12:05 -- 18464 Kbytes
Waiting threads:
 tid     tcb      rstcb    prty status                vp-class      name
 2       c19ab050 0        2    sleeping forever        3lio          vp 0
 3       c19ab2c0 0        2    sleeping forever        4pio          vp 0
 4       c19ab558 0        2    sleeping forever        5aio          vp 0
 5       c19ab7fO 0        2    sleeping forever        6msc          vp 0
 6       c19aba88 0        2    sleeping forever        7aio          vp 1
 7       c19abe40 c18da018 4    sleeping sees: 1        1cpu        main_loop()
 9       c19c3e20 0        3    sleeping forever        1cpu        soctcplst
 10      c19c64c8 c18da4cc 2    sleeping forever        1cpu        flush_sub(0)
 11      c19c6c20 0        2    sleeping forever        8aio          vp 2
 12      c19c6eb8 0        2    sleeping forever        9aio          vp 3
 13      c19c7150 0        2    sleeping forever       1Oaio          vp 4
 14      c19c73e8 0        2    sleeping forever       11aio          vp 5
 15      c19c7680 0        2    sleeping forever       12aio          vp 6
 16      c19c7918 0        2    sleeping forever       13aio          vp 7
 17      c19c7bbO 0        2    sleeping forever       14aio          vp 8
 18      c19c7e48 0        2    sleeping forever       15aio          vp 9
 19      c19db128 0        2    sleeping forever       16aio          vp 10
 20      c19db390 0        2    sleeping forever       17aio          vp 11
 21      c19db628 0        2    sleeping forever       18aio          vp 12
 22      c19db8cO 0        2    sleeping forever       19aio          vp 13
 23      c19dbb58 0        2    sleeping forever       20aio          vp 14
 24      c19dbdfO 0        2    sleeping forever       21aio          vp 15
 25      c19de228 0        2    sleeping forever       22aio          vp 16
 26      c19de468 0        2    sleeping forever       23aio          vp 17
 27      c19deebO c18da980 3    sleeping forever        1cpu        aslogflush
 28      c19df268 c18dae34 2    sleeping sees: 40       1cpu        btclean
 44      c1a23560 c1BdbcSO 4    sleeping sees: 1        1cpu        onmode_raon
 70      c1beSbdO c18db79c 2    cond wait netnorm       1cpu        sqlexec
 76      c1bfOefS c18db2e8 2    cond wait netnorm       1cpu        sqlexec

Onstat -g act Print Active Threads

This is another subset of onstat -g ath, and the field definitions are the same as for the above two thread-listing invocations.

$ onstat -g act
Informix Dynamic Server Version 7.30.UC3   -- On-Line -- Up 2 days 22:12:10 -- 18464 Kbytes
Running threads:
 tid     tcb      rstcb    prty status                vp-class      name
 8       c!9c3810 0        2    running                 1cpu        soctcppoll

Onstat -g rea Print Ready Threads

This is yet another onstat command using the same headings as onstat -g ath. It shows the ready queue, that is, threads that are ready to run and waiting to run. As long as your system is not hardware bound, if you continue to see many threads in a ready state, it may help to add additional virtual processors to service these threads. When adding virtual processors to the engine no longer reduces the ready queue, the system is hardware bound and the only solution is either to put up with decreased performance or to add additional physical CPUs to the system.

$ onstat -g rea
Informix Dynamic Server Version 7.30.UC3   -- On-Line -- Up 2 days 22:12:13 -- 18464 Kbytes
Ready threads:
 tid     tcb      rstcb    prty status                vp-class      name

Onstat -g sle Print all Sleeping Threads

This command lists the threads that are sleeping, waiting for a timeout. Threads that are sleeping forever do not show up here.

$ onstat -g sle
Informix Dynamic Server Version 7.30.UC3   -- On-Line -- Up 2 days 22:12:16 -- 18464 Kbytes
Sleeping threads with timeouts: 3 threads
       tid     v_proc rstcb          name           time
       7       1      c18da018       main_loop()    1
       44      1      c18dbc50       onmode_mon     1
       28      1      c18dae34       btclean 29

Field meanings are:

• tid Unique thread ID
• v_proc Virtual processor number
• rstcb RSAM task-control block address
• name Type of thread
• time Time left to sleep

Onstat -g spi Print Spin Locks with Long Spins

This command lists spin locks that have been obtained after more than 10,000 spins for any virtual processor. When a irtual processor spins more than 10,000 times, this is called a longspin.

There are four things that you can do to reduce longspins:

  • Reduce load on the system

  • Reduce number of virtual processors

  • Set no-age parameter

  • Set processor affinity parameters

$ onstat -g spi
Informix Dynamic Server Version 7.30.UC3   -- On-Line -- Up 2 days 22:12:21 -- 18464 Kbytes
Spin locks with waits:
Num Waits   Num Loops   Avg Loop/Wait    Name
1           1           1.00             vproc vp_lock, id = 1

Onstat -g tpf Print Thread Profiles

$ onstat -g tpf
Informix Dynamic Server Version 7.30.UC3   -- On-Line -- Up 2 days 22:14:57 -- 18464 Kbytes
Thread profiles
tid lkreqs lkw d1 to lgrs isrd iswr isrw isdl isct isrb lx bfr bfw lsus lsmx seq
0   0      0   0  0  0    0    0    0    0    0    0    0  0   0   0    0    0
0   0      0   0  0  0    0    0    0    0    0    0    0  0   0   0    0    0
0   0      0   0  0  0    0    0    0    0    0    0    0  0   0   0    0    0
0   0      0   0  0  0    0    0    0    0    0    0    0  0   0   0    0    0
76  0      0   0  0  0    0    0    0    0    0    0    0  0   0   0    0    0
70  0      0   0  0  0    0    0    0    0    0    0    0  0   0   0    0    0
31  0      0   0  0  0    0    0    0    0    0    0    0  0   0   0    0    0

This output is completely undocumented, but I believe that the meanings are as follows:

• tid Thread id
• lkreqs Lock requests
• lkw Lock waits
• dl Deadlocks
• to Lock Timeouts
• lgrs Log records written
• isrd ISAM reads (from disk)
• iswr ISAM writes (to disk)
• isrw ISAM rewrites (second write to a page)
• isdl ISAM deletes
• isct ISAM commits
• isrb ISAM rollbacks
• lx Long transactions
• bfr Buffer reads
• bfw Buffer writes
• Isus Log space used
• lsmx Max log space used
• seq Sequential scans

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.217.60.35