LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - General
User Name
Password
Linux - General This Linux forum is for general Linux questions and discussion.
If it is Linux Related and doesn't seem to fit in any other forum then this is the place.

Notices

Reply
 
Search this Thread
Old 03-30-2005, 10:59 PM   #1
cdegroat
LQ Newbie
 
Registered: Mar 2005
Posts: 13

Rep: Reputation: 0
Multiple CPUs?


Im running a dual xeon 2.8ghz with 2gb ram and FC2. Here's my dilemma, im new to linux to go easy on me . Im running a game server hosting company and I've found out that the game server im running doesnt use multiple cpus. Is there a way to choose which cpu to run on during process execution? The game is counter strike source and counter strike. I feel im paying for extra for a server that I see as a waste because an extra CPU isn't really being used for what I need it for. Any help is appreciated.
 
Old 03-30-2005, 11:24 PM   #2
btmiller
Senior Member
 
Registered: May 2004
Location: In the DC 'burbs
Distribution: Arch, Scientific Linux, Debian, Ubuntu
Posts: 4,143

Rep: Reputation: 322Reputation: 322Reputation: 322Reputation: 322
If the game server wasn't written to be multi-threaded (i.e. more than one execution flow going at once) then no, there's really nothing you can do. Many servers will fork off copies of themselves to handle clients, and these multiple servers will be balanced accross the CPU. This can also be accomplished with threads, which is probably the more likely mechanism for a game server that has to keep a lot of state information.

Have you used top to verify that only one CPU is being loaded?
 
Old 03-31-2005, 01:29 AM   #3
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 961

Rep: Reputation: 51
Re: Multiple CPUs?

Quote:
I feel im paying for extra for a server that I see as a waste because an extra CPU isn't really being used for what I need it for.
What makes you think that second CPU is just sitting there?

What btmiller suggested will help see which CPUs are being used but I'm pretty sure that it doesn't normally show that information. When you start "top", press "f". This bring up a list of all the parameters you can have "top" display. Make sure the "J" option is selected; It'll have an asterisk next to it if it is. (It'll also be uppercase ("J") instead of lowercase ("j").) Then press any key to return to the process display. (Then press "w" if you're satisfied with the sort of information you're seeing; that'll save the configuration for the next time you fire up "top") You should see that processes have been using both processors. You're going to see smoother performance on your system with that second CPU. The other processes that Linux needs to run are less likely to interfere with your game service. Your game service process may switch processors from time to time. This is normal.

Bottom line is that you're right in that you're not getting the nearly 2X performance you might have seen if the game server software was "SMP aware". On the other hand that second CPU allows the rest of the OS functions to run without unduly interrupting the game service. Personally, I wouldn't worry much about having wasted money on the second processor. Now if you'd bought a quad CPU system...

BTW, If you do not see that both processors are being used, make sure your running kernel has SMP support.

Good luck and have fun. (Sounds like your users will anyway)
 
Old 03-31-2005, 06:38 AM   #4
cdegroat
LQ Newbie
 
Registered: Mar 2005
Posts: 13

Original Poster
Rep: Reputation: 0
thanks for the tips. Im still kinda new to linux here. Thanks for all your help. I see last CPUs being used as 0, 1, 2, & 3. If im correct, it should be because the Xeons have hyperthreading, which mean its a dual core CPU so it would act as if theirs 4 CPUs even though theirs only 2. If so, I am seeing the game server change between the 4. Possibly to balance the load Id assume. I guess it's working after all. Thanks! One last question, if I raised CPU Priority on our servers, how would this affect them? For instance if I had 12 player, less priority servers vs our 32 player ones, would It be ideal to lower CPU Priority for the 12's and raise it for the 32's? Thanks for the help again!

Last edited by cdegroat; 03-31-2005 at 06:46 AM.
 
Old 03-31-2005, 06:41 AM   #5
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 12,445

Rep: Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068Reputation: 1068
Open a terminal and enter
Code:
uname -a
 
Old 04-02-2005, 12:25 AM   #6
rnturn
Member
 
Registered: Jan 2003
Location: Illinois (Chicago area)
Distribution: Red Hat (8.0), SuSE (10.x, 11.x, 12.2), Solaris (8-10), Tru64
Posts: 961

Rep: Reputation: 51
Quote:
If so, I am seeing the game server change between the 4. Possibly to balance the load Id assume.
What's likely going on is that your game service is running on CPU4 and decides to do some sort of I/O. That's going to take a while so the OS gives the CPU to some other waiting process that's in a runnable state. When the I/O activity that the game service was waiting for has completed, the OS sez: "OK, this game service is ready to run again. What CPU is available? CPU2? OK, CPU2 here ya go.".

There's an old analogy that I saw at a DECUS symposium years ago about CPU scheduling. It was hilariously illustrated with a slide show with a bunch of hamsters and described how the OS made sure they all got their turn to run on the wheel. In your case, there are four wheels to choose from.
 
Old 04-02-2005, 01:31 AM   #7
Thaidog
Member
 
Registered: Sep 2002
Location: Hilton Head, SC
Distribution: Gentoo
Posts: 616

Rep: Reputation: 32
Quote:
Originally posted by cdegroat
thanks for the tips. Im still kinda new to linux here. Thanks for all your help. I see last CPUs being used as 0, 1, 2, & 3. If im correct, it should be because the Xeons have hyperthreading, which mean its a dual core CPU so it would act as if theirs 4 CPUs even though theirs only 2.
It's not dual core... it's SMT. Basically a single core processor that can run mutliple threads simultaneously.. in this case 2... this makes it *look* like 2 cpu's per one physical core. SMT = Symmetric Multi Threading = Intel Brand Version = HT

Last edited by Thaidog; 04-02-2005 at 01:45 AM.
 
  


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 On
HTML code is Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
CPUs totallynewguy Linux - Hardware 3 08-29-2005 11:06 PM
Any good thread programming theory (for multiple cpus) book/tutorial karlan Programming 3 10-05-2004 12:48 AM
Via CPUs 3dmike Linux - Hardware 2 03-22-2004 01:39 PM
2 CPUs jhirshon Linux - Newbie 2 01-31-2004 06:59 PM
What CPUs does everyone use? Guru3 Linux - Hardware 43 01-22-2004 11:15 AM


All times are GMT -5. The time now is 05:04 PM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration