#1
  1. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    144
    Rep Power
    9

    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
    Your Health Encyclopedia :: Recurrent Depression
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language
  2. #2
  3. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    Also, as i understand on previous host there are 4 processores, and 2 cores
    It's not physically possible to have fewer cores than processors. It's hard to tell from just seeing the "core id" lines, but my guess is that your old host was a single processor system with 2 physical cores with hyper-threading.

    The L5420 is a 4 core processor without hyper-threading, so it looks like your new host is a dual processor system with a total of 8 physical cores.

    Can anybody explain what this mean "137:31.72"
    It means the process has spent 137 minutes and 31.72 seconds of the processor's time. If the processor has 2 cores, then for every 1 minute of real time the processor has 2 minutes of processor time available.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around
  4. #3
  5. No Profile Picture
    Contributing User
    Devshed Newbie (0 - 499 posts)

    Join Date
    Jul 2006
    Posts
    144
    Rep Power
    9
    Originally Posted by E-Oreo
    It's not physically possible to have fewer cores than processors. It's hard to tell from just seeing the "core id" lines, but my guess is that your old host was a single processor system with 2 physical cores with hyper-threading.
    Here are outputs of few commands that i know - > OLD HOST

    PHP Code:
     grep 'cpu cores' /proc/cpuinfo
    cpu cores       
    2
    cpu cores       
    2
    cpu cores       
    2
    cpu cores       

    PHP Code:
     grep CPU /proc/cpuinfo
    model name      
    Intel(RXeon(RCPU            5150  2.66GHz
    model name      
    Intel(RXeon(RCPU            5150  2.66GHz
    model name      
    Intel(RXeon(RCPU            5150  2.66GHz
    model name      
    Intel(RXeon(RCPU            5150  2.66GHz 
    PHP Code:
    grep processor /proc/cpuinfo
    processor       
    0
    processor       
    1
    processor       
    2
    processor       

    PHP Code:
     grep coreid /proc/cpuinfo grep -0$ | grep ^0$ >> /dev/null && grep -c processor /proc/cpuinfo || grep coreid /proc/cpuinfo grep -0$

    PHP Code:
     grep -c processor /proc/cpuinfo

    PHP Code:
    cat /proc/cpuinfo
    processor       
    0
    vendor_id       
    GenuineIntel
    cpu family      
    6
    model           
    15
    model name      
    Intel(RXeon(RCPU            5150  2.66GHz
    stepping        
    6
    cpu MHz         
    2666.664
    cache size      
    4096 KB
    physical id     
    0
    siblings        
    2
    core id         
    0
    cpu cores       
    2
    apicid          
    0
    initial apicid  
    0
    fpu             
    yes
    fpu_exception   
    yes
    cpuid level     
    10
    wp              
    yes
    flags           
    fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca lahf_lm dts tpr_shadow
    bogomips        
    5319.54
    clflush size    
    64
    cache_alignment 
    64
    address sizes   
    36 bits physical48 bits virtual
    power management
    :

    processor       1
    vendor_id       
    GenuineIntel
    cpu family      
    6
    model           
    15
    model name      
    Intel(RXeon(RCPU            5150  2.66GHz
    stepping        
    6
    cpu MHz         
    2666.664
    cache size      
    4096 KB
    physical id     
    3
    siblings        
    2
    core id         
    0
    cpu cores       
    2
    apicid          
    6
    initial apicid  
    6
    fpu             
    yes
    fpu_exception   
    yes
    cpuid level     
    10
    wp              
    yes
    flags           
    fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca lahf_lm dts tpr_shadow
    bogomips        
    5320.05
    clflush size    
    64
    cache_alignment 
    64
    address sizes   
    36 bits physical48 bits virtual
    power management
    :

    processor       2
    vendor_id       
    GenuineIntel
    cpu family      
    6
    model           
    15
    model name      
    Intel(RXeon(RCPU            5150  2.66GHz
    stepping        
    6
    cpu MHz         
    2666.664
    cache size      
    4096 KB
    physical id     
    0
    siblings        
    2
    core id         
    1
    cpu cores       
    2
    apicid          
    1
    initial apicid  
    1
    fpu             
    yes
    fpu_exception   
    yes
    cpuid level     
    10
    wp              
    yes
    flags           
    fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca lahf_lm dts tpr_shadow
    bogomips        
    5320.03
    clflush size    
    64
    cache_alignment 
    64
    address sizes   
    36 bits physical48 bits virtual
    power management
    :

    processor       3
    vendor_id       
    GenuineIntel
    cpu family      
    6
    model           
    15
    model name      
    Intel(RXeon(RCPU            5150  2.66GHz
    stepping        
    6
    cpu MHz         
    2666.664
    cache size      
    4096 KB
    physical id     
    3
    siblings        
    2
    core id         
    1
    cpu cores       
    2
    apicid          
    7
    initial apicid  
    7
    fpu             
    yes
    fpu_exception   
    yes
    cpuid level     
    10
    wp              
    yes
    flags           
    fpu vme de pse tsc msr pae mce cx8 apic mtrr pge mca cmov pat pse36 clflush dts acpi mmx fxsr sse sse2 ss ht tm pbe syscall lm constant_tsc arch_perfmon pebs bts rep_good aperfmperf pni dtes64 monitor ds_cpl vmx est tm2 ssse3 cx16 xtpr pdcm dca lahf_lm dts tpr_shadow
    bogomips        
    5320.03
    clflush size    
    64
    cache_alignment 
    64
    address sizes   
    36 bits physical48 bits virtual
    power management



    Originally Posted by E-Oreo
    It means the process has spent 137 minutes and 31.72 seconds of the processor's time. If the processor has 2 cores, then for every 1 minute of real time the processor has 2 minutes of processor time available.
    Is it normal to be so high ? For example just now it's 147:01.69 mysqld. It's calculated starting last restart or for any period of time.

    Thank you very much
    Your Health Encyclopedia :: Recurrent Depression
    Medical and health consumer information resources containing comprehensive and unbiased information in patient-friendly language
  6. #4
  7. No Profile Picture
    Contributing User
    Devshed Intermediate (1500 - 1999 posts)

    Join Date
    Feb 2004
    Location
    San Francisco Bay
    Posts
    1,939
    Rep Power
    1313
    Originally Posted by alexo
    Is it normal to be so high ? For example just now it's 147:01.69 mysqld. It's calculated starting last restart or for any period of time.
    I don't understand your last sentence. The time value is per-process, so if you were to kill mysqld and restart it, the time would restart from 0:00.00.

    mysqld is the MySQL server daemon. A daemon is a program that runs in the background, usually providing a particular service (in this case, access to your MySQL database). A daemon runs in the background for an arbitrary amount of time, potentially accruing CPU time as it goes, so your question about whether your particular running time value is "normal" doesn't really make sense. mysqld could have been running on that server for years, for all we know.

    From your posts in this thread, I gather that you're running a database-heavy website that is eating a lot of your server's CPU time. Unfortunately, this is something I know nothing about. Good luck...
  8. #5
  9. No Profile Picture
    Lost in code
    Devshed Supreme Being (6500+ posts)

    Join Date
    Dec 2004
    Posts
    8,317
    Rep Power
    7170
    The 5150 is actually a dual core processor without hyper threading, so your old host must have had a dual processor system with two 5150's for a total of four cores.
    PHP FAQ

    Originally Posted by Spad
    Ah USB, the only rectangular connector where you have to make 3 attempts before you get it the right way around

IMN logo majestic logo threadwatch logo seochat tools logo