LinuxQuestions.org
Download your favorite Linux distribution at LQ ISO.
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie
User Name
Password
Linux - Newbie This Linux forum is for members that are new to Linux.
Just starting out and have a question? If it is not in the man pages or the how-to's this is the place!

Notices


Reply
  Search this Thread
Old 06-08-2012, 08:28 AM   #1
lusine
LQ Newbie
 
Registered: Feb 2009
Posts: 2

Rep: Reputation: 0
How-to determine the number of physical CPUs


Hi

Few days ago i had problems with one of my sites, which use too much CPU.
Typing "TOP" i got that mysqld use 200-400 %CPU.

As i cann't find the real reason, i move it to another host - where it work well without any problem.

Now, when on previous host everying is well i check that mysql %CPU is fine, but TIME+ digits usually are very high - like in this example.

Can anybody explain what this mean "137:31.72"

PHP Code:
 PID USER      PR  NI  VIRT  RES  SHR S %CPU %MEM    TIME+  COMMAND
 8927 apache    20   0 36228  14m 5016 S  4.7  0.7   0
:11.32 httpd
 1771 mysql     20   0 53172  31m 4340 S  0.7  1.5 137
:31.72 mysqld 
Also, as i understand on previous host there are 4 processores, and 2 cores

grep "core id" /proc/cpuinfo


PHP Code:
[root@www ~]# grep "core id" /proc/cpuinfo
core id         0
core id         
0
core id         
1
core id         

but cann't understand how many cores are on new host (with 8 processors)

