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

Discussion in 'Site & Server Administration' 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. The Universes

    The Universes Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Edit your my.cnf and change/add 'thread_concurrency' to 8
    in the [mysqld] section and restart mysqld

    You have some pretty high iowait btw, that will drive up the load avg.
     
    The Universes, Sep 20, 2008 IP
  3. nikitas

    nikitas Peon

    Messages:
    71
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #3
    This option (thread_concurrency) is only to Solaris systems.
    The don't have any impact on Linux. (I use the lasted Debian x64)

    http://dev.mysql.com/doc/refman/5.0/en/server-system-variables.html#option_mysqld_thread_concurrency
    Any other idea?
     
    nikitas, Sep 21, 2008 IP
  4. The Universes

    The Universes Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #4
    One thing, high load could be caused by iowait. Have you checked that out?
     
    The Universes, Sep 21, 2008 IP