+ Reply to Thread
Results 1 to 6 of 6

Thread: MySQL Tuner Optimization

  1. #1
    Speaks fluent binary phpforfun has a spectacular aura about phpforfun has a spectacular aura about phpforfun's Avatar
    Join Date
    Feb 2008
    Posts
    1,204
    Blog Entries
    17

    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 02:57 PM.

  2. #2
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    19
    Posts
    2,223
    Blog Entries
    8

    Re: MySQL Tuner Optimization

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

  3. #3
    Administrator Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan is a name known to all Jordan's Avatar
    Join Date
    Nov 2005
    Location
    Hendersonville, NC
    Posts
    24,556
    Blog Entries
    97

    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).

  4. #4
    Code Warrior BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch is a glorious beacon of light BlaineSch's Avatar
    Join Date
    Apr 2009
    Location
    Trapped in my own little world.
    Age
    19
    Posts
    2,223
    Blog Entries
    8

    Re: MySQL Tuner Optimization

    Good eye jordan lol

  5. #5
    Speaks fluent binary phpforfun has a spectacular aura about phpforfun has a spectacular aura about phpforfun's Avatar
    Join Date
    Feb 2008
    Posts
    1,204
    Blog Entries
    17

    Re: MySQL Tuner Optimization

    Fixed

  6. #6
    Newbie whwmia is an unknown quantity at this point whwmia's Avatar
    Join Date
    Aug 2009
    Posts
    20

    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. Tutorial: Storing Images in MySQL with PHP
    By Jordan in forum PHP Tutorials
    Replies: 43
    Last Post: 01-16-2010, 10:35 AM
  2. MySQL Resources
    By dirkfirst in forum Database & Database Programming
    Replies: 2
    Last Post: 08-25-2009, 04:46 AM
  3. Replies: 3
    Last Post: 09-07-2008, 12:49 PM
  4. MYSQL CheatSheet - A must for MySQL Users
    By reachpradeep in forum Database & Database Programming
    Replies: 1
    Last Post: 03-03-2007, 03:05 PM
  5. MySQL Optimization?
    By Void in forum Database & Database Programming
    Replies: 6
    Last Post: 01-07-2007, 01:06 PM

Bookmarks

Bookmarks

     
        Algorithms and Data Structures

        Java tutorials

        Algorithms Forum

Posting Permissions

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