Mysql + SMP kernel + Quad Core + "mpstat -P ALL

Discussion in 'MySQL' started by nikitas, Sep 19, 2008.

  1. #1
    Hi,

    I know that the MySQL runs on a single process (can see with command: ps aux).
    I know that the MySQL is multithreaded and if I run in an SMP kernel, the load will be balance smoothly by the processors.

    I have one server running only MySQL, is a Quad Core Intel(R) Xeon(R) CPU E5430 2.66GHz

    # uname -a
    Linux one.forums-free.com 2.6.18-6-686 #1 SMP Tue Jun 17 21:31:27 UTC 2008 i686 GNU/Linux

    But if I run the command "mpstat", I see that the load is not equal in all processors.

    # !mpstat -P ALL 60
    01:44:56 CPU %user %nice %sys %iowait %irq %soft %steal %idle intr/s
    01:45:56 all 15,02 0,00 2,04 17,17 0,08 0,66 0,00 65,03 2879,96
    01:45:56 0 23,11 0,00 2,02 44,54 0,05 0,72 0,00 29,57 791,20
    01:45:56 1 18,91 0,00 4,10 13,11 0,28 1,68 0,00 61,88 2088,74
    01:45:56 2 8,83 0,00 1,08 4,87 0,00 0,13 0,00 85,05 0,00
    01:45:56 3 9,23 0,00 0,93 6,16 0,00 0,13 0,00 83,54 0,00

    Even under high load, the last processor still have a high IDLE.
    CPU0 sometime have 0% IDLE and the last processor is in 60-70% idle.

    Any idea how to use all power from all processors?
    Thanks.
     
    nikitas, Sep 19, 2008 IP
  2. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #2
    I would look on the mysql website in the forums or under bug reports. If I remember correctly, mysql has problems distributing load with more than 2 or 3 logical processors. I think it's much more efficient with version 5.1 which isn't quite in stable yet, but is probably usable for more purposes. What version are you currently using?

    You may also try asking here: http://www.mysqlperformanceblog.com/ awesome website for tuning a DB.
     
    jestep, Sep 20, 2008 IP
  3. best host world

    best host world Peon

    Messages:
    213
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Hello ,

    The first thing you should do Update your version to The newer One and tune Up your my.cnf config to be better than befor !

    Thank you .
     
    best host world, Sep 20, 2008 IP
  4. jestep

    jestep Prominent Member

    Messages:
    3,659
    Likes Received:
    215
    Best Answers:
    19
    Trophy Points:
    330
    #4
    Is this a 64bit operating system? On 32bit, mysql can only run on a single thread.
     
    jestep, Sep 20, 2008 IP
  5. nikitas

    nikitas Peon

    Messages:
    71
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks for the answers.

    It's 64 bits. (Linux xxx 2.6.18-6-686 #1 SMP Tue Jun 17 21:31:27 UTC 2008 i686 GNU/Linux)
    Lasted Debian version.

    Mysql version:
    mysql Ver 14.12 Distrib 5.0.32, for pc-linux-gnu (i486) using readline 5.2

    I will try the 5.1 version.. and watch for differences.
    I already read a loot about optimization... my my.cnf its pretty good right now.
    I only have this issue with processors.
     
    nikitas, Sep 21, 2008 IP