Solved

Solaris CPU loads setup

Posted on 2000-03-23
4
909 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

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

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…
Using libpcap/Jpcap to capture and send packets on Solaris version (10/11) Library used: 1.      Libpcap (http://www.tcpdump.org) Version 1.2 2.      Jpcap(http://netresearch.ics.uci.edu/kfujii/Jpcap/doc/index.html) Version 0.6 Prerequisite: 1.      GCC …
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 navigate the file tree with the shell. Use pwd to print the current working directory: Use ls to list a directory's contents: Use cd to change to a new directory: Use wildcards instead of typing out long directory names: Use ../ to move…

773 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