LinuxQuestions.org
Help answer threads with 0 replies.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Server
User Name
Password
Linux - Server This forum is for the discussion of Linux Software used in a server related context.

Notices


Reply
  Search this Thread
Old 04-14-2007, 07:30 PM   #1
hugle
LQ Newbie
 
Registered: Jul 2004
Posts: 13

Rep: Reputation: 0
only 2 of 4 CPUs are working. What I'm doing wrong ?


Hello everyone!

I have purchased Intel(R) Xeon(R) CPU E5345 @ 2.33GHz (quad core)

Almost everything works well.
I can see 4 CPUs, but see whats happening:
Quote:
Tasks: 55 total, 1 running, 54 sleeping, 0 stopped, 0 zombie
Cpu0 : 0.0%us, 0.0%sy, 0.0%ni, 87.1%id, 0.0%wa, 0.7%hi, 12.2%si, 0.0%st
Cpu1 : 0.0%us, 0.0%sy, 0.0%ni, 86.0%id, 0.0%wa, 0.7%hi, 13.3%si, 0.0%st
Cpu2 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Cpu3 : 0.0%us, 0.0%sy, 0.0%ni,100.0%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
Mem: 2071816k total, 183684k used, 1888132k free, 8424k buffers
Swap: 1975984k total, 0k used, 1975984k free, 81284k cached
CPU#2 and CPU#3 are idle, but If I try to run ./some_script they are being used.

What the PC does it is a shaping machine which serves around 150mbit link and does
per IP shaping. At peak times CPU#0 and CPU#1 are 50% idle, but CPU#2 and CPU#3
aren't in use.

What I could be doing wrong ? Maybe I have missed something ?
I'm running kernel 2.6.20.6 with no patches.

I can post more info, if needed.

Thanks in advance Linux community,
Keraj
 
Old 04-14-2007, 07:37 PM   #2
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
I'm not sure what you are expecting to see. Your system is idle, with only one running task. What do you think the CPUs should be doing in that case?

How many running processes were there when "CPU#0 and CPU#1 are 50% idle, but CPU#2 and CPU#3 aren't in use"? Unless there are more than two runnable processes, only two CPUs will be used (processes cannot be "split" across CPUs).
 
Old 04-14-2007, 09:06 PM   #3
syg00
LQ Veteran
 
Registered: Aug 2003
Location: Australia
Distribution: Lots ...
Posts: 21,125

Rep: Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120Reputation: 4120
Personally, I'd *love* to have this problem ...
You'd need a lot more evidence to say there is actually a (real) problem here. It is possible for code to use CPU affinity (for multiple tasks), but not likely if it's generic code.
 
Old 04-15-2007, 02:57 AM   #4
hugle
LQ Newbie
 
Registered: Jul 2004
Posts: 13

Original Poster
Rep: Reputation: 0
Quote:
Originally Posted by macemoneta
I'm not sure what you are expecting to see. Your system is idle, with only one running task. What do you think the CPUs should be doing in that case?

How many running processes were there when "CPU#0 and CPU#1 are 50% idle, but CPU#2 and CPU#3 aren't in use"? Unless there are more than two runnable processes, only two CPUs will be used (processes cannot be "split" across CPUs).
Hi, thanks for the tips.

so it is something like CPU#0 is used for inbound and CPU#1 is used for outbound ?



Quote:
Personally, I'd *love* to have this problem ...
You'd need a lot more evidence to say there is actually a (real) problem here. It is possible for code to use CPU affinity (for multiple tasks), but not likely if it's generic code.
So i need tosearch for patches somewhere on the net or write my own ?




Since I use in-kernel tc for traffic shaping, is it possible to tell tc to use for example CPU#3 ?


Thanks guys for help, really helpful,
Keraj
 
Old 04-15-2007, 03:22 AM   #5
hugle
LQ Newbie
 
Registered: Jul 2004
Posts: 13

Original Poster
Rep: Reputation: 0
As I understood, if i am routing the packets and I have eth0 + eth1 (for routing). the routing uses interrupts so those interrupts are handled as is:
eth0 <> cpu0 and eth1 <> cpu1 and if I *somehow* find a place for eth2 then CPU#2 would start to work and I'd have only CPU#3 in idle.

Thanks.
 
Old 04-15-2007, 11:49 AM   #6
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
You are not understanding Linux scheduling and dispatching. It has nothing to do with application-level function; processes that are runnable (in need of CPU resources) are allocated to an available processor (with some limitations for performance).

If you have a thousand idle processes, but only two processes that need CPU resources, only two CPUs will be used. The rest remain in queue, not runnable.
 
Old 04-16-2007, 10:31 AM   #7
Matir
LQ Guru
 
