The Community Forums

Interact with an entire community of cPanel & WHM users!
  1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

YAMTT (Yet another MySQL Tuning Thread)

Discussion in 'Workarounds and Optimization' started by Senor, Dec 13, 2012.

  1. Senor

    Senor Member

    Joined:
    Jun 12, 2007
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Hi folks. Would like some help tuning my MySQL, please. My load averages are quite high, and I'm sure it's SQL-related. Here are some relevant data. Please let me know if you need more info.

    Thanks in advance!

    Code:
    mysqltuner:
    
     >>  MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net>
     >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
     >>  Run with '--help' for additional options and output filtering
    
    -------- General Statistics --------------------------------------------------
    [--] Skipped version check for MySQLTuner script
    [OK] Currently running supported MySQL version 5.1.65-cll
    [OK] Operating on 64-bit architecture
    
    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster 
    [--] Data in MyISAM tables: 170M (Tables: 130)
    [--] Data in InnoDB tables: 208K (Tables: 13)
    [!!] Total fragmented tables: 15
    
    -------- Security Recommendations  -------------------------------------------
    [OK] All database users have passwords assigned
    
    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 71d 2h 22m 27s (737M q [120.086 qps], 180M conn, TX: 246B, RX: 36B)
    [--] Reads / Writes: 60% / 40%
    [--] Total buffers: 570.0M global + 2.7M per thread (500 max threads)
    [OK] Maximum possible memory usage: 1.9G (25% of installed RAM)
    [OK] Slow queries: 0% (1K/737M)
    [OK] Highest usage of available connections: 16% (84/500)
    [OK] Key buffer size / total MyISAM indexes: 48.0M/58.2M
    [OK] Key buffer hit rate: 100.0% (4B cached / 2M reads)
    [OK] Query cache efficiency: 53.2% (78M cached / 146M selects)
    [!!] Query cache prunes per day: 13797
    [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 14M sorts)
    [!!] Temporary tables created on disk: 38% (2M on disk / 7M total)
    [OK] Thread cache hit rate: 99% (29K created / 180M connections)
    [!!] Table cache hit rate: 1% (30 open / 1K opened)
    [OK] Open file limit used: 2% (59/2K)
    [OK] Table locks acquired immediately: 99% (120M immediate / 120M locks)
    [OK] InnoDB data size / buffer pool: 208.0K/8.0M
    
    -------- Recommendations -----------------------------------------------------
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        Increasing the query_cache size over 128M may reduce performance
        Temporary table size is already large - reduce result set size
        Reduce your SELECT DISTINCT queries without LIMIT clauses
        Increase table_cache gradually to avoid file descriptor limits
    Variables to adjust:
        query_cache_size (> 256M) [see warning above]
        table_cache (> 256)
    Code:
    my.cnf
    
    [mysqld]
    set-variable = max_connections=500
    log-slow-queries
    safe-show-database
    thread_cache_size=4
    table_cache=256
    query_cache_type=1
    query_cache_size=256M
    query_cache_limit=1M
    key_buffer_size=48M
    tmp_table_size=256M
    max_heap_table_size=256M
     
  2. Senor

    Senor Member

    Joined:
    Jun 12, 2007
    Messages:
    21
    Likes Received:
    0
    Trophy Points:
    1
    Still looking for some assistance on this. Here's another mysqltuner output:

    Code:
     >>  MySQLTuner 1.2.0_1 - Major Hayden <major@mhtx.net>
     >>  Bug reports, feature requests, and downloads at http://mysqltuner.com/
     >>  Run with '--help' for additional options and output filtering
    
    -------- General Statistics --------------------------------------------------
    [--] Skipped version check for MySQLTuner script
    [OK] Currently running supported MySQL version 5.1.66-cll
    [OK] Operating on 64-bit architecture
    
    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
    [--] Data in MyISAM tables: 122M (Tables: 130)
    [--] Data in InnoDB tables: 208K (Tables: 13)
    [!!] Total fragmented tables: 20
    
    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 22d 6h 55m 52s (311M q [161.529 qps], 76M conn, TX: 116B, RX: 14B)
    [--] Reads / Writes: 63% / 37%
    [--] Total buffers: 570.0M global + 2.7M per thread (500 max threads)
    [OK] Maximum possible memory usage: 1.9G (25% of installed RAM)
    [OK] Slow queries: 0% (1K/311M)
    [OK] Highest usage of available connections: 5% (26/500)
    [OK] Key buffer size / total MyISAM indexes: 48.0M/38.7M
    [OK] Key buffer hit rate: 100.0% (2B cached / 252K reads)
    [OK] Query cache efficiency: 59.6% (39M cached / 65M selects)
    [!!] Query cache prunes per day: 1979
    [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 4M sorts)
    [!!] Temporary tables created on disk: 35% (801K on disk / 2M total)
    [OK] Thread cache hit rate: 99% (27K created / 76M connections)
    [OK] Table cache hit rate: 43% (233 open / 538 opened)
    [OK] Open file limit used: 14% (374/2K)
    [OK] Table locks acquired immediately: 99% (43M immediate / 43M locks)
    [OK] InnoDB data size / buffer pool: 208.0K/8.0M
    
    -------- Recommendations -----------------------------------------------------
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        Increasing the query_cache size over 128M may reduce performance
        Temporary table size is already large - reduce result set size
        Reduce your SELECT DISTINCT queries without LIMIT clauses
    Variables to adjust:
        query_cache_size (> 256M) [see warning above]
     

Share This Page