MYSQL - High Server Load?

Discussion in 'MySQL' started by Maxman, Feb 5, 2008.

  1. #1
    I see that my server loads which are normally around .24 are much higher recently. If I reboot the box or restart mysql it is okay for another day or two.

    I am on a UNix box (dedicated). I do have one main site and another site with lower traffic. Last month my wordpress mu install on the small site was hacked and was creating lots of automatic posts. I deleted that and everything was fine.

    When I run the TOP command I see that MYSQL is grabbing 80% of the CPU. How can I tell what MYSQL is doing?

    Any help would be appreciated. Thanks!
     
    Maxman, Feb 5, 2008 IP
  2. qualityhostings

    qualityhostings Well-Known Member

    Messages:
    1,764
    Likes Received:
    9
    Best Answers:
    0
    Trophy Points:
    105
    #2
    You can see, which database is using more cpu and you may remove that domain if you wish

    login to ssh

    mysql -uroot -pROOTpASSWORD


    mysql> show processlist;


    You can see the process list there.

    type exit to quit.
     
    qualityhostings, Feb 5, 2008 IP
  3. Maxman

    Maxman Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Thanks I will check it out!
     
    Maxman, Feb 5, 2008 IP
  4. WordPressBlogNetwork

    WordPressBlogNetwork Member

    Messages:
    29
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    46
    #4
    or try this command on root

    watch mysqladmin process


    it will show what process is running
     
    WordPressBlogNetwork, Jul 19, 2012 IP
  5. Maxman

    Maxman Peon

    Messages:
    66
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Thanks. We were able to work this out back in 2008 though. :)
     
    Maxman, Jul 20, 2012 IP
  6. nannysingh

    nannysingh Peon

    Messages:
    23
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #6
    [mysqld]
    innodb_buffer_pool_size = 13M
    max_heap_table_size = 48M
    query_cache_limit = 1M
    query_cache_size = 8M
    query_cache_type = 1
    table_cache = 80
    thread_cache_size = 4
    tmp_table_size = 48M
    after setting above variable you can reset mysql
     
    nannysingh, Oct 3, 2012 IP
  7. wetbupa

    wetbupa Peon

    Messages:
    119
    Likes Received:
    2
    Best Answers:
    1
    Trophy Points:
    0
    #7
    Mysql can overload the server and use most of the server CPU ion case one of the server databases are not optimized or some tabled in the dbs are crashed.
    There is an option in WHM "Show MySQL Process" through which you will get which user is using high mysql resource.The same Mysql processes can be seen if you use ssh command : mysqladmin proc stat

    To optimize your databse via SSH , use the following command: mysqlcheck --repair db_name


    As MySQL does not have much of resource utilization control you can simply run heavy queries to get MySQL Server barely functional. The limits which exist are not really helpful as they do not define query complexity and resource consumption allowed for user. Heavy Disk IO queries can be one of the worse because they would both overload IO system and wipe off both MySQL and OS caches which can cause other users queries to perform order of magnitude slower than in normal case.
     
    wetbupa, Oct 17, 2012 IP
  8. narkoz_39

    narkoz_39 Greenhorn

    Messages:
    13
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    11
    #8
    you can use Litespeed
     
    narkoz_39, Oct 20, 2012 IP
  9. StormVZ

    StormVZ Greenhorn

    Messages:
    43
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    18
    #9
    StormVZ, Oct 21, 2012 IP