cancel
Showing results for 
Search instead for 
Did you mean: 

CPU on which a process runs

 
SOLVED
Go to solution
Highlighted
Frequent Advisor

CPU on which a process runs

I have a Rx7620 server running HP-UX 11.23.

In the server there are 6 CPUs.

A process that runs in the server is supposed to be run on a single process, so its bound to the CPU number 5.

This process started to give trouble recently, so I want to check weather it runs on multiple CPUs.

Any idea how to do this?

Thanks and Regards
10 REPLIES 10
Highlighted
Honored Contributor

Re: CPU on which a process runs

You can check the process with glance.

glance -g
press F6 and select or type the process ID no., Enter

Look for CPU info (Running CPU, etc).

Regards.
Highlighted
Honored Contributor

Re: CPU on which a process runs

Highlighted
Frequent Advisor

Re: CPU on which a process runs

Thanks guys,

I don't have glance at the moment.

So is there any other way to check weather it runs on multiple processes?

Thanks and Regards
Highlighted
Honored Contributor

Re: CPU on which a process runs

Try
top -h

Do you have caliper.

Regards.
Highlighted
Honored Contributor

Re: CPU on which a process runs

you can check with command

#export UNIX95=1;ps -ef -o comm,pcpu,vsz,args | grep
a warrior never quits
Highlighted
Acclaimed Contributor

Re: CPU on which a process runs

>A process that runs in the server is supposed to be run on a single process, so its bound to the CPU number 5.

Why do you think you need to limit it? Does it use several Gb of memory? You have already experimented with it using psrset(1M) and it works better?

>This process started to give trouble recently

What type of trouble? Performance?

>I want to check whether it runs on multiple CPUs.

If you use threading, you want multiple CPUs.

>ahsan: #export UNIX95=1;ps -ef ... | grep

You don't want to export UNIX95, just set it for one command:
UNIX95=1 ps -ef -o comm,pcpu,vsz,args -C
Highlighted
Honored Contributor

Re: CPU on which a process runs

Subentu is looking to find the CPU number for the process.

pcpu with UNIX95 would give the CPU percentage.

I tried it before with just cpu option, but was not sure whether I can rely on it. That is why did not give that info to him.

UNIX95=1 ps -ef -o comm,pid,cpu,vsz,args |grep 15540

UNIX95=1 ps -ef -o comm,pid,cpu,vsz,args |more

Comparing the result with glance -R (Process Resources) does not give the correct result.
Highlighted
Honored Contributor
Solution

Re: CPU on which a process runs

top will tell you the CPU a process was using. I say 'was using' because unless your program was setup to truly 'bind' to a single processor, it will bounce around. This is normal and there is ZERO overhead for changing processors. Actually, when a process is ready to run (for instance, after completing an I/O), the next processor is selected. Processes do not 'move' but are simply give the appropriate register contents and program counter, and the process runs. This scenario is the same even if the process is truly bound to a single processor.

NOTE: Unless a process was written for multi-threaded operation, it will never use more than one processor at a time.


Bill Hassell, sysadmin
Highlighted
Acclaimed Contributor

Re: CPU on which a process runs

>Bill: This is normal and there is ZERO overhead for changing processors.

You are confused. Depending on the type of the machine and application, there could be massive overhead. First there is the cache, if it hasn't already been flushed out due to other processes. But the most important issue is with cell based memory, which could cause access time issues if the new processor isn't in the same cell.