Registered: Nov 2004
Location: San Jose, CA
Distribution: Debian, Arch
Posts: 8,507

Rep: Reputation: 128Reputation: 128
Unless the load on any core exceeds 100%, you would see no performance boost by further distributing the load. In fact, due to caching mechanisms, you would likely see a decrease in performance. In order to use 4 cores, you need 4 threads running simultaneously. That being said, there are a LOT of threads on the system, they just may not be active when you are looking.
 
Old 04-16-2007, 03:57 PM   #8
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Rep: Reputation: 15
Okay, this is a bit related but not quite on track. I'm confused. I have no idea what the specs on my server are. cpuinfo reads four processors so I assumed that I had four. Now, when this thread listed his top I got worried. My top does not display multiple processors. Is there any way to be sure without taking the thing apart?

Here's my top:

Code:
top - 16:51:18 up 11 days,  3:01,  2 users,  load average: 1.05, 1.06, 1.08
Tasks: 205 total,   1 running, 204 sleeping,   0 stopped,   0 zombie
Cpu(s):  0.7% us,  0.2% sy,  0.0% ni, 74.1% id, 24.9% wa,  0.0% hi,  0.2% si
Mem:   1034428k total,   543428k used,   491000k free,    28832k buffers
Swap:  2031608k total,   223864k used,  1807744k free,   276556k cached
Here's my cpuinfo:

Code:
[root@ws254 ~]# cat /proc/cpuinfo
processor       : 0
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 2.80GHz
stepping        : 1
cpu MHz         : 2793.643
cache size      : 1024 KB
physical id     : 0
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm
 pni monitor ds_cpl cid cx16 xtpr
bogomips        : 5537.79

processor       : 1
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 2.80GHz
stepping        : 1
cpu MHz         : 2793.643
cache size      : 1024 KB
physical id     : 0
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm
 pni monitor ds_cpl cid cx16 xtpr
bogomips        : 5586.94

processor       : 2
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 2.80GHz
stepping        : 1
cpu MHz         : 2793.643
cache size      : 1024 KB
physical id     : 3
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm
 pni monitor ds_cpl cid cx16 xtpr
bogomips        : 5570.56

processor       : 3
vendor_id       : GenuineIntel
cpu family      : 15
model           : 4
model name      : Intel(R) Xeon(TM) CPU 2.80GHz
stepping        : 1
cpu MHz         : 2793.643
cache size      : 1024 KB
physical id     : 3
siblings        : 2
fdiv_bug        : no
hlt_bug         : no
f00f_bug        : no
coma_bug        : no
fpu             : yes
fpu_exception   : yes
cpuid level     : 5
wp              : yes
flags           : fpu vme de pse tsc msr pae mce cx8 apic sep mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe nx lm
 pni monitor ds_cpl cid cx16 xtpr
bogomips        : 5570.56
 
Old 04-16-2007, 04:17 PM   #9
macemoneta
Senior Member
 
Registered: Jan 2005
Location: Manalapan, NJ
Distribution: Fedora x86 and x86_64, Debian PPC and ARM, Android
Posts: 4,593
Blog Entries: 2

Rep: Reputation: 344Reputation: 344Reputation: 344Reputation: 344
From 'man top':

Quote:
´1´ :Toggle_Single/Separate_Cpu_States -- On/Off
This command affects how the ’t’ command’s Cpu States portion is
shown. Although this toggle exists primarily to serve mas-
sively-parallel SMP machines, it is not restricted to solely SMP
environments.

When you see ’Cpu(s):’ in the summary area, the ’1’ toggle is On
and all cpu information is gathered in a single line. Other-
wise, each cpu is displayed separately as: ’Cpu0, Cpu1, ...’
 
Old 04-17-2007, 08:53 AM   #10
mcupples
Member
 
Registered: Jun 2006
Location: Orlando
Distribution: FC3, FC5, CentOS4, Ubuntu 6.06
Posts: 57

Rep: Reputation: 15
rawr. eventually i'll read the man pages. when they stop being so damned easy to get to.
 
  


Reply



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
Kdevolop relative path working wrong jaysags Programming 1 11-20-2006 10:50 PM
Catting files together is not working, what am I doing wrong? BajaNick Linux - General 5 02-13-2005 05:33 PM
LimeWire not working im sure javas installed whats wrong? usernameddr Mandriva 12 01-24-2005 07:30 AM
9.1; mouse not working. kvm? wrong configuration? Palagasr Slackware 11 05-27-2004 02:10 PM
GF4 170A TV OUT not working correctly - wrong freq. AndrewMSConvert Linux - Hardware 1 04-13-2004 05:07 AM

LinuxQuestions.org > Forums > Linux Forums > Linux - Server

All times are GMT -5. The time now is 09:41 PM.

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