Mysqltuner recomendations

Discussion in 'MySQL' started by ASTRAPI, Nov 21, 2009.

  1. #1
    Hello

    Using mysqltuner i got the above recomendations:

    1) Total fragmented tables: 13
    2) Query cache is disabled
    3) Sorts requiring temporary tables: 95% (1M temp sorts / 1M sorts)
    4) Thread cache is disabled
    5) Table cache hit rate: 0% (64 open / 47K opened)
    6) Table locks acquired immediately: 93%


    And as recomendations i got:

    General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    Enable the slow query log to troubleshoot bad queries
    Set thread_cache_size to 4 as a starting value
    Increase table_cache gradually to avoid file descriptor limits
    Optimize queries and/or use InnoDB to reduce lock wait

    Variables to adjust:
    query_cache_size (>= 8M)
    sort_buffer_size (> 1M)
    read_rnd_buffer_size (> 256K)
    thread_cache_size (start at 4)
    table_cache (> 64)


    Where are those variables to adjust?

    Thank you
     
    ASTRAPI, Nov 21, 2009 IP
  2. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #2
    You need to adjust them in MySQL configuration file i.e. my.cnf (Linux) or my.ini (Windows).
     
    mwasif, Nov 21, 2009 IP
  3. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    All the adjusments that i need to do are in my.cnf?

    Yes i have linux Centos 64bit.
     
    ASTRAPI, Nov 21, 2009 IP
  4. Oyaye

    Oyaye Peon

    Messages:
    56
    Likes Received:
    1
    Best Answers:
    0
    Trophy Points:
    0
    #4
    yup, that can be found in /etc/my.cnf , make sure do a backup first before editing the actual file. good luck, if you have problems. do contact me. i might be able to help.
     
    Oyaye, Nov 21, 2009 IP
  5. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #5
    Many of those are missing can you help me to adjust them?

    [mysqld]
    port            = 3306
    socket          = /var/lib/mysql/mysql.sock
    skip-locking
    skip-innodb
    skip-bdb
    key_buffer = 10M
    max_allowed_packet = 1M
    table_cache = 1024
    sort_buffer_size = 2M
    read_buffer_size = 1M
    read_rnd_buffer_size = 1M
    net_buffer_length = 2K
    thread_stack = 64K
    log-slow-queries       = /var/log/mysql/mysql-slow.log
    server-id = 1
    skip-networking
    
    [mysqldump]
    quick
    max_allowed_packet = 1M
    
    [mysql]
    no-auto-rehash
    safe-updates
    
    [isamchk]
    key_buffer = 10M
    sort_buffer_size = 2M
    
    [myisamchk]
    key_buffer = 10M
    sort_buffer_size = 2M
    Code (markup):
     
    ASTRAPI, Nov 21, 2009 IP
  6. mwasif

    mwasif Active Member

    Messages:
    816
    Likes Received:
    23
    Best Answers:
    1
    Trophy Points:
    70
    #6
    All the recommended variables will go under [mysqld] section.
     
    mwasif, Nov 21, 2009 IP
  7. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #7
    If they are missing i just add them ?

    Can you please add them to my config file just to see and be sure ?

    Thank you
     
    ASTRAPI, Nov 22, 2009 IP
  8. ASTRAPI

    ASTRAPI Guest

    Messages:
    500
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    please anyone?
     
    ASTRAPI, Nov 27, 2009 IP