2

What is the command to find out number of cores the process is running on at any instance ?

-Thanks

1 Answers1

1

Top command can provide information on individual threads of a process using the following command

top -H -p <pid>

To find the last core on which the thread was run try press f, than press j to enable the CPU core column.

Output will be like

top - 11:50:35 up 332 days, 16:31,  2 users,  load average: 1.39, 1.45, 1.31
Tasks:   7 total,   1 running,   6 sleeping,   0 stopped,   0 zombie
Cpu(s):  2.8%us,  1.7%sy,  0.0%ni, 95.5%id,  0.0%wa,  0.0%hi,  0.1%si,  0.0%st
Mem:  65980588k total, 24549232k used, 41431356k free,    30268k buffers
Swap: 135170856k total, 23016712k used, 112154144k free, 11289596k cached

  PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+   P COMMAND
10721 tom       25   0  326m 285m 3536 R 100.0  0.4 182:13.73 22 kproxy
10722 tom       17   0  326m 285m 3536 S  0.0  0.4   0:00.00  0 kproxy
10723 tom       15   0  326m 285m 3536 S  0.0  0.4   0:00.15  7 kproxy
10724 tom       15   0  326m 285m 3536 S  0.0  0.4   0:00.00  1 kproxy
10722 tom       17   0  326m 285m 3536 S  0.0  0.4   0:00.00  0 kproxy
10723 tom       15   0  326m 285m 3536 S  0.0  0.4   0:00.15  7 kproxy
10724 tom       15   0  326m 285m 3536 S  0.0  0.4   0:00.00  1 kproxy

Numbers below the P column is the core that was last used by the thread. Value R below the S column means that thread is running.

Deven
  • 301