From Wiki-UX.info

Wiki-UX / How to report process threads using Glance
Jump to: navigation, search

How to report process threads using Glance

Contents

Abstract

The following article show how to use glance to obtained the number of threads of the system process.

Create Glance Thread report

1. Create a /var/tmp/syntax glance syntax file:

PROCESS LOOP {
print PROC_PROC_ID, " ", PROC_PROC_NAME, PROC_THREAD_COUNT
}

2. Use the following glance syntax to create a report of the number of threads per process:

glance -adviser_only -syntax /var/tmp/syntax -j 5 -iterations 1 | sort -n -k3 | uniq

Example:

# glance -adviser_only -syntax /var/tmp/syntax -j 5 -iterations 1 | sort -n -k3 | uniq
         0 swapper              1
         2 vhand                1
         3 statdaemon           1
         4 unhashdaemon         1
         9 ttisr                1
        12 net_str_cached       1
        13 net_str_cached       1
        14 kevm                 1
        15 lvmkd                1
        16 lvmkd                1
        17 lvmkd                1
        18 lvmkd                1
        19 lvmkd                1
        20 lvmkd                1
        21 lvmschedd            1
        23 sendfile_vn_rele     1
        26 nfs_async_io         1
        27 nfs_failover         1
        28 nfs4clntkd           1
        29 nfs4_async_io        1
        32 lvmp_kd              1
        33 lvmp_kd              1
        34 lvmp_kd              1
        35 lvmp_kd              1
        36 lvmp_kd              1
        37 lvmp_kd              1
        38 lvmp_schedd          1
        39 afinet_strout        1
        40 inet_areset_daem     1
        41 smpsched             1
        42 strmem               1
        43 strweld              1
        44 strfreebd            1
        45 OlstarMdep           1
        46 lvmdevd              1
        47 lvmattachd           1
        48 pagetableinit_da     1
        49 shutdowndaemon       1
        50 awd                  1
        51 progressdaemon       1
        53 fcachedaemon         1
        56 ipmid                1
        64 eventdaemon          1
        66 sblksched            1
        67 sblksched            1
        68 smpsched             1
        70 nfslogkd             1
        71 nfs4srvkd            1
       128 lvmdevd              1
       129 lvmattachd           1
       175 fsdaemon             1
       627 syncer               1
       693 evmd                 1
       712 evmlogger            1
       713 evmchmgr             1
       886 syslogd              1
       891 ptydaemon            1
       905 hotplugd             1
       919 nktl_daemon          1
       929 ntl_reader           1
      1294 uxwdog               1
      1345 sshd                 1
      1355 rpcbind              1
      1389 rpc.statd            1
      1445 inetd                1
      1728 sendmail             1
      1761 hp_unixagt           1
      1770 ipv6agt              1
      1779 mib2agt              1
      1791 trapdestagt          1
      1849 xntpd                1
      1869 pwgrd                1
      1876 lpsched              1
      1886 cron                 1
      1903 diagmond             1
      1906 envd                 1
      1936 postmaster           1
      1946 postgres             1
      1947 postgres             1
      1987 ttd                  1
      1994 scopeux              1
      2062 smhstartd            1
      2092 cifsclientd          1
      2133 emsagent             1
      2276 diaglogd             1
      2277 memlogd              1
      2278 psmctd               1
      2284 DevManBE             1
      2287 registrar            1
      2358 rpc.mountd           1
      2408 ovtrcd               1
      2417 sh                   1
      2434 dtlogin              1
      2437 getty                1
      2439 krsd                 1
      2440 sfd                  1
      2441 esmd                 1
      2445 p_client             1
      2459 kcmond               1
      2472 disk_em              1
      2476 bootpd               1
      2693 dm_core_hw           1
      2751 dm_memory            1
      2796 dm_ql_adapter        1
      2881 fpl_em               1
      2943 ia64_corehw          1
      2996 lpmc_em              1
      3042 sysstat_em           1
      3544 postmaster           1
      3545 postmaster           1
      4338 postmaster           1
      4347 postmaster           1
      8878 telnetd              1
      8879 sh                   1
      8959 telnetd              1
      8960 sh                   1
      8986 glance               1
      8987 sort                 1
      8988 uniq                 1
         1 init                 2
         6 kmemdaemon           2
         7 ioconfigd            2
        22 side_daemon          2
        24 nfs_reclaim          2
        30 autofskd             2
        31 cachefskd            2
        52 dcda_daemon          2
        54 fb_daemon            2
        55 evacd                2
        72 pagezerod            2
      1295 ns-httpd             2
      1395 rpc.lockd            2
      1414 nfs4cbd              2
      1420 nfsmapid             2
      1748 snmpdm               2
      2012 midaemon             2
      2037 perfalarm            2
      2364 nfsd                 2
         8 ksyncer_daemon       3
        65 pm_schedcpu          3
        69 kend                 3
      1434 automountd           3
        25 krpckd               4
        11 escsid               8
      2052 coda                 8
         5 signald              9
       631 utmpd                9
      2050 ovbbccb              9
        10 ObjectThreadPool    12
      2326 vxsvc               13
        63 vxfsd               15
      1369 ldapclientd         15
      2046 ovcd                15
      2055 swagentd            16
      1826 rpcd                22
      3567 mxinventory         25
      3568 mxinventory         25
      3567 mxinventory         26
      3568 mxinventory         26
      2446 mxdtf               36
      1260 ns-slapd            41
      1296 ns-httpd            71
      2447 mxdomainmgr        138

Note: To display the total number of threads, append the following awk script to produce an accumulate total:

glance -adviser_only -syntax /var/tmp/syntax -j 5 -iterations 1 | sort -n -k3 | uniq \
| awk 'BEGIN {COUNT=0;}
{
print $0
COUNT=COUNT + $3
}
END { printf "\nTotal threads: %d\n", COUNT }'

Example:

# glance -adviser_only -syntax /var/tmp/syntax -j 5 -iterations 1 | sort -n -k3 | uniq \
> | awk 'BEGIN {COUNT=0;}
> {
> print $0
> COUNT=COUNT + $3
> }
> END { printf "\nTotal threads: %d\n", COUNT }'
         0 swapper              1
         2 vhand                1
         3 statdaemon           1
         4 unhashdaemon         1
         9 ttisr                1
        12 net_str_cached       1
        13 net_str_cached       1
        14 kevm                 1
        15 lvmkd                1
        16 lvmkd                1
        17 lvmkd                1
        18 lvmkd                1
        19 lvmkd                1
        20 lvmkd                1
        21 lvmschedd            1
        23 sendfile_vn_rele     1
        26 nfs_async_io         1
        27 nfs_failover         1
        28 nfs4clntkd           1
        29 nfs4_async_io        1
        32 lvmp_kd              1
        33 lvmp_kd              1
        34 lvmp_kd              1
        35 lvmp_kd              1
        36 lvmp_kd              1
        37 lvmp_kd              1
        38 lvmp_schedd          1
        39 afinet_strout        1
        40 inet_areset_daem     1
        41 smpsched             1
        42 strmem               1
        43 strweld              1
        44 strfreebd            1
        45 OlstarMdep           1
        46 lvmdevd              1
        47 lvmattachd           1
        48 pagetableinit_da     1
        49 shutdowndaemon       1
        50 awd                  1
        51 progressdaemon       1
        53 fcachedaemon         1
        56 ipmid                1
        64 eventdaemon          1
        66 sblksched            1
        67 sblksched            1
        68 smpsched             1
        70 nfslogkd             1
        71 nfs4srvkd            1
       128 lvmdevd              1
       129 lvmattachd           1
       175 fsdaemon             1
       627 syncer               1
       693 evmd                 1
       712 evmlogger            1
       713 evmchmgr             1
       886 syslogd              1
       891 ptydaemon            1
       905 hotplugd             1
       919 nktl_daemon          1
       929 ntl_reader           1
      1294 uxwdog               1
      1345 sshd                 1
      1355 rpcbind              1
      1389 rpc.statd            1
      1445 inetd                1
      1728 sendmail             1
      1761 hp_unixagt           1
      1770 ipv6agt              1
      1779 mib2agt              1
      1791 trapdestagt          1
      1849 xntpd                1
      1869 pwgrd                1
      1876 lpsched              1
      1886 cron                 1
      1903 diagmond             1
      1906 envd                 1
      1936 postmaster           1
      1946 postgres             1
      1947 postgres             1
      1987 ttd                  1
      1994 scopeux              1
      2062 smhstartd            1
      2092 cifsclientd          1
      2133 emsagent             1
      2276 diaglogd             1
      2277 memlogd              1
      2278 psmctd               1
      2284 DevManBE             1
      2287 registrar            1
      2358 rpc.mountd           1
      2408 ovtrcd               1
      2417 sh                   1
      2434 dtlogin              1
      2437 getty                1
      2439 krsd                 1
      2440 sfd                  1
      2441 esmd                 1
      2445 p_client             1
      2459 kcmond               1
      2472 disk_em              1
      2476 bootpd               1
      2693 dm_core_hw           1
      2751 dm_memory            1
      2796 dm_ql_adapter        1
      2881 fpl_em               1
      2943 ia64_corehw          1
      2996 lpmc_em              1
      3042 sysstat_em           1
      3544 postmaster           1
      3545 postmaster           1
      4338 postmaster           1
      4347 postmaster           1
      8878 telnetd              1
      8879 sh                   1
      8959 telnetd              1
      8960 sh                   1
      9000 glance               1
      9001 sort                 1
      9002 uniq                 1
      9003 awk                  1
         1 init                 2
         6 kmemdaemon           2
         7 ioconfigd            2
        22 side_daemon          2
        24 nfs_reclaim          2
        30 autofskd             2
        31 cachefskd            2
        52 dcda_daemon          2
        54 fb_daemon            2
        55 evacd                2
        72 pagezerod            2
      1295 ns-httpd             2
      1395 rpc.lockd            2
      1414 nfs4cbd              2
      1420 nfsmapid             2
      1748 snmpdm               2
      2012 midaemon             2
      2037 perfalarm            2
      2364 nfsd                 2
         8 ksyncer_daemon       3
        65 pm_schedcpu          3
        69 kend                 3
      1434 automountd           3
        25 krpckd               4
        11 escsid               8
      2052 coda                 8
         5 signald              9
       631 utmpd                9
      2050 ovbbccb              9
        10 ObjectThreadPool    12
      2326 vxsvc               13
        63 vxfsd               15
      1369 ldapclientd         15
      2046 ovcd                15
      2055 swagentd            16
      1826 rpcd                22
      3567 mxinventory         25
      3568 mxinventory         25
      2446 mxdtf               31
      2446 mxdtf               36
      1260 ns-slapd            41
      1296 ns-httpd            71
      2447 mxdomainmgr        135
      2447 mxdomainmgr        136
 
Total threads: 825

Reference

Authors

This page was last modified on 6 July 2009, at 16:10. This page has been accessed 3,651 times.