Operating System - Tru64 Unix
1748207 Members
3265 Online
108759 Solutions
New Discussion юеВ

Re: Process per CPU

 
Juan Canjura
Advisor

Process per CPU

Is there a way to know which processes are running on each CPU?

Thanks,

Juan
8 REPLIES 8
Hein van den Heuvel
Honored Contributor

Re: Process per CPU


'top' is the easiest, if you can find it.


The official tool is 'ps -o pid,psr,args'
Sometimes the 'ps -o pid,rad,args'

Why woudl you like to know? Maybe we can help you address the underlying problem.

Check out 'man runon' and the man pages it points to on pset's and numa.


Hein.
Yogeeraj_1
Honored Contributor

Re: Process per CPU

hi,

you can also use glance

glance -R

then specify the PID

You can then view in realtime, the CPU which is servicing the process as well as the switches.

e.g.

Running CPU : 0


hope this helps!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Venkatesh BL
Honored Contributor

Re: Process per CPU

AFAIK, 'glance' is a HP-UX tool that is not available on Tru64.
Juan Canjura
Advisor

Re: Process per CPU

Hi all,

The thing is I just migrated to a new GS1280 server and I'm trying to monitor the CPU load with multiple tools (sar, collect, vmstat, top, etc) and I'm noticing a couple of CPUs with heavy load in comparisson of the other ones and was wondering how to trace which processes (specially user's process) are running on those 2 CPUs.

Is there any other way to do that, any idea is more than welcome.

Thanks

Juan
Ivan Ferreira
Honored Contributor

Re: Process per CPU

As Hein said, the -o psr option of the ps command will give you the processor number where the process is running, just grep the processors that you want.
Por que hacerlo dificil si es posible hacerlo facil? - Why do it the hard way, when you can do it the easy way?
Yogeeraj_1
Honored Contributor

Re: Process per CPU

hi Juan,

When you run top, you do get the required info

CPU TTY PID USERNAME PRI NI SIZE RES STATE TIME %WCPU %CPU COMMAND
0 ? 14616 ora10g 154 20 2059M 7408K sleep 0:19 7.99 7.98 oracle
1 ? 14692 ora10g 189 20 2058M 7992K run 0:49 7.49 7.48 oracle
1 ? 26710 ora10g 154 20 2058M 6700K sleep 0:06 5.48 5.47 oracle


In fact, the very first column is "CPU"

note also that one PID cannot be run on 2 or more CPUs concurrently.

If you are running Oracle you can further drill down on the processes at the application level.

hope this helps too!

kind regards
yogeeraj
No person was ever honoured for what he received. Honour has been the reward for what he gave (clavin coolidge)
Juan Canjura
Advisor

Re: Process per CPU

Hmm.. so maybe is my TOP version. I'm running "Top version 3.5.1" and when I run it I get the following (the CPU column is a CPU %):

load averages: 10.91, 7.49, 6.68 00:04:47
500 processes: 7 running, 1 waiting, 275 sleeping, 217 idle
CPU states: 30.3% user, 0.0% nice, 13.8% system, 55.8% idle
Memory: Real: 15G/20G act/tot Virtual: 69052M use/tot Free: 2729M

PID USERNAME PRI NICE SIZE RES STATE TIME CPU COMMAND
5340 oracle 44 0 5818M 14M run 4:36 88.80% oracle
5514 oracle 44 0 5807M 4431K sleep 0:34 5.10% oracle

If that's the case, which is the latest version ?

Thanks

Juan
Hein van den Heuvel
Honored Contributor

Re: Process per CPU

Oops, I must have been confused with more recent top versions on Linux or HPUX>
I do not see a processor comuln, or a way to get there, on a Tru64 box. Sorry to mislead you.

Just use ps -o and select the options you like, notably psr for the processor.

What problem(s) are you trying to solve?

Regards,
Hein.