how to bind a process to a CPU


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users how to bind a process to a CPU
# 1  
Old 03-03-2006
how to bind a process to a CPU

Hi all

please can any body please suggest me how to bind a process to a particular
CPU on unix machine.

i have a unix machine with 2 CPUs and i wanna have my process running on
CPU 0.

please suggest.
# 2  
Old 03-03-2006
if you are using solaris, you can read up on resource management to do that
# 3  
Old 03-03-2006
If you're on aix look for bindprocessor man pages
# 4  
Old 03-03-2006
Hi
thanks for the reply

i am on sunos see the o/p of uname

SunOS gnm029 5.8 Generic_117000-05 sun4u sparc SUNW,Sun-Fire-V440
# 5  
Old 03-03-2006
in solaris:

pbind -> for binding processes to one CPU

psrset -> creation and management of processor sets

i think you are looking for pbind (since you "only" have 2 CPUs).

get you process ids and use the following (bad example here, cause i have only one in my testmashine, but it still work Smilie ):

Code:
root@jumpy # psrinfo
0       on-line   since 01/27/2006 18:44:04
root@jumpy # pgrep cron
196
root@jumpy # pbind -b 0 196
process id 196: was not bound, now 0
root@jumpy # pbind -q
process id 196: 0
root@jumpy # pbind -u 196
process id 196: was 0, now not bound
root@jumpy #





greetings PRESSY

Last edited by pressy; 03-03-2006 at 10:20 AM..
# 6  
Old 03-03-2006
that was wonderful pressy thanq
# 7  
Old 03-05-2006
that is cool, pressy.
When do you use pbind & when do you use resource manager?
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Emergency UNIX and Linux Support

CPU and memory utilization of a process, by process name

Can someone please help me with a script that will help in identifying the CPU & memory usage by a process name, rather than a process id.This is to primarily analyze the consumption of resources, for performance tweaking. G (4 Replies)
Discussion started by: ggayathri
4 Replies

2. Solaris

process CPU time

We are using JAVA program and strange thing is it takes 100% CPU when not in use. The program function is to stream a file on output port (one direction). It checks one directory and when there is a file in it, starts. While it is streaming the CPU usage is normal, about 20%. But, if... (9 Replies)
Discussion started by: orange47
9 Replies

3. Shell Programming and Scripting

CPU Usage of a process

Hi guys, I am currently writing a JAVA script to monitor certain unix processes through JConsole. Upon having lots of trouble with runtime.exec, i decided to bypass the top/ps command call and just get the information straight from /proc/*pid*/whatever. Now i can pull back any... (0 Replies)
Discussion started by: matt9949
0 Replies

4. Red Hat

Process by CPU

Hello All, I am preparing a script to capture the processes consuming more CPU. So is there any way that i can sort & redirect to file only those processes consuming more than 5.0 % using ps command itself. Regards Ankit (3 Replies)
Discussion started by: ajaincv
3 Replies

5. Shell Programming and Scripting

Capturing the CPU% used by a process

Hi, I just wonder I need to write a script where I can check if a particular process is consuming X amount of CPU. I was thinking of using the ps command but doesn't seems to work. Any ideas. Thanks. (2 Replies)
Discussion started by: arizah
2 Replies

6. Solaris

Bind hang up when process is reaching to 500 Mb, Solaris 10u8, Sun T5140

Hi all, I use latest bind 9.6.1, brand-new T5140 Sun Server, 10u8 Solaris OS, Mar-2010 OS patch to configure a caching dns server. But bind always hang up when process/cache is reaching to 500 Mb ( Though 'prstat -a' check ) Can anyone help me a solution for this problem, i will greatly... (0 Replies)
Discussion started by: tien86
0 Replies

7. UNIX for Dummies Questions & Answers

how to get persistant cpu utilization values per process per cpu in linux (! top,ps)

hi, i want to know cpu utilizatiion per process per cpu..for single processor also if multicore in linux ..to use these values in shell script to kill processes exceeding cpu utilization.ps (pcpu) command does not give exact values..top does not give persistant values..psstat,vmstat..does njot... (3 Replies)
Discussion started by: pankajd
3 Replies

8. UNIX for Advanced & Expert Users

How to bind interrupts on a specific CPU

Hello, we practise our server with operating system ReliantUNIX 5.45 and we are using Informix Dynamic Server 7.31. I ascertained a lot of cpu interrupts per second (int/s). The count of int/s exceeds critical maximum value considerably. Machine specific notes for Informix Dynamic Server... (1 Reply)
Discussion started by: urbale
1 Replies

9. UNIX for Dummies Questions & Answers

process not using enough cpu

I am running solaris 9 on a SUn 480r. It is running SAS statistical software, these processes in full flow normally run at about 50-60% cpu (theres nothing else really running on the box) this is fine, and the SAS jobs get run nice and quick. However over the last few weeks everytime a SAS job is... (1 Reply)
Discussion started by: hcclnoodles
1 Replies

10. UNIX for Advanced & Expert Users

process -> 1 cpu

Is there a way I can assign processes to different processors? I know in windows xp you can set process affinity, and wondered if there is a *nix equivelant. (2 Replies)
Discussion started by: Solitare
2 Replies
Login or Register to Ask a Question