Skip to main content

MySQL optimization

Comments

4 comments

  • cPanelMichael
    Hello :) I just wanted to point out that MySQL 5.1 is end of life: [url=http://blog.cpanel.net/mysql-5-1-end-of-life/]MySQL 5.1 End Of Life | cPanel Blog Thank you.
    0
  • thinkbot
    can you run mysqltuner.pl and post the output plus, add contents of my.cnf [COLOR="silver">- - - Updated - - - innodb_buffer_pool_size= 2.5G max_connections = 400 sort_buffer_size=256K read_buffer_size=128K read_rnd_buffer_size=256K and restart
    0
  • cobysan
    hi, don't you think these are too low values for the buffers ? our db server is AMD Dual x8 Opteron 6128, 8GB RAM, CentOs 6 - 64Bit current my.cnf - max_connections = 600 safe-show-database key_buffer = 2G max_allowed_packet = 64M table_cache = 4096 sort_buffer_size = 8M read_buffer_size = 8M read_rnd_buffer_size = 8M myisam_sort_buffer_size = 64M query_cache_size = 156M tmp_table_size = 512M max_heap_table_size = 512M thread_cache_size = 32 wait_timeout = 120 connect_timeout = 10 interactive_timeout = 600 innodb_buffer_pool_size = 1536M Thank you for your help
    0
  • cobysan
    Hi Your suggestion works great ! thank you so much - New mysqltuner results >> MySQLTuner 1.2.0 - Major Hayden > 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.73-log [OK] Operating on 64-bit architecture -------- Storage Engine Statistics ------------------------------------------- [--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster [--] Data in MyISAM tables: 26G (Tables: 476) [--] Data in InnoDB tables: 2G (Tables: 22) [!!] Total fragmented tables: 42 -------- Performance Metrics ------------------------------------------------- [--] Up for: 3d 14h 45m 44s (80M q [259.191 qps], 2M conn, TX: 49B, RX: 16B) [--] Reads / Writes: 82% / 18% [--] Total buffers: 5.2G global + 1.0M per thread (400 max threads) [OK] Maximum possible memory usage: 5.5G (35% of installed RAM) [OK] Slow queries: 0% (99/80M) [!!] Highest connection usage: 88% (354/400) [OK] Key buffer size / total MyISAM indexes: 2.0G/6.1G [OK] Key buffer hit rate: 99.7% (4B cached / 12M reads) [OK] Query cache efficiency: 30.4% (20M cached / 66M selects) [!!] Query cache prunes per day: 53194 [OK] Sorts requiring temporary tables: 8% (124K temp sorts / 1M sorts) [OK] Temporary tables created on disk: 25% (815K on disk / 3M total) [OK] Thread cache hit rate: 99% (2K created / 2M connections) [!!] Table cache hit rate: 1% (680 open / 51K opened) [OK] Open file limit used: 13% (1K/8K) [OK] Table locks acquired immediately: 98% (56M immediate / 57M locks) [OK] InnoDB data size / buffer pool: 2.0G/2.5G -------- Recommendations ----------------------------------------------------- General recommendations: Run OPTIMIZE TABLE to defragment tables for better performance Reduce or eliminate persistent connections to reduce connection usage Increasing the query_cache size over 128M may reduce performance Increase table_cache gradually to avoid file descriptor limits Variables to adjust: max_connections (> 400) wait_timeout (< 120) interactive_timeout (< 400) query_cache_size (> 156M) [see warning above] table_cache (> 4096)
    thank you Coby
    0

Please sign in to leave a comment.