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 Optimize Help for VPS

Discussion in 'Workarounds and Optimization' started by dos_santos_rj, Apr 18, 2012.

  1. dos_santos_rj

    dos_santos_rj Member

    Joined:
    Apr 12, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    I need help optimizing my my.cnf file.

    My VPS is:
    25 GB Disk Space
    512 MB RAM
    2048 MB Burst RAM
    Intel(R) Xeon(R) CPU E5620 @ 2.40GHz
    Speed 2400.154 MHz
    Cache 12288 KB

    I did some changes.

    my.cnf

    Code:
    [mysqld]
    query_cache_size=10M
    join_buffer_size = 1M
    tmp_table_size=32M
    max_heap_table_size=32M
    thread_cache_size=2
    
    set-variable = max_connections=500
    log-slow-queries
    safe-show-database
    

    Code:
     >>  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.0.95-community-log
    [OK] Operating on 32-bit architecture with less than 2GB RAM
    
    -------- Storage Engine Statistics -------------------------------------------
    [--] Status: +Archive -BDB +Federated +InnoDB -ISAM -NDBCluster
    [--] Data in MyISAM tables: 785M (Tables: 650)
    [--] Data in InnoDB tables: 1M (Tables: 76)
    [!!] Total fragmented tables: 12
    
    -------- Security Recommendations  -------------------------------------------
    [OK] All database users have passwords assigned
    
    -------- Performance Metrics -------------------------------------------------
    [--] Up for: 1d 10h 20m 32s (11M q [91.220 qps], 40K conn, TX: 2B, RX: 1B)
    [--] Reads / Writes: 99% / 1%
    [--] Total buffers: 60.0M global + 3.6M per thread (500 max threads)
    [!!] Maximum possible memory usage: 1.8G (89% of installed RAM)
    [OK] Slow queries: 0% (43/11M)
    [OK] Highest usage of available connections: 15% (78/500)
    [OK] Key buffer size / total MyISAM indexes: 8.0M/481.2M
    [OK] Key buffer hit rate: 99.8% (88M cached / 197K reads)
    [OK] Query cache efficiency: 71.7% (7M cached / 11M selects)
    [!!] Query cache prunes per day: 1747711
    [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 128K sorts)
    [!!] Joins performed without indexes: 2458
    [!!] Temporary tables created on disk: 45% (76K on disk / 167K total)
    [OK] Thread cache hit rate: 89% (4K created / 40K connections)
    [!!] Table cache hit rate: 0% (64 open / 22K opened)
    [OK] Open file limit used: 5% (126/2K)
    [OK] Table locks acquired immediately: 99% (3M immediate / 3M locks)
    [OK] InnoDB data size / buffer pool: 1.3M/8.0M
    
    -------- Recommendations -----------------------------------------------------
    General recommendations:
        Run OPTIMIZE TABLE to defragment tables for better performance
        Reduce your overall MySQL memory footprint for system stability
        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 (> 10M)
        join_buffer_size (> 1.0M, or always use indexes with joins)
        tmp_table_size (> 32M)
        max_heap_table_size (> 32M)
        table_cache (> 64)
    
     
  2. dos_santos_rj

    dos_santos_rj Member

    Joined:
    Apr 12, 2012
    Messages:
    9
    Likes Received:
    0
    Trophy Points:
    1
    cPanel Access Level:
    Root Administrator
    Re: MySQL optimize help

    The first is a dedicate server...
    the second is a vps!
     
  3. Infopro

    Infopro cPanel Sr. Product Evangelist
    Staff Member

    Joined:
    May 20, 2003
    Messages:
    14,453
    Likes Received:
    195
    Trophy Points:
    63
    Location:
    Pennsylvania
    cPanel Access Level:
    Root Administrator
    Twitter:
    Re: MySQL optimize help

    Corrected and titles more appropriately named.
     
Loading...

Share This Page