tuning-primer.sh脚本性能调优的使用

来源:互联网 发布:淘宝店铺首页打不开 编辑:程序博客网 时间:2024/06/05 06:00

按照比较简单直接下载配置即可完成;比mysqlreport工具方便好多的!以下是相关步骤;

wget http://www.day32.com/MySQL/tuning-primer.sh
chmod +x tuning-primer.sh
./tuning-primer.sh

[root@Slave02 ~]# ./tuning-primer.sh Using login values from ~/.my.cnf- INITIAL LOGIN ATTEMPT FAILED -Testing for stored webmin passwords: None FoundCould not auto detect login info!Found potential sockets: /tmp/mysql.sockUsing: /tmp/mysql.sockWould you like to provide a different socket?: [y/N] NDo you have your login handy ? [y/N] : yUser: rootPassword: root Would you like me to create a ~/.my.cnf file for you? [y/N] : N         -- MYSQL PERFORMANCE TUNING PRIMER --             - By: Matthew Montgomery -MySQL Version 5.5.13-log i686Uptime = 0 days 8 hrs 30 min 9 secAvg. qps = 0Total Questions = 76Threads Connected = 1Warning: Server has not been running for at least 48hrs.It may not be safe to use these recommendationsTo find out more information on how each of theseruntime variables effects performance visit:http://dev.mysql.com/doc/refman/5.5/en/server-system-variables.htmlVisit http://www.mysql.com/products/enterprise/advisors.htmlfor info about MySQL's Enterprise Monitoring and Advisory ServiceSLOW QUERIESThe slow query log is NOT enabled.Current long_query_time = 10.000000 sec.You have 0 out of 97 that take longer than 10.000000 sec. to completeYour long_query_time seems to be fineBINARY UPDATE LOGThe binary update log is enabledThe expire_logs_days is not set.The mysqld will retain the entire binary log until RESET MASTER or PURGE MASTER LOGS commands are run manuallySetting expire_logs_days will allow you to remove old binary logs automaticallySee http://dev.mysql.com/doc/refman/5.5/en/purge-master-logs.htmlBinlog sync is not enabled, you could loose binlog records during a server crashWORKER THREADSCurrent thread_cache_size = 0Current threads_cached = 0Current threads_per_sec = 1Historic threads_per_sec = 0Your thread_cache_size is fineMAX CONNECTIONSCurrent max_connections = 151Current threads_connected = 1Historic max_used_connections = 1The 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 memorySee "MEMORY USAGE" section to make sure you are not over-allocatingINNODB STATUSCurrent InnoDB index space = 136 MCurrent InnoDB data space = 241 MCurrent InnoDB buffer pool free = 93 %Current innodb_buffer_pool_size = 128 MDepending on how much space your innodb indexes take up it may be safeto increase this value to up to 2 / 3 of total system memoryMEMORY USAGEMax Memory Ever Allocated : 161 MConfigured Max Per-thread Buffers : 240 MConfigured Max Global Buffers : 160 MConfigured Max Memory Limit : 400 MPhysical Memory : 503 MMax memory limit seem to be within acceptable normsKEY BUFFERNo key reads?!Seriously look into using some indexesCurrent MyISAM index space = 130 KCurrent key_buffer_size = 16 MKey cache miss rate is 1 : 0Key buffer free ratio = 88 %Your key_buffer_size seems to be fineQUERY CACHEQuery cache is supported but not enabledPerhaps you should set the query_cache_sizeSORT OPERATIONSCurrent sort_buffer_size = 512 KCurrent read_rnd_buffer_size = 512 KNo sort operations have been performedSort buffer seems to be fineJOINSCurrent join_buffer_size = 132.00 KYou have had 0 queries where a join could not use an index properlyYour joins seem to be using indexes properlyOPEN FILES LIMITCurrent open_files_limit = 1024 filesThe open_files_limit should typically be set to at least 2x-3xthat of table_cache if you have heavy MyISAM usage.Your open_files_limit value seems to be fineTABLE CACHECurrent table_open_cache = 64 tablesCurrent table_definition_cache = 400 tablesYou have a total of 68 tablesYou have 64 open tables.Current table_cache hit rate is 90%, while 100% of your table cache is in useYou should probably increase your table_cacheTEMP TABLESCurrent max_heap_table_size = 16 MCurrent tmp_table_size = 16 MOf 281 temp tables, 11% were created on diskCreated disk tmp tables ratio seems fineTABLE SCANSCurrent read_buffer_size = 256 KCurrent table scan ratio = 4 : 1read_buffer_size seems to be fineTABLE LOCKINGCurrent Lock Wait ratio = 0 : 358Your table locking seems to be fine[root@Slave02 ~]# 


原创粉丝点击