Mysql Optimisation

Discussion in 'Server Operation' started by newbie14, Feb 14, 2011.

  1. newbie14

    newbie14 New Member

    Dear All,
    I have a server with 16 cpus and 32g ram. The problem below when I run my top it show mysql %cpu is more than 100%. Below is my top results. The problem here I would like to why is mysqld is using up 137.2% of the cpu and my overall cpus is only 5.2%. So I would like to know why when I have so much of resourse but mysqld is running on maximum. Another thing I notice my mysqld is keep restarting? Any help please?

    top - 10:46:14 up 21 min, 3 users, load average: 1.16, 1.29, 0.97
    Tasks: 279 total, 1 running, 278 sleeping, 0 stopped, 0 zombie
    Cpu(s): 5.2%us, 1.2%sy, 0.0%ni, 92.7%id, 0.3%wa, 0.1%hi, 0.5%si, 0.0%st
    Mem: 33009800k total, 2027584k used, 30982216k free, 96196k buffers
    Swap: 35061752k total, 0k used, 35061752k free, 199944k cached

    5913 mysql 20 0 666m 49m 3844 S 137.2 0.2 0:18.74 mysqld
    3679 gdm 20 0 337m 29m 8176 S 9.8 0.1 0:01.24 gnome-settings-
    3625 root 20 0 113m 13m 4764 S 7.8 0.0 0:03.63 Xorg
    5966 root 20 0 14876 1172 776 R 2.0 0.0 0:00.01 top
  2. till

    till Super Moderator Staff Member ISPConfig Developer

  3. newbie14

    newbie14 New Member

    Dear Till,
    Thank for the link. Must I install perl first to run the script is it? Besides that I am currently working on the query optimisation based on the slow query log. But on the other hand if you notice the memory usage is always very low. Yes the load sometimes do go up very high and goes down then. But I dont understand why mysql fails when I have huge sum of resources and mysql is just using very minimal of it.Is it that indeed mysql have its limitations? What else can it be? I have checked there is no cron job though.
  4. till

    till Super Moderator Staff Member ISPConfig Developer


    Mysql has several variables that define the max resources used by the system. Run mysltuner, the script will give you some good new default values based on the resource usage of your database and tell you where the bottlenecks are.

Share This Page