mysql¼à²â¹¤¾ßtuning-primer.sh(Ò»)

2014-11-24 15:41:53 ¡¤ ×÷Õß: ¡¤ ä¯ÀÀ: 5
mysql¼à²â¹¤¾ßtuning-primer.sh
mysqlµÄÔËËãÇé¿ö£¬ÎÒÃÇ¿ÉÒÔÒ»²½Ò»²½µÄÈ¥²é¿´£¬·ÖÎö¡£ÕâÑùÐèÒªÒ»¶¨µÄʱ¼ä£¬½ñÌìÍÆ¼ö¸ø´ó¼ÒÒ»¸ö²»´íµÄ½Å±¾tuning-primer.sh£¬¿ÉÒÔ°ïÖúÎÒÃÇÈ¥²é¿´Ò»ÏÂmsyqlµÄÔËÐÐÇé¿ö£¬²úÉú±¨¸æºÍ¸ø³öһЩ½¨Ò飬ÎÒÃÇ¿ÉÒÔ¸ù¾ÝÕâЩ½¨Ò飬½áºÏmysql·þÎñÆ÷µÄʵ¼ÊÇé¿ö£¬¶Ômysql½øÐÐÓÅ»¯¡£
ÏÂÔØµØÖ·£º wget http://www.day32.com/MySQL/tuning-primer.sh
×¢Ò⣺½«tuning-primer.sh·Åµ½ÓÚmy.cnfͬһĿ¼ÉÏ,²¢¸³ÓڿɶÁдȨÏÞ
Èô³öÏÖÈçÏ´íÎó
[html] 
[root@mwtec-80 data]# sh tuning-primer.sh   
which: no bc in (/usr/local/cmake/bin:/usr/local/mysql3306/bin:/home/hadoop/hadoop-0.20.2/bin:/usr/java/jdk1.6.0_26/bin:/usr/java/jdk1.6.0_26/jre/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/home/hadoop/pig-0.10.1/bin:/root/bin)  
Error: Command line calculator 'bc' not found!  

°²×°Ï bc¼´¿É£º
yum install bc 

[root@mwtec-80 mysql3306]# ./tuning-primer.sh 

        -- MYSQL PERFORMANCE TUNING PRIMER --
             - By: Matthew Montgomery -


MySQL Version 5.6.12 x86_64


Uptime = 0 days 1 hrs 55 min 50 sec
Avg. qps = 0
Total Questions = 50
Threads Connected = 1


Warning: Server has not been running for at least 48hrs.
It may not be safe to use these recommendations


To find out more information on how each of these
runtime variables effects performance visit:
http://dev.mysql.com/doc/refman/5.6/en/server-system-variables.html
Visit http://www.mysql.com/products/enterprise/advisors.html
for info about MySQL's Enterprise Monitoring and Advisory Service


SLOW QUERIES  --Âý²éѯÇé¿
ö The slow query log is NOT enabled. Current long_query_time = 10.000000 sec. You have 0 out of 71 that take longer than 10.000000 sec. to complete Your long_query_time seems to be fine BINARY UPDATE LOG The binary update log is NOT enabled. You will not be able to do point in time recovery See http://dev.mysql.com/doc/refman/5.6/en/point-in-time-recovery.html WORKER THREADS --¹¤×÷Ïß³Ì Current thread_cache_size = 9 Current threads_cached = 0 Current threads_per_sec = 0 Historic threads_per_sec = 0 Your thread_cache_size is fine MAX CONNECTIONS --×î´óÁ¬½ÓÊý Current max_connections = 151 Current threads_connected = 1 Historic max_used_connections = 1 The number of used connections is 0% of the configured maximum. You are using less than 10% of your configured max_connections. Lowering max_connections could help to avoid an over-allocation of memory See "MEMORY USAGE" section to make sure you are not over-allocating INNODB STATUS Current InnoDB index space = 0 bytes Current InnoDB data space = 80 K Current InnoDB buffer pool free = 97 % Current innodb_buffer_pool_size = 128 M Depending on how much space your innodb indexes take up it may be safe to increase this value to up to 2 / 3 of total system memory MEMORY USAGE --ÄÚ´æÊ¹ÓÃÇé¿ö Max Memory Ever Allocated : 154 M Configured Max Per-thread Buffers : 169 M Configured Max Global Buffers : 153 M Configured Max Memory Limit : 322 M Physical Memory : 3.61 G Max memory limit seem to be within acceptable norms KEY BUFFER --myisam±íµÄkey bufferʹÓÃÇé¿ö No key reads ! Seriously look into using some indexes Current MyISAM index space = 108 K Current key_buffer_size = 8 M Key cache miss rate is 1 : 0 Key buffer free ratio = 81 % Your key_buffer_size seems to be fine QUERY CACHE --²éѯ»º´æÇé¿ö Query cache is enabled Current query_cache_size = 1 M Current query_cache_used = 16 K Current query_cache_limit = 1 M Current Query cache Memory fill ratio = 1.64 % Current query