mysql性能优化工具--tuner-primer使用介绍
下载并改变执行权限:
wgethttp://www.day32.com/MySQL/tuning-primer.sh
chmod+xtuning-primer.sh
./tuning-primer.sh
结果报告:
会用几种颜色标记:
蓝色:总指标
绿色:表示此参数还可以
红色:表示此参数有严重问题
深红色:表示有问题参数
黄色:一些信息提示
而且还有警告:
ANYjoinsnotusingindexesarefound.
下面是一个报告的结果
xx@xxxxxx:~$../tuning-primer.sh
mysqldisalive
-By:MatthewMontgomery-
MySQLVersion5.1.32-enterprise-gpl-logx86_64
Uptime=4days0hrs48min3sec
Avg.qps=255
TotalQuestions=88956118
ThreadsConnected=4
Serverhasbeenrunningforover48hrs.
Itshouldbesafetofollowtheserecommendations
runtimevariableseffectsperformancevisit:
Visithttp://www.mysql.com/products/enterprise/advisors.html
forinfoaboutMySQL'sEnterpriseMonitoringandAdvisoryService
SLOWQUERIES
Currentlong_query_time=10.000000sec.
Youhave
Thebinaryupdatelogisenabled
Seehttp://dev.mysql.com/doc/refman/5.1/en/purge-master-logs.html
Currentthread_cache_size=32
Currentthreads_cached=29
Currentthreads_per_sec=0
Historicthreads_per_sec=0
Currentmax_connections=151
Currentthreads_connected=4
Historicmax_used_connections=84
Thenumberofusedconnectionsis
ConfiguredMaxPer-threadBuffers:10.38G
ConfiguredMaxGlobalBuffers:6.10G
ConfiguredMaxMemoryLimit:16.48G
PhysicalMemory:8.00G
Maxmemorylimitexceeds90%ofphysicalmemory
1714734*1024/2147483648*100
CurrentMyISAMindexspace=8K
Currentkey_buffer_size=2.00G
Keycachemissrateis1:585673
Keybufferfreeratio=0%
Perhapsyoucanusetheseresourceselsewhere
(错误参数设置:query_cache_size>query_cache_limit--ByMe)
Currentsort_buffer_size=4M
Currentread_rnd_buffer_size=64M
Currentjoin_buffer_size=132.00K
Youhavehad1querieswhereajoincouldnotuseanindexproperly
Youshouldenable"log-queries-not-using-indexes"
Thenlookfornonindexedjoinsintheslowquerylog.
Ifyouareunabletooptimizeyourqueriesyoumaywanttoincreaseyour
join_buffer_sizetoaccommodatelargerjoinsinonepass.
ANYjoinsnotusingindexesarefound.
Currentopen_files_limit=1185files
thatoftable_cacheifyouhaveheavyMyISAMusage.
Currenttable_open_cache=512tables
Currenttable_definition_cache=256tables
Youhaveatotalof0tables
Youhave
Currenttablescanratio=4650:1
Youmaybenefitfromraisingread_buffer_sizeand/orimprovingyouruseofindexes.
CurrentLockWaitratio=1:5833374