首頁 >資料庫 >mysql教程 >mysql数据库参数文件性能调试工具:tuning-primer.sh

mysql数据库参数文件性能调试工具:tuning-primer.sh

WBOY
WBOY原創
2016-06-07 14:52:031563瀏覽

更多博文请关注: 没有伞的孩子必须努力奔跑 (www.xuchanggang.cn) 个人感觉,这脚本非常不错,可以很直观的发现,参数配置上的问题: 下载地址为: http://www.day32.com/MySQL/tuning-primer.sh 下面安装,演示一下: 1.安装的话,如果能连外网,直接使用

更多博文请关注:没有伞的孩子必须努力奔跑 (www.xuchanggang.cn)


个人感觉,这脚本非常不错,可以很直观的发现,参数配置上的问题:

下载地址为:http://www.day32.com/MySQL/tuning-primer.sh 


下面安装,演示一下:

1.安装的话,如果能连外网,直接使用如下命令(不能连接外网,就先下来再使用)

 [root@10-9-7-79 test]#  wget http://www.day32.com/MySQL/tuning-primer.sh 

2.给予脚本执行权限:

[root@10-9-7-79 test]# chmod 755 tuning-primer.sh 

3.执行tuning-primer.sh 脚本:

[root@10-9-7-79 test]# ./tuning-primer.sh 

4.下面就是测试结果:[测试结果内容,主要看每个测试结果的最后几行,特别注意内存这块,这块很容易就配置超出内存]

Using login values from ~/.my.cnf
- INITIAL LOGIN ATTEMPT FAILED -
Testing for stored webmin passwords:
None Found
Could not auto detect login info!
Found potential sockets: /tmp/mysql.sock
Using: /tmp/mysql.sock

# 以下这几项需要输入的,相信各位都能看得懂,就不解释
Would you like to provide a different socket?: [y/N] n
Do you have your login handy ? [y/N] : y
User: root
Password: 122345

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.37-log x86_64

Uptime = 5 days 4 hrs 11 min 46 sec
Avg. qps = 0
Total Questions = 13261
Threads Connected = 1

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.5/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 enabled.
Current long_query_time = 1.000000 sec.
You have 1533 out of 13282 that take longer than 1.000000 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is enabled
Binlog sync is not enabled, you could loose binlog records during a server crash

WORKER THREADS
Current thread_cache_size = 512
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 = 1000
Current threads_connected = 1
Historic max_used_connections = 6
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 = 160 M
Current InnoDB data space = 2.10 G
Current InnoDB buffer pool free = 46 %
Current innodb_buffer_pool_size = 4.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 : 4.10 G
Configured Max Per-thread Buffers : 2.31 G
Configured Max Global Buffers : 4.09 G
Configured Max Memory Limit : 6.41 G
Physical Memory : 7.62 G
Max memory limit seem to be within acceptable norms

KEY BUFFER
Current MyISAM index space = 109 K
Current key_buffer_size = 64 M
Key cache miss rate is 1 : 5
Key buffer free ratio = 81 %
Your key_buffer_size seems to be fine

QUERY CACHE
Query cache is enabled
Current query_cache_size = 2 M
Current query_cache_used = 16 K
Current query_cache_limit = 1 M
Current Query cache Memory fill ratio = .82 %
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 = 256 K
Current read_rnd_buffer_size = 256 K
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 0 queries where a join could not use an index properly
Your joins seem to be using indexes properly

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 = 4096 tables
Current table_definition_cache = 4096 tables
You have a total of 183 tables
You have 184 open tables.
The table_cache value seems to be fine

TEMP TABLES
Current max_heap_table_size = 16 M
Current tmp_table_size = 16 M
Of 3294 temp tables, 38% were created on disk
Perhaps you should increase your tmp_table_size and/or max_heap_table_size
to reduce the number of disk-based temporary tables
Note! BLOB and TEXT columns are not allow in memory tables.
If you are using these columns raising these values might not impact your 
ratio of on disk temp tables.

TABLE SCANS
Current read_buffer_size = 512 K
Current table scan ratio = 9703 : 1
You have a high ratio of sequential access requests to SELECTs
You may benefit from raising read_buffer_size and/or improving your use of indexes.

TABLE LOCKING
Current Lock Wait ratio = 0 : 13543
Your table locking seems to be fine


陳述:
本文內容由網友自願投稿,版權歸原作者所有。本站不承擔相應的法律責任。如發現涉嫌抄襲或侵權的內容,請聯絡admin@php.cn