PHP Code:
[root@host ~]# cat /proc/cpuinfo
processor       0
vendor_id       
GenuineIntel
cpu family      
6
model           
23
model name      
Intel(RXeon(RCPU           L5420  2.50GHz
stepping        
10
cpu MHz         
2499.994
cache size      
6144 KB
fdiv_bug        
no
hlt_bug         
no
f00f_bug        
no
coma_bug        
no
fpu             
yes
fpu_exception   
yes
cpuid level     
13
wp              
yes
flags           
fpu tsc msr pae cx8 apic cmov pat clflush acpi mmx fxsr sse sse2 ss ht nx constant_tsc pni vmx est ssse3 sse4_1
bogomips        
6258.29

processor       
1
vendor_id       
GenuineIntel
cpu family      
6
model           
23
model name      
Intel(RXeon(RCPU           L5420  2.50GHz
stepping        
10
cpu MHz         
2499.994
cache size      
6144 KB
fdiv_bug        
no
hlt_bug         
no
f00f_bug        
no
coma_bug        
no
fpu             
yes
fpu_exception   
yes
cpuid level     
13
wp              
yes
flags           
fpu tsc msr pae cx8 apic cmov pat clflush acpi mmx fxsr sse sse2 ss ht nx constant_tsc up pni vmx est ssse3 sse4_1
bogomips        
6258.29

processor       
2
vendor_id       
GenuineIntel
cpu family      
6
model           
23
model name      
Intel(RXeon(RCPU           L5420  2.50GHz
stepping        
10
cpu MHz         
2499.994
cache size      
6144 KB
fdiv_bug        
no
hlt_bug         
no
f00f_bug        
no
coma_bug        
no
fpu             
yes
fpu_exception   
yes
cpuid level     
13
wp              
yes
flags           
fpu tsc msr pae cx8 apic cmov pat clflush acpi mmx fxsr sse sse2 ss ht nx constant_tsc up pni vmx est ssse3 sse4_1
bogomips        
6258.29

processor       
3
vendor_id       
GenuineIntel
cpu family      
6
model           
23
model name      
Intel(RXeon(RCPU           L5420  2.50GHz
stepping        
10
cpu MHz         
2499.994
cache size      
6144 KB
fdiv_bug        
no
hlt_bug         
no
f00f_bug        
no
coma_bug        
no
fpu             
yes
fpu_exception   
yes
cpuid level     
13
wp              
yes
flags           
fpu tsc msr pae cx8 apic cmov pat clflush acpi mmx fxsr sse sse2 ss ht nx constant_tsc up pni vmx est ssse3 sse4_1
bogomips        
6258.29

processor       
4
vendor_id       
GenuineIntel
cpu family      
6
model           
23
model name      
Intel(RXeon(RCPU           L5420  2.50GHz
stepping        
10
cpu MHz         
2499.994
cache size      
6144 KB
fdiv_bug        
no
hlt_bug         
no
f00f_bug        
no
coma_bug        
no
fpu             
yes
fpu_exception   
yes
cpuid level     
13
wp              
yes
flags           
fpu tsc msr pae cx8 apic cmov pat clflush acpi mmx fxsr sse sse2 ss ht nx constant_tsc up pni vmx est ssse3 sse4_1
bogomips        
6258.29

processor       
5
vendor_id       
GenuineIntel
cpu family      
6
model           
23
model name      
Intel(RXeon(RCPU           L5420  2.50GHz
stepping        
10
cpu MHz         
2499.994
cache size      
6144 KB
fdiv_bug        
no
hlt_bug         
no
f00f_bug        
no
coma_bug        
no
fpu             
yes
fpu_exception   
yes
cpuid level     
13
wp              
yes
flags           
fpu tsc msr pae cx8 apic cmov pat clflush acpi mmx fxsr sse sse2 ss ht nx constant_tsc up pni vmx est ssse3 sse4_1
bogomips        
6258.29

processor       
6
vendor_id       
GenuineIntel
cpu family      
6
model           
23
model name      
Intel(RXeon(RCPU           L5420  2.50GHz
stepping        
10
cpu MHz         
2499.994
cache size      
6144 KB
fdiv_bug        
no
hlt_bug         
no
f00f_bug        
no
coma_bug        
no
fpu             
yes
fpu_exception   
yes
cpuid level     
13
wp              
yes
flags           
fpu tsc msr pae cx8 apic cmov pat clflush acpi mmx fxsr sse sse2 ss ht nx constant_tsc up pni vmx est ssse3 sse4_1
bogomips        
6258.29

processor       
7
vendor_id       
GenuineIntel
cpu family      
6
model           
23
model name      
Intel(RXeon(RCPU           L5420  2.50GHz
stepping        
10
cpu MHz         
2499.994
cache size      
6144 KB
fdiv_bug        
no
hlt_bug         
no
f00f_bug        
no
coma_bug        
no
fpu             
yes
fpu_exception   
yes
cpuid level     
13
wp              
yes
flags           
fpu tsc msr pae cx8 apic cmov pat clflush acpi mmx fxsr sse sse2 ss ht nx constant_tsc up pni vmx est ssse3 sse4_1
bogomips        
6258.29 
As this command don't work on that host

PHP Code:
[root@host ~]# grep "core id" /proc/cpuinfo
[root@host ~]
thank you
 
Old 06-08-2012, 11:01 AM   #2
neonsignal
Senior Member
 
Registered: Jan 2005
Location: Melbourne, Australia
Distribution: Debian Bookworm (Fluxbox WM)
Posts: 1,391
Blog Entries: 54

Rep: Reputation: 360Reputation: 360Reputation: 360Reputation: 360
Normally you would have "physical id" and "core id" lines for each processor in the /etc/cpuinfo file; so you would then know how many real processors and cores you had. The missing lines may indicate a problem with the particular kernel; is this a VPS guest system (perhaps Red Hat)?

Your new host machine has 8 processing units, but my understanding is that the L5420 is a 4 core processor [without hyperthreading, see post by suicidaleggroll below], so there are probably two processors, each with 4 cores (the processors might be both on the same die). The time field of top indicates how much CPU time the processor has used since it started. You need to know how long the process has been running in real time to know if the value is overly high (ie, CPU time divided by real time will give you an idea of the average load of that process).

There is a program x86info (install the package with the same name) which may give you more information.

Last edited by neonsignal; 06-08-2012 at 07:38 PM.
 
Old 06-08-2012, 11:59 AM   #3
Sydney
Member
 
Registered: Mar 2012
Distribution: Scientific Linux
Posts: 147

Rep: Reputation: 36
Intel(R) Xeon(R) CPU L5420 has 4 cores so you have 2 physical CPUs according to cpuinfo.
 
Old 06-08-2012, 12:04 PM   #4
suicidaleggroll
LQ Guru
 
Registered: Nov 2010
Location: Colorado
Distribution: OpenSUSE, CentOS
Posts: 5,573

Rep: Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143Reputation: 2143
Quote:
Originally Posted by Sydney View Post
Intel(R) Xeon(R) CPU L5420 has 4 cores so you have 2 physical CPUs according to cpuinfo.
This logic can only be used because the L5420 does not have hyperthreading. If the CPU supports hyperthreading and its enabled in the BIOS, this logic breaks down because cpuinfo will report two "processors" for each core (eg: a single quad core with hyperthreading will have eight processor entries in cpuinfo). In that case you need to use a combination of the "physical id" and "cores" lines to determine how many actual processor cores the machine has, neither of which are present in the OP's cpuinfo for some reason.

Last edited by suicidaleggroll; 06-08-2012 at 12:08 PM.
 
1 members found this post helpful.
  


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
cpus number lironl Programming 1 08-24-2008 11:07 PM
Maximum Number of cpus with SMP demosp Linux - General 2 10-02-2006 06:33 PM
top: number of CPUs naijaguy Linux - Newbie 4 02-11-2005 06:36 PM
Finding number of CPUs. r_213 Linux - Networking 2 10-08-2004 12:48 AM
how do i find number of cpus in one machine? doublefailure Linux - General 3 03-26-2002 03:52 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Newbie

All times are GMT -5. The time now is 01:08 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