I would like to monitor the number of threads used by a specific process on Linux. Is there an easy way to get this information without impacting the performance of the proc
$ ps H p pid-id
H - Lists all the individual threads in a process
or
$cat /proc/pid-id/status
pid-id is the Process ID
eg.. (Truncated the below output)
root@abc:~# cat /proc/8443/status Name: abcdd State: S (sleeping) Tgid: 8443 VmSwap: 0 kB Threads: 4 SigQ: 0/256556 SigPnd: 0000000000000000