Please whitelist cPanel in your adblocker so that you’re able to see our version release promotions, thanks!

The Community Forums

Interact with an entire community of cPanel & WHM users!

My turn! mySQL Optimization

Discussion in 'Workarounds and Optimization' started by beninfl, May 26, 2014.

  1. beninfl

    beninfl Member

    May 23, 2014
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hi everyone!

    My server came with an empty my.cnf and nothing setup on it. Nice of them, wasnt it?

    8GB of memory (with a free total 32GB memory upgrade being installed this week) and quad Xeon 3.2GHz 2048kb cache CPUs.

    root@dwhs205 [~/bin]# ./
     >>  MySQLTuner 1.3.0 - Major Hayden <>
     >>  Bug reports, feature requests, and downloads at
     >>  Run with '--help' for additional options and output filtering
    [OK] Currently running supported MySQL version 5.5.36-cll
    [!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM
    -------- Storage Engine Statistics -------------------------------------------
    [--] Data in MyISAM tables: 97M (Tables: 381)
    [--] Data in InnoDB tables: 120M (Tables: 404)
    [--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
    [!!] Total fragmented tables: 157
    -------- Security Recommendations  -------------------------------------------
    [OK] All database users have passwords assigned
    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 22h 6m 0s (8M q [105.983 qps], 65K conn, TX: 12B, RX: 1B)
    [--] Reads / Writes: 89% / 11%
    [--] Total buffers: 744.0M global + 8.3M per thread (151 max threads)
    [OK] Maximum possible memory usage: 2.0G (25% of installed RAM)
    [OK] Slow queries: 0% (0/8M)
    [OK] Highest usage of available connections: 33% (50/151)
    [OK] Key buffer size / total MyISAM indexes: 100.0M/24.2M
    [OK] Key buffer hit rate: 100.0% (40M cached / 8K reads)
    [OK] Query cache efficiency: 87.3% (6M cached / 8M selects)
    [!!] Query cache prunes per day: 62957
    [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 340K sorts)
    [!!] Temporary tables created on disk: 31% (125K on disk / 398K total)
    [OK] Thread cache hit rate: 99% (66 created / 65K connections)
    [OK] Table cache hit rate: 99% (943 open / 952 opened)
    [OK] Open file limit used: 1% (863/50K)
    [OK] Table locks acquired immediately: 99% (1M immediate / 1M locks)
    [OK] InnoDB buffer pool / data size: 500.0M/120.4M
    [OK] InnoDB log waits: 0
    -------- Recommendations -----------------------------------------------------
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        MySQL started within last 24 hours - recommendations may be inaccurate
        Enable the slow query log to troubleshoot bad queries
        When making adjustments, make tmp_table_size/max_heap_table_size equal
        Reduce your SELECT DISTINCT queries without LIMIT clauses
    Variables to adjust:
        query_cache_size (> 128M)
        tmp_table_size (> 2G)
        max_heap_table_size (> 32K)
    query_cache_limit = 32M
    query_cache_size = 128M
    query_cache_type = 1
    table_open_cache = 25000
    table_definition_cache = 2000
    key_buffer_size = 100M
    innodb_buffer_pool_size = 500M
    innodb_buffer_pool_instances = 4
    tmp_table_size = 2048M
    max_heap_table_size = 32K
    thread_cache_size = 32
    I am a complete mySQL novice. This server is used for Wordpress / WooCommerce. I'm adding another site to the server that will double its mySQL usage, as well in about 2 weeks.

    Thanks so much to any tips you can provide to speed this pig up! I see a lot of "help me optimize" thread, and we are all EXTREMELY grateful to you pros for your services.

  2. cPanelMichael

    cPanelMichael Technical Support Community Manager
    Staff Member

    Apr 11, 2011
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Hello :)

    I just wanted to point out that you may want to run the tuner again after adding the additional site that's going to increase your MySQL usage. The results may change, depending on what improvements you make from the user feedback to this thread.

    Thank you.
    Stop hovering to collapse... Click to collapse... Hover to expand... Click to expand...
  3. Archmactrix

    Archmactrix Well-Known Member

    Jan 20, 2012
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    The my.cnf file is usually empty when it's delivered to customers. You have to adjust the variables values yourself or with assistance, according to your needs.
  4. beninfl

    beninfl Member

    May 23, 2014
    Likes Received:
    Trophy Points:
    cPanel Access Level:
    Root Administrator
    Michael: Thanks, I was planning for that. I just wanted to make sure all was well with it. The memory usage on the server is EXTREMELY low right now, I rarely see it use more than 800MB out of 8GB in htop.

    Archmactrix: Of course. That's why I'm here, to help optimize my config file and server. ;) Any suggestions?


Share This Page

  1. This site uses cookies to help personalise content, tailor your experience and to keep you logged in if you register.
    By continuing to use this site, you are consenting to our use of cookies.
    Dismiss Notice