Mysql Configuration Optimisation/Tuning

Discussion in 'MySQL' started by searche, Sep 25, 2007.

  1. #1
    Hi,


    I'm having problems with my server, the mysql crashes too often in rush hours... I'm runing a torrent tracker and i would need a better my.cnf, optimised...so it won't crash...

    I'm paying 5$ to the person that will give me a good configuration, that won't crash in the next 3 days...
     
    searche, Sep 25, 2007 IP
  2. GoodOmens

    GoodOmens Peon

    Messages:
    73
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    Just to let you know there is no "good" fit all configuration.

    Without knowing anything about your problem, it is more likely due to poor queries then a faulty mysql install (Or if your trying to run a intensive site on a shared account).

    Since your talking about moding your conf file I assume your on a dedicated site or a VPS.

    Without going into much detail because the scope of tuning a mysql install is beyond the scope of this post I will point you to this area:

    http://www.databasejournal.com/features/mysql/article.php/10897_1402311_1

    Your going to want to turn on slow queries and begin logging queries that take over x seconds time. I've found in the past queries that had poor indexes were the cause of a lot of problems.

    Then look at that site and begin looking at your mysql stats. Modifying things ssuch as cache, table locking etc. to your sites load can greatly affect how you are using your resources. Be careful though, sometimes giving these applications to much memory will cause others such as apache to crash.
     
    GoodOmens, Sep 25, 2007 IP
  3. cyanide

    cyanide Peon

    Messages:
    483
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #3
    Post your my.cnf file
    also post the results of
     
    cyanide, Sep 27, 2007 IP
  4. turiel

    turiel Peon

    Messages:
    148
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #4
    I found this perl script awesome for tuning my my.cnf, my cache rate went from 60% to 99% with the changes it recommended:

    http://rackerhacker.com/mysqltuner/

    As someone else mentioned, there is no magical conf someone can give you that will perfectly fit your situation.
     
    turiel, Sep 27, 2007 IP
    cyanide likes this.
  5. Sockmoney

    Sockmoney Peon

    Messages:
    569
    Likes Received:
    14
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Sockmoney, Sep 27, 2007 IP
  6. cyanide

    cyanide Peon

    Messages:
    483
    Likes Received:
    26
    Best Answers:
    0
    Trophy Points:
    0
    #6
    Nice tool, repped.
    There's a few others i use, but don't think i've seen that one
     
    cyanide, Sep 27, 2007 IP
  7. drewbe121212

    drewbe121212 Well-Known Member

    Messages:
    733
    Likes Received:
    20
    Best Answers:
    0
    Trophy Points:
    125
    #7
    Also, make sure all of your tables are of the InnoDB engine type, not MyISAM. The InnoDB type can handle far more update/insert queries due to row level locking as opposed to the annoying MyISAM table level locking.
     
    drewbe121212, Oct 3, 2007 IP
  8. turiel

    turiel Peon

    Messages:
    148
    Likes Received:
    11
    Best Answers:
    0
    Trophy Points:
    0
    #8
    You are correct about the benefits of InnoDB, however I would recommend a mix of MyISAM and InnoDB - MyISAM performs quite a bit better on tables that are high read low write.
     
    turiel, Oct 8, 2007 IP