LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games
User Name
Password
Linux - Games This forum is for all discussion relating to gaming in Linux.

Notices


Reply
  Search this Thread
Old 01-09-2008, 12:42 AM   #1
CosmicDebris
LQ Newbie
 
Registered: Dec 2007
Location: CA USA
Distribution: fedora,5,6 & winblows
Posts: 2

Rep: Reputation: 0
Question cpu affinity process hlds multiple


Hi all, I did a search for info on this subject to no avail. So here i am asking for your expertise on this matter.

I have a dual xeon 3Gig CPU rig on fedora core 6 and i'm trying to run two 32 slot Dayofdefeat servers with one on each CPU. Can anyone shed any light on how i would go about setting the affinity for each HLDs process.

Do i use taskset and if so how.
The reason i'm asking how is because i have just started to learn the shell and i dont want to screw anything up too badly.
I would greatly appreciate any and all help on this matter.

I'm not that knowledgeable about linux but i know HLDS like the back of my hand, So if anyone needs any help setting up servers dont hesitate to ask or PM me.

Thanks for such an informative site.

Last edited by CosmicDebris; 01-09-2008 at 12:55 AM.
 
Old 01-09-2008, 11:46 AM   #2
osor
HCL Maintainer
 
Registered: Jan 2006
Distribution: (H)LFS, Gentoo
Posts: 2,450

Rep: Reputation: 79
Quote:
Originally Posted by CosmicDebris View Post
Hi all, I did a search for info on this subject to no avail. So here i am asking for your expertise on this matter.
I presume you’ve found the manpage for taskset (type “man taskset” into a terminal).

Quote:
Originally Posted by CosmicDebris View Post
I have a dual xeon 3Gig CPU rig on fedora core 6 and i'm trying to run two 32 slot Dayofdefeat servers with one on each CPU. Can anyone shed any light on how i would go about setting the affinity for each HLDs process.

Do i use taskset and if so how.
So you have two cpus (which I will call cpu0 and cpu1). Any process that has affinity for only cpu0 will have a mask value of 1. Any process that has affinity for only cpu1 will have a mask value of 2. Any process that has affinity for both cpus will have mask value 3. And it’s just that simple.

You can use taskset to set the affinity for an already-running process (by its PID) or set the affinity with which to launch a process (by specifying the command and its arguments).

Btw, is there any particular reason you need to alter cpu affinities? The linux scheduler does a pretty good job of using all resources efficiently. Anyway, if you want something a little more sophisticated than cpu affinity (e.g., ability to control memory mappings, etc.) you could always check out cpusets.
 
Old 01-09-2008, 01:55 PM   #3
CosmicDebris
LQ Newbie
 
Registered: Dec 2007
Location: CA USA
Distribution: fedora,5,6 & winblows
Posts: 2

Original Poster
Rep: Reputation: 0
I just wanted to see if i could get as much performance out of the box that i can but i am seeing that fedora does do a pretty good job of managing resources. Thanks very much for that info, I'll add it to my memory banks and i'll post back if i see any benefit of setting the cpu affinity.

[EDIT] Ok i found this just for info.

to set affinity, use the "taskset" program that comes with schedutils.

examples:
/usr/bin/taskset -p 01 9381 << pid
/usr/bin/taskset -p 02 132 << pid
/usr/bin/taskset -p 03 3049 << pid

first line tells kernel to run process #9381 (this is the pid you get in ps) on the first cpu. second line tells kernel to run process #132 on the second cpu.
third line, tells the kernel to run process #3049 on both cpus (3=1+2, bitwise)

ie. if you have a quad box and you want to run process 85 on the third cpu. /usr/bin/taskset -p 04 85 would do it. or, to run it on cpus 1 and 4, i'd use -p 09.

Last edited by CosmicDebris; 01-09-2008 at 02:00 PM.
 
  


Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
CPU affinity on kernel 2.4.14-SMP tsik Linux - Kernel 0 11-05-2007 09:27 PM
Per-process %CPU Utilization first_linux Linux - General 3 06-01-2007 11:53 AM
Process System cpu rajesht Linux - General 1 05-19-2005 09:16 AM
Switching off a CPU of a multiple CPU machine kravisudhakar Linux - General 1 12-26-2003 10:13 AM
Processor affinity and cpu scheduling...? Thaidog Linux - Newbie 5 01-09-2003 07:08 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Software > Linux - Games

All times are GMT -5. The time now is 11:38 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration