Solved

Solaris CPU loads setup

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Help stop mail server from sending spam. 27 122
How to clone solaris 10 machine 33 111
Solaris 4.1.3 cloning and booting 13 71
Martian Packets Unix 5 30
Installing FreeBSD… FreeBSD is a darling of an operating system. The stability and usability make it a clear choice for servers and desktops (for the cunning). Savvy?  The Ports collection makes available every popular FOSS application and packag…
Every server (virtual or physical) needs a console: and the console can be provided through hardware directly connected, software for remote connections, local connections, through a KVM, etc. This document explains the different types of consol…
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…
Learn how to find files with the shell using the find and locate commands. Use locate to find a needle in a haystack.: With locate, check if the file still exists.: Use find to get the actual location of the file.:

919 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

18 Experts available now in Live!

Get 1:1 Help Now