+ Reply to Thread
Results 1 to 6 of 6

Thread: MySQL Tuner Optimization

  1. #1
    phpforfun's Avatar
    phpforfun is offline Speaks fluent binary
    Join Date
    Feb 2008
    Posts
    1,232
    Blog Entries
    17
    Rep Power
    24

    MySQL Tuner Optimization

    Hey guys, if you are having MySQL issues on a linux box, try using this, its called MySQL Tuner. Its a neat little tool that tells you why your MySQL Configuration sucks, and it tells you how to fix it. Idiot proof

    CD To Src
    cd /usr/local/src/

    Download it
    wget http://mysqltuner.com/mysqltuner.pl

    Chmod it
    chmod +x mysqltuner.pl

    Run It
    ./mysqltuner.pl

    Here is what it will output.. atleast for my server before I optimized it

    [root@svr2 src]# ./mysqltuner.pl

    >> MySQLTuner 1.0.0 - Major Hayden <major@mhtx.net>
    >> Bug reports, feature requests, and downloads at MySQLTuner - MySQLTuner
    >> Run with '--help' for additional options and output filtering

    -------- General Statistics --------------------------------------------------
    [--] Skipped version check for MySQLTuner script
    [OK] Currently running supported MySQL version 5.0.81-community-log
    [!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM

    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
    [--] Data in MyISAM tables: 708M (Tables: 4947)
    [--] Data in InnoDB tables: 107M (Tables: 157)
    [--] Data in MEMORY tables: 756K (Tables: 8)
    [!!] Total fragmented tables: 176

    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 1d 6h 11m 0s (8M q [77.526 qps], 287K conn, TX: 4B, RX: 994M)
    [--] Reads / Writes: 48% / 52%
    [--] Total buffers: 587.0M global + 2.7M per thread (500 max threads)
    [OK] Maximum possible memory usage: 1.9G (47% of installed RAM)
    [OK] Slow queries: 0% (36/8M)
    [OK] Highest usage of available connections: 6% (30/500)
    [OK] Key buffer size / total MyISAM indexes: 409.0M/412.5M
    [OK] Key buffer hit rate: 98.1% (64M cached / 1M reads)
    [OK] Query cache efficiency: 64.6% (3M cached / 5M selects)
    [!!] Query cache prunes per day: 41878
    [OK] Sorts requiring temporary tables: 1% (4K temp sorts / 320K sorts)
    [!!] Joins performed without indexes: 1594
    [!!] Temporary tables created on disk: 36% (36K on disk / 98K total)
    [OK] Thread cache hit rate: 98% (5K created / 287K connections)
    [!!] Table cache hit rate: 0% (70 open / 170K opened)
    [OK] Open file limit used: 3% (132/4K)
    [OK] Table locks acquired immediately: 99% (4M immediate / 4M locks)
    [!!] InnoDB data size / buffer pool: 107.3M/106.0M

    -------- Recommendations -----------------------------------------------------
    General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    Adjust your join queries to always utilize indexes
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries without LIMIT clauses
    Increase table_cache gradually to avoid file descriptor limits
    Variables to adjust:
    query_cache_size (> 40M)
    join_buffer_size (> 128.0K, or always use indexes with joins)
    tmp_table_size (> 50M)
    max_heap_table_size (> 30M)
    table_cache (> 70)
    innodb_buffer_pool_size (>= 107M)
    Last edited by phpforfun; 07-08-2009 at 12:57 PM.

  2. CODECALL Circuit advertisement
    Join Date
    Always
    Posts
    Many

     
  3. #2
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: MySQL Tuner Optimization

    I got a 404 is it only accessible through the linux command line?

  4. #3
    Jordan Guest

    Re: MySQL Tuner Optimization

    Very cool script, thanks for the share! +rep

    @Blaine: I think he wrote the URL wrong. It should be http://mysqltuner.com/mysqltuner.pl
    (note the u instead of an i).

  5. #4
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Posts
    2,487
    Rep Power
    33

    Re: MySQL Tuner Optimization

    Good eye jordan lol

  6. #5
    phpforfun's Avatar
    phpforfun is offline Speaks fluent binary
    Join Date
    Feb 2008
    Posts
    1,232
    Blog Entries
    17
    Rep Power
    24

    Re: MySQL Tuner Optimization

    Fixed

  7. #6
    whwmia's Avatar
    whwmia is offline Newbie
    Join Date
    Aug 2009
    Posts
    24
    Rep Power
    0

    Re: MySQL Tuner Optimization

    Nice one ! Thank You !

+ Reply to Thread

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. tuner fm
    By tomala in forum C and C++
    Replies: 1
    Last Post: 10-26-2009, 03:33 PM
  2. Optimization
    By exile_9999 in forum Database & Database Programming
    Replies: 3
    Last Post: 08-04-2009, 01:24 PM
  3. need help for c optimization, take a look thanks
    By ayad001 in forum C and C++
    Replies: 1
    Last Post: 06-17-2008, 09:11 AM
  4. MySQL Optimization?
    By Void in forum Database & Database Programming
    Replies: 6
    Last Post: 01-07-2007, 11:06 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts