Operating System - HP-UX
1827757 Members
3027 Online
109969 Solutions
New Discussion

Re: cpu-switching on multi-cpu host

 
SOLVED
Go to solution
Timo J
Frequent Advisor

cpu-switching on multi-cpu host

We have four service processes running on four-cpu host (rp-series). 3 of these 4 are running on same cpu all the time. Even if the processor load increases near 100% the processes stay on that same cpu while all the other cpus are in practice idling. How can we balance this load to all processors? Or at least to 2-3 processors?

Is it possible to 'lock' some certain process to some certain processor?
N/A
7 REPLIES 7
T G Manikandan
Honored Contributor
Solution

Re: cpu-switching on multi-cpu host

Sunil Sharma_1
Honored Contributor

Re: cpu-switching on multi-cpu host

Hi,

You can use hp PRM (Process Resource Manager)to do this.

but it's surprising to hear that one CPU is used about 100% and other are idle. infact in HP UX kernel will take care of this and i naver saw behaviour like this ...

SUnil
*** Dream as if you'll live forever. Live as if you'll die today ***
T G Manikandan
Honored Contributor

Re: cpu-switching on multi-cpu host

Using PRM one can assign some percentage of CPU to specific processors.It does not lock certain processes to specific CPU.

One can write programs to do that.

check my above link where Bill has an example of that.



Thanks
Dietmar Konermann
Honored Contributor

Re: cpu-switching on multi-cpu host

The HPUX scheduler is designed to do this kind of balancing automatically. PRM is not necessary for this.

Please provide more information....

- What OS revision

- Is always the same CPU loaded? Is it CPU0?

- What means "near 100%"
... maybe balancing is not needed at all?

It is possible (but usually not needed!) to "lock" a process to a CPU using the mpctl() syscall. Beginning with 11.11 you have the mpsched(1) command.

Best regards...
Dietmar.
"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)
John Bolene
Honored Contributor

Re: cpu-switching on multi-cpu host

HPUX normally manages this if it thinks there is a better assignment for the processes.

So the processes must be running fine on the single processor.

It would be nice to know what OS.

I have seen some anomalies with 11.11 in that a process that takes 100% of a cpu will be shifted between different idle cpus and will not stick to a single cpu. This causes a slower running process because of the switching. This did not happen with 10.20
It is always a good day when you are launching rockets! http://tripolioklahoma.org, Mostly Missiles http://mostlymissiles.com
Timo J
Frequent Advisor

Re: cpu-switching on multi-cpu host

OS revision is 11.00.
And the CPU I'm talking is CPU3. (At least, during nighttime when there is very small load per service process, those three processes are running on CPU3).

We started wondering this issue, because one night, one minute after the scheduled backup started, one of our service processes died. At least it _looked_ so obvious that the service process died for some resource problem with the backup.

About the need of the load balancing; I was thinking like Dietmar said but I wasn't just sure; looks like there's no real need to load balancing after all because the load on that one cpu stays between 90-96% during that backup.

It just looks strange that one processor does all the work while the others are idling.

Attachment file contains one snapshot of top output during backup. And if we look the average cpu percentage, everything looks ok.

So, summa summarum; can I trust that the operating system handles perfectly load balancing between cpus when needed without interfering any user processes or do I had to question the functionality of multi-cpu-system ;)
N/A
Dietmar Konermann
Honored Contributor

Re: cpu-switching on multi-cpu host

Mikko,

I asked for OS and CPU# because there was is a really old streams pty issue that binds threads accidently to the monarch COU, which is mostly #0 (patched with PHNE_19616 or later). This is obviously not your problem though.

I think you should trust the scheduler.

However, you may try to lock the processes to different CPUs and see if performance increases. I attached a simple program that can be used for this.

Compile it:
# cc -o mpctl mpctl.c

Bind, e.g. PID 500 to CPU 3:
# ./mpctl 3 500

Unbind it again:
# ./mpctl -1 500

Best regards...
Dietmar.

"Logic is the beginning of wisdom; not the end." -- Spock (Star Trek VI: The Undiscovered Country)