Solved

Solaris CPU loads setup

Posted on 2000-03-23
4
904 Views
Last Modified: 2013-12-27
Hi, Experts

Could you provide some info on

How can I setup CPU loads on different CPU.
I means threads setup, process distribution to CPU


supposing I have 4 CPU in the machine.

thanx
0
Comment
Question by:clemend
4 Comments
 
LVL 1

Accepted Solution

by:
dserna earned 80 total points
ID: 2650359
If I understand you correctly, you want to have the capability to assign certain processes, and all of their threads to a certain processor in a multi-processor machine? In that case, there is a command in Solaris which will let you do this, "/usr/sbin/pbind"

pbind works like this. First you have to know what the processor names are in your system. For example on an e-450:

foo:~$ psrinfo -v
Status of processor 0 as of: 03/23/00 09:57:07
  Processor has been on-line since 03/07/00 10:59:42.
  The sparc processor operates at 296 MHz,
        and has a sparc floating point processor.
Status of processor 1 as of: 03/23/00 09:57:07
  Processor has been on-line since 03/07/00 10:59:43.
  The sparc processor operates at 296 MHz,
        and has a sparc floating point processor.
Status of processor 2 as of: 03/23/00 09:57:07
  Processor has been on-line since 03/07/00 10:59:43.
  The sparc processor operates at 296 MHz,
        and has a sparc floating point processor.
Status of processor 3 as of: 03/23/00 09:57:07
  Processor has been on-line since 03/07/00 10:59:43.
  The sparc processor operates at 296 MHz,
        and has a sparc floating point processor.


So we have 4 processors in that machine known as 0,1,2,3 and all are on line. Say we want to bind a process to CPU3, this is the way we would do it:

(as root)


foo:~$ ps -aef | grep bash
foouser  3558  3555  0 09:57:03 pts/0    0:00 -bash

In this example, I want to bind my bash process to cpu3, the resulting pbind command would be:

foo:~#pbind -b 3 3558

3 is the processor I an targetting and 3558 is the pid of the process that I am binding to CPU 3. Once I do that, any new processes, threads, etc. that get spawned from that process will run on that processor, bindings are inherited. To check to see if the process is bound to a processor, you would do:

 foo:~#pbind -q 3558
process id 3558: 3

The output above means that process 3558 and all of it's threads are bound to CPU3. To unbind a process from a CPU, you would just do:

foo:~#pbind -u 3558

Once you do that, the process will no longer be bound to CPU3 and it will run on any available CPU afterwards.

Hope that helps.
0
 
LVL 2

Expert Comment

by:jonke
ID: 2650393
What exactly are you trying to do and what OS are you using? CPU load distribution is done automatically by the OS, and shared more or less equally by all cpu's. In Solaris you can use the command

#mpstat

to get cpu statistic information. This will be the most efficient way for multiple apps to run on your machine. The idea that kernel tuning will greatly improve the performance of your machine is a bit of a myth really. It made sense in the old days of free unix distribution and the like- but a modern os like Solaris 2 for example, is designed to self-automate the tuning process. It adaptively scales according to the hardware capabilities and the workload that it is running.

For afinity control, use pbind to bind processes to a particular processor.  This does not mean that will be the only process to run
on that CPU, only that the process will only run on that CPU.

    Other commands of interest:

    psrinfo - print processor information

    psradm - set processors online or offline
0
 
LVL 5

Expert Comment

by:ianB
ID: 2855620
We have opened up a new Solaris Topic Area.  

To increase the visibility of questions, we moved questions we felt
appropriate to the new Solaris Topic Area where they will be easier for
Solaris experts to find and answer. You may view your question at
http://www.experts-exchange.com/Computers/Operating_Systems/Solaris/

If you have any questions about the new topic area you can contact
Community Support by posting a comment at the following URL or by
emailing us at cs@experts-exchange.com.
http://www.experts-exchange.com/Customer_Service/Experts_Exchange/

Ian
Community Support @ Experts Exchange

0
 

Expert Comment

by:Gurinders
ID: 21574589
zone not found for this new Solaris Topic Area.
0

Featured Post

What Is Threat Intelligence?

Threat intelligence is often discussed, but rarely understood. Starting with a precise definition, along with clear business goals, is essential.

Join & Write a Comment

This tech tip describes how to install the Solaris Operating System from a tape backup that was created using the Solaris flash archive utility. I have used this procedure on the Solaris 8 and 9 OS, and it shoudl also work well on the Solaris 10 rel…
Introduction Regular patching is part of a system administrator's tasks. However, many patches require that the system be in single-user mode before they can be installed. A cluster patch in particular can take quite a while to apply if the machine…
Learn several ways to interact with files and get file information from the bash shell. ls lists the contents of a directory: Using the -a flag displays hidden files: Using the -l flag formats the output in a long list: The file command gives us mor…
Learn how to get help with Linux/Unix bash shell commands. Use help to read help documents for built in bash shell commands.: Use man to interface with the online reference manuals for shell commands.: Use man to search man pages for unknown command…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

16 Experts available now in Live!

Get 1:1 Help Now