Very high system loads

Discussion in 'Databases' started by mumfry, Feb 23, 2010.

  1. #1
    Hello fellow web pros.
    Please share your expertise on this subject.

    when ever i connect to mysql server i get some very high system loads.
    can anyone please tell me what causes this and how i might go about remedying it
     
    mumfry, Feb 23, 2010 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    Identify which processes are eating up system resources. Is it MySQL or something else? If it is MySQL then most probably it will be due to slow queries running on it. To identify slow queries, turn on the slow query log and tune them.
     
    mwasif, Feb 23, 2010 IP
  3. mumfry

    mumfry Active Member

    Messages:
    118
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    51
    #3
    Hello mwasif. You hit the nail right on the head it turns out mysql using up most of the cpu. But am not sure about how to go about implementing your suggestion . If you can give me a little more info that would be great
     
    mumfry, Feb 24, 2010 IP
  4. RHS-Chris

    RHS-Chris Well-Known Member

    Messages:
    1,007
    Likes Received:
    35
    Best Answers:
    10
    Trophy Points:
    150
    #4
    To turn on slow query log, add this to the MySQL section of your my.cnf:

    log-slow-queries = /var/log/mysql/mysql-slow.log

    You can also read through a blog post I did a while back, it explains a couple of tools to use to tweak MySQL perfomance:

    http://solidservers.ca/2009/07/tuning-tweaking-mysql/
     
    RHS-Chris, Feb 24, 2010 IP
  5. aadam

    aadam Peon

    Messages:
    65
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    This used to happen to me but i switched hosting companies, to hostgator, and everything then worked out :)
     
    aadam, Mar 1, 2010 IP
  6. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #6
    RHS-Chris is right. You need to turn on slow query log. This will help you to identify the slow queries which must be tuned to give some peace to MySQL.
     
    mwasif, Mar 2, 2010 IP
  7. fierceservers

    fierceservers Peon

    Messages:
    338
    Likes Received:
    5
    Best Answers:
    0
    Trophy Points:
    0
    #7
    This would assume the TS has root access to his server. If TS does have root access I would also suggest the priming script:

    http://day32.com/MySQL/

    Also to the TS, how is it that you are connecting to the db?
     
    fierceservers, Mar 2, 2010 IP