mysql提供_MYSQL官方提供这个脚本实在是太好了

地址:

[url]http://www.day32.com/MySQL/[/url]

我的测试机器运行结果。

[root@localhost david_yeung]# ./tuning-primer.sh all|more

-- MYSQL PERFORMANCE TUNING PRIMER --

- By: Matthew Montgomery -

MySQL Version 5.0.45-log i686

Uptime = 15 days 1 hrs 24 min 34 sec

Avg. qps = 1

Total Questions = 2088868

Threads Connected = 13

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:

[url]http://dev.mysql.com/doc/refman/[/url] ... stem-variables.html

Visit [url]http://www.mysql.com/products/enterprise/advisors.html[/url]

for info about MySQL's Enterprise Monitoring and Advisory Service

SLOW QUERIES

The slow query log is enabled.

Current long_query_time = 1 sec.

You have 144295 out of 2088889 that take longer than 1 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 = 32

Current threads_cached = 19

Current threads_per_sec = 0

Historic threads_per_sec = 0

Your thread_cache_size is fine

MAX CONNECTIONS

Current max_connections = 100

Current threads_connected = 13

Historic max_used_connections = 32

The number of used connections is 32% of the configured maximum.

Your max_connections variable seems to be fine.

MEMORY USAGE

Max Memory Ever Allocated : 998 M

Configured Max Per-thread Buffers : 633 M

Configured Max Global Buffers : 796 M

Configured Max Memory Limit : 1 G

Physical Memory : 946.57 M

Max memory limit exceeds 90% of physical memory

KEY BUFFER

Current MyISAM index space = 157 M

Current key_buffer_size = 256 M

Key cache miss rate is 1 : 464

Key buffer fill ratio = 2.00 %

Your key_buffer_size seems to be too high.

Perhaps you can use these resources elsewhere

QUERY CACHE

Query cache is enabled

Current query_cache_size = 256 M

Current query_cache_used = 18 M

Current query_cache_limit = 64 M

Current Query cache Memory fill ratio = 7.37 %

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 = 3 M

Sort buffer seems to be fine

JOINS

Current join_buffer_size = 132.00 K

You have had 2 queries where a join could not use an index properly

You have had 2 joins without keys that check for key usage after each row

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 = 1024 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_cache value = 512 tables

You have a total of 472 tables

You have 473 open tables.

The table_cache value seems to be fine

TEMP TABLES

Current max_heap_table_size = 64 M

Current tmp_table_size = 64 M

Of 50784 temp tables, 23% were created on disk

Created disk tmp tables ratio seems fine

TABLE SCANS

Current read_buffer_size = 1020 K

Current table scan ratio = 738 : 1

read_buffer_size seems to be fine

TABLE LOCKING

Current Lock Wait ratio = 1 : 11710

Your table locking seems to be fine

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值