[root@amb01 ~]# wget http://www.day32.com/MySQL/tuning-primer.sh [root@amb01 ~]# chmod +x tuning-primer.sh [root@amb01 ~]# vi .my.cnf [client] user=root password=abcd.1234 socket=/tmp/mysql.sock [root@amb01 ~]# ./tuning-primer.sh -- MYSQL PERFORMANCE TUNING PRIMER -- - By: Matthew Montgomery - MySQL Version 5.6.41-log x86_64 Uptime = 8 days 20 hrs 40 min 9 sec Avg. qps = 28 Total Questions = 21968982 Threads Connected = 6 Server has been running for over 48hrs. It should be safe to follow 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 = 5.000000 sec. You have 32929 out of 21969007 that take longer than 5.000000 sec. to complete Your long_query_time seems to be fine BINARY UPDATE LOG The binary update log is enabled WORKER THREADS Current thread_cache_size = 9 Current threads_cached = 5 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 = 6 Historic max_used_connections = 37 The number of used connections is 24% of the configured maximum. Your max_connections variable seems to be fine. INNODB STATUS Current InnoDB index space = 1.21 G Current InnoDB data space = 4.94 G Current InnoDB buffer pool free = 1 % Current innodb_buffer_pool_size = 2.00 G 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 : 3.00 G Configured Max Per-thread Buffers : 2.98 G Configured Max Global Buffers : 2.27 G Configured Max Memory Limit : 5.26 G Physical Memory : 3.74 G Max memory limit exceeds 90% of physical memory KEY BUFFER Current MyISAM index space = 124 K Current key_buffer_size = 256 M Key cache miss rate is 1 : 1475 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_cache_min_res_unit = 4 K Your query_cache_size seems to be too high. Perhaps you can use these resources elsewhere MySQL won't cache query results that are larger than query_cache_limit in size SORT OPERATIONS Current sort_buffer_size = 1 M Current read_rnd_buffer_size = 1 M Sort buffer seems to be fine JOINS Current join_buffer_size = 1.00 M You have had 313 queries where a join could not use an index properly You should enable "log-queries-not-using-indexes" Then look for non indexed joins in the slow query log. If you are unable to optimize your queries you may want to increase your join_buffer_size to accommodate larger joins in one pass. Note! This script will still suggest raising the join_buffer_size when ANY joins not using indexes are found. OPEN FILES LIMIT Current open_files_limit = 65535 files The open_files_limit should typically be set to at least 2x-3x that of table_cache if you have heavy MyISAM usage. Your open_files_limit value seems to be fine TABLE CACHE Current table_open_cache = 2000 tables Current table_definition_cache = 1400 tables You have a total of 390 tables You have 444 open tables. The table_cache value seems to be fine TEMP TABLES Current max_heap_table_size = 256 M Current tmp_table_size = 256 M Of 99780 temp tables, 2% were created on disk Created disk tmp tables ratio seems fine TABLE SCANS Current read_buffer_size = 1 M Current table scan ratio = 1 : 1 read_buffer_size seems to be fine TABLE LOCKING Current Lock Wait ratio = 0 : 21971125 Your table locking seems to be fine
mysql database 性能监控工具:tuning-primer.sh
猜你喜欢
转载自blog.51cto.com/13598811/2308752
今日推荐
周排行