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.

Mysql optimization with mysqltuner

Discussion in 'Workarounds and Optimization' started by morteza3245, Oct 9, 2013.

  1. morteza3245

    morteza3245 Well-Known Member

    Joined:
    Sep 16, 2013
    Messages:
    104
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    Hi

    below is my output from mysql tuner :

    Code:
    root@host [/]# /usr/local/bin/mysqltuner.pl
    
     >>  MySQLTuner 1.2.0 - Major Hayden <major@mhtx.net>
     >>  Bug reports, feature requests, and downloads at [url]http://mysqltuner.com/[/url]
     >>  Run with '--help' for additional options and output filtering
    
    -------- General Statistics --------------------------------------------------
    [--] Skipped version check for MySQLTuner script
    [OK] Currently running supported MySQL version 5.5.32-cll
    [OK] Operating on 64-bit architecture
    
    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
    w[--] Data in MyISAM tables: 8G (Tables: 14459)
    [--] Data in InnoDB tables: 126M (Tables: 2762)
    [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
    [--] Data in MEMORY tables: 19M (Tables: 90)
    [!!] Total fragmented tables: 3066
    
    -------- Security Recommendations  -------------------------------------------
    [OK] All database users have passwords assigned
    
    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 26d 23h 22m 4s (1B q [557.181 qps], 11M conn, TX: 12616B, RX: 136B)
    [--] Reads / Writes: 90% / 10%
    [--] Total buffers: 1.1G global + 2.6M per thread (151 max threads)
    [OK] Maximum possible memory usage: 1.5G (2% of installed RAM)
    [OK] Slow queries: 0% (107/1B)
    [OK] Highest usage of available connections: 68% (104/151)
    [OK] Key buffer size / total MyISAM indexes: 963.0M/1.4G
    [OK] Key buffer hit rate: 99.5% (24B cached / 114M reads)
    [OK] Query cache efficiency: 31.8% (371M cached / 1B selects)
    [!!] Query cache prunes per day: 2184557
    [OK] Sorts requiring temporary tables: 0% (12K temp sorts / 16M sorts)
    [!!] Joins performed without indexes: 214864
    [!!] Temporary tables created on disk: 27% (4M on disk / 17M total)
    [OK] Thread cache hit rate: 97% (231K created / 11M connections)
    [!!] Table cache hit rate: 0% (400 open / 124M opened)
    [OK] Open file limit used: 1% (737/43K)
    [OK] Table locks acquired immediately: 99% (894M immediate / 894M locks)
    [OK] InnoDB data size / buffer pool: 126.6M/128.0M
    
    -------- Recommendations -----------------------------------------------------
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        Enable the slow query log to troubleshoot bad queries
        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 (> 16M)
        join_buffer_size (> 512B, or always use indexes with joins)
        tmp_table_size (> 32M)
        max_heap_table_size (> 256M)
        table_cache (> 400)
    
    root@host [/]# w^C
    
    my config my.cnf is:

    Code:
    [mysqld]
    local-infile=0
    join_buffer_size=512
    query_cache_size=16M
    tmp_table_size=32M
    max_heap_table_size=256M
    thread_cache_size=4
    max_allowed_packet=32M
    key_buffer_size=963M
    query_cache_limit=1M
    open_files_limit=43042
    
    can you Please help me for optimize best performance?

    Thanks.
     
  2. thinkbot

    thinkbot Well-Known Member

    Joined:
    Oct 30, 2012
    Messages:
    326
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    [mysqld]
    local-infile=0
    myisam_use_mmap=1

    join_buffer_size=1M
    read_rnd_buffer_size=2M

    query_cache_type = 1
    query_cache_size=50M
    query_cache_limit=1M

    tmp_table_size=50M
    max_heap_table_size=50M

    thread_cache_size=30
    table_open_cache = 5000
    table_definition_cache = 2500

    max_allowed_packet=32M
    key_buffer_size=5G

    open_files_limit=20000

    slow_query_log=1
    slow_query_log_file=mysql-slow.log
    long_query_time=0.1


    innodb_buffer_pool_size = 200M
     
  3. cPanelMichael

    cPanelMichael Forums Analyst
    Staff Member

    Joined:
    Apr 11, 2011
    Messages:
    30,854
    Likes Received:
    676
    Trophy Points:
    113
    cPanel Access Level:
    Root Administrator
  4. felz

    felz Member

    Joined:
    Aug 4, 2011
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
  5. thinkbot

    thinkbot Well-Known Member

    Joined:
    Oct 30, 2012
    Messages:
    326
    Likes Received:
    0
    Trophy Points:
    16
    cPanel Access Level:
    Root Administrator
    That blog post is from February 14, 2007, on mysql version 5.0


    In your case 1,5G would be more than enough, but this is max option, we set it max 5G, so when needed it will increase to this number
     
Loading...

Share This Page