?
Solved

Solaris CPU loads setup

Posted on 2000-03-23
4
Medium Priority
?
917 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
4 Comments
 
LVL 1

Accepted Solution

by:
dserna earned 240 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Hello fellow BSD lovers, I've created a patch process for patching openjdk6 for BSD (FreeBSD specifically), although I tried to keep all BSD versions in mind when creating my patch. Welcome to OpenJDK6 on BSD First let me start with a little …
Java performance on Solaris - Managing CPUs There are various resource controls in operating system which directly/indirectly influence the performance of application. one of the most important resource controls is "CPU".   In a multithreaded…
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…
In a previous video, we went over how to export a DynamoDB table into Amazon S3.  In this video, we show how to load the export from S3 into a DynamoDB table.
Suggested Courses

777 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