How to view the process threads within solaris?

13,967

Just run prstat and have a look to the last column, labeled PROCESS/NLWP.

NLWP means number of light-weight processes which is precisely the number of threads the process is currently using with Solaris as there is a one-to-one mapping between lwp and user threads.

A single thread process will show 1 there while a multi-threaded one will show a larger number.

eg:

  PID USERNAME  SIZE   RSS STATE  PRI NICE      TIME  CPU PROCESS/NLWP       
...
12905 root     4472K 3640K cpu0    59    0   0:00:01 0.4% prstat/1
18403 monitor   474M  245M run     59   17   1:01:28 9.1% java/103
 4102 oracle     12G   12G run     59    0   0:00:12 4.5% oracle/1

Here prstat and oracle are single-threaded while java is multi-threaded (it is always)

You can drill down individual threads activity of a multi-threaded process by using the -L and -p options, like prstat -L -p pid

This will show up a line for each thread sorted by CPU activity. In that case the last column will be labeled PROCESS/LWPID, LWPID being the thread id. If more than one thread shows a significant activity, your process will actively be taking advantage of multi-threading.

Share:
13,967

Related videos on Youtube

Tri Trinh
Author by

Tri Trinh

Updated on September 15, 2022

Comments

  • Tri Trinh
    Tri Trinh almost 2 years

    I'm experiencing issues within the T3 architecture where the db processes aren't fully utilizing the cpu's threading capabilities. I'd like to understand how 11g and 10g takes advantage of threading and if I can validate those queries from the system.

    How can I tell whether a solaris process is parallelized and is taking advantage of the threading within the cpu?