Announcement

Announcement Module
Collapse
No announcement yet.

mysql 5 debian cpuload mysqld over 100%

Page Title Module
Move Remove Collapse
X
Conversation Detail Module
Collapse
  • Filter
  • Time
  • Show
Clear All
new posts

  • mysql 5 debian cpuload mysqld over 100%

    Hi,

    Im running mysql 5.0.32-Debian_7etch1-log Debian etch distribution

    On a Dell poweredge with 4gb ram and 2 x dual xeon 3.0 ghz cpu s what i lately have is that mysqld shoots out to 150% 200% in top.

    Is this a bug of mysql that it goes over 100% ?

    top - 10:13:15 up 1 day, 10:49, 2 users, load average: 0.21, 0.26, 0.27
    Tasks: 78 total, 1 running, 77 sleeping, 0 stopped, 0 zombie
    Cpu(s): 0.2%us, 0.2%sy, 0.0%ni, 60.7%id, 0.0%wa, 0.0%hi, 0.0%si, 0.0%st
    Mem: 3897492k total, 3736200k used, 161292k free, 132312k buffers
    Swap: 1502036k total, 32k used, 1502004k free, 1549644k cached

    PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND
    2576 mysql 15 0 1977m 1.8g 5996 S 1 150.3 676:54.63 mysqld

  • #2
    Hi gozer,

    top is saying your CPUs are idle 60% of the time.
    2 x dual mean 400% CPU. So 150%-200% mean up to 50% of CPU-Time.

    Anyway have a look into "show processlist". Have a look into iostat or vmstat to see if IO is your bottleneck.

    Comment


    • #3
      isnt 2 cpus then 200% instead of 400% ?

      Tnx for your reply.

      Comment


      • #4
        This is what i get from iostat

        MYSQL00:/var/www# iostat -d -x 5 8
        Linux 2.6.18-4-686 (MYSQL00) 04/08/2008

        Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
        sda 1.29 182.69 3.00 28.19 161.98 1687.02 59.28 0.64 20.49 1.07 3.34

        Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
        sda 0.00 113.35 0.00 28.69 0.00 1136.25 39.61 0.31 10.78 0.53 1.51

        Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
        sda 0.00 11.95 0.80 3.98 25.50 127.49 32.00 0.01 3.00 2.17 1.04

        Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
        sda 0.00 185.60 0.00 39.40 0.00 1800.00 45.69 0.63 15.90 0.47 1.84

        Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
        sda 0.00 116.17 1.60 8.78 51.10 999.60 101.23 0.06 5.77 1.62 1.68

        Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
        sda 0.00 164.47 0.40 36.93 12.77 1611.18 43.51 0.60 15.98 0.56 2.08

        Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
        sda 0.00 7.39 0.00 3.99 0.00 91.02 22.80 0.00 0.80 0.80 0.32

        Device: rrqm/s wrqm/s r/s w/s rsec/s wsec/s avgrq-sz avgqu-sz await svctm %util
        sda 0.00 153.60 0.00 39.40 0.00 1544.00 39.19 0.59 14.88 0.49 1.92

        Comment


        • #5
          gozer wrote on Tue, 08 April 2008 05:04

          isnt 2 cpus then 200% instead of 400% ?

          Tnx for your reply.


          Every dual-CPU ist shown as two:
          2x2=4 )

          Comment


          • #6
            ah ok ) from the stats i posted does it look like a high IO?

            Comment


            • #7
              gozer wrote on Tue, 08 April 2008 05:20

              This is what i get from iostat

              MYSQL00:/var/www# iostat -d -x 5 8
              Linux 2.6.18-4-686 (MYSQL00) 04/08/2008




              Wrong optimation. I dont know your storage, so iostat -c should be sufficient.

              Comment


              • #8
                Is there a way to view cached querys ?

                I was monitoring with mytop and everytime i see a certain query passingby then the cpu load hits 130/200%

                Comment


                • #9
                  turn on your log-slow-queries in your my.cnf there is a good chance to see the query.

                  If your CPU rises with a query QueryCache is not used.
                  Have you got the query?
                  What is "iostat -c " .. saying while the query ist in progress?

                  It looks like an SQL-Problem:-)

                  Comment

                  Working...
                  X