I want to check the number of processors using by a particular process in unix solaris. Which command we can use for that?
This question came from our site for professional and enthusiast programmers.
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):
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.