เก็บ MySQLTuner มาฝากครับเอาไว้จูน Mysql ว่าต้องปรับอะไรบ้างจริงๆมีตั้งนานแล้วล่ะครับแต่พี่ที่ทำงานพึ่งส่งให้ เริ่มกันเลยนะครับก็โหลดมาด้วยการใช้ wget
MySQLTuner
root:#wget http://mysqltuner.pl/mysqltuner.pl root:# /usr/bin/perl mysqltuner.pl
หลังจากนั้นก็จะมีรายงานขึ้นมาเพียบเลยครับอ่านรายละเอียดแล้วแก้ไขตามที่ระบบแจ้งมาครับ หลังจากนั้นก็ปรับจูน my.cnf แล้วเช็คดูครับ
>> MySQLTuner 1.0.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
Please enter your MySQL administrative login: fuckadmin
Please enter your MySQL administrative password:
——– General Statistics ————————————————–
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.0.67-0ubuntu6-log
[!!] Switch to 64-bit OS – MySQL cannot currently use all of your RAM
——– Storage Engine Statistics ——————————————-
[--] Status: +Archive -BDB -Federated -InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 1G (Tables: 1121)
[--] Data in MEMORY tables: 0B (Tables: 2)
[!!] Total fragmented tables: 105
——– Performance Metrics ————————————————-
[--] Up for: 2h 12m 51s (1M q [155.646 qps], 34K conn, TX: 3B, RX: 131M)
[--] Reads / Writes: 79% / 21%
[--] Total buffers: 554.0M global + 13.1M per thread (1024 max threads)
[!!] Allocating > 2GB RAM on 32-bit systems can cause system instability
[!!] Maximum possible memory usage: 13.7G (345% of installed RAM)
[OK] Slow queries: 0% (39/1M)
[OK] Highest usage of available connections: 8% (90/1024)
[OK] Key buffer size / total MyISAM indexes: 256.0M/387.4M
[OK] Key buffer hit rate: 100.0% (111M cached / 52K reads)
[OK] Query cache efficiency: 72.0% (732K cached / 1M selects)
[!!] Query cache prunes per day: 884139
[OK] Sorts requiring temporary tables: 0% (19 temp sorts / 14K sorts)
[!!] Joins performed without indexes: 152
[!!] Temporary tables created on disk: 37% (4K on disk / 11K total)
[OK] Thread cache hit rate: 96% (1K created / 34K connections)
[!!] Table cache hit rate: 6% (1K open / 15K opened)
[OK] Open file limit used: 37% (1K/5K)
[OK] Table locks acquired immediately: 96% (430K immediate / 446K locks)
——– 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
Adjust your join queries to always utilize indexes
Temporary table size is already large – reduce result set size
Reduce your SELECT DISTINCT queries without LIMIT clauses
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
*** MySQL’s maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
query_cache_size (> 32M)
join_buffer_size (> 1.0M, or always use indexes with joins)
table_cache (> 1024)
ส่วนผมเองก็ปรับมั่วๆไปเรื่อยเปลื่อยครับ Mysql รัน 100% ก็มีบางครั้งแก้ไม่หายซ่ะก่ะที



Posted in
Tags:
แต่ละเรื่องที่ตั้งมา ต้องเทพจริงๆ จะเข้า ส่วนผม งง มากๆครับ
ว้าว งงดีค่ะ
หาทางกลับบ้านไม่ได้เยย
เอ่อ….
ต้องมีความรู้มากก่านี่ซะแล่ว
เดยวจะลองเอาไป งม ดูงับ
*0*