0

I want to check the number of processors using by a particular process in unix solaris. Which command we can use for that?

Thanks, D.

0

2 Answers 2

2

A single threaded process will only use at most one CPU and unless bounded to a processor set it can be any of them.

To know what CPUs a given process is using at a given time, you can run this command (replace pid is the process id):

prstat -p pid -n 65536 -c 0 1 | grep cpu

Remove the | grep cpu part to see all threads, including those currently sleeping.

Note that even multi-threaded processes will rarely use a lot of CPUs, if any, as they are often I/O bound, not CPU bound.

1
  • Oh, I misunderstood his question I guess. I read it as "Check number of processors using a command".
    – favoretti
    Oct 2, 2012 at 6:57
1

You can use psrinfo -v for that.

2
  • cat /proc/cpuinfo
    – Ivan
    Oct 2, 2012 at 1:51
  • 1
    /proc/cpuinfo is a Linux feature. prsinfo -v doesn't tell which process is using which cpu.
    – jlliagre
    Oct 2, 2012 at 6:21

You must log in to answer this question.