mysql性能优化工具--tuner-primer使用介绍

 更新时间:2016年05月29日 23:31:58   投稿:mdxy-dxy  
这篇文章主要介绍了mysql性能优化工具--tuner-primer的使用方法与返回数据分析,需要的朋友可以参考下

下载并改变执行权限:
wget http://www.day32.com/MySQL/tuning-primer.sh
chmod +x tuning-primer.sh
./tuning-primer.sh

结果报告:
会用几种颜色标记:
蓝色:总指标
绿色:表示此参数还可以
红色:表示此参数有严重问题
深红色:表示有问题参数
黄色:一些信息提示
而且还有警告:
Note! This script will still suggest raising the join_buffer_size when
ANY joins not using indexes are found.


下面是一个报告的结果

xx@xxxxxx:~$ . ./tuning-primer.sh
mysqld is alive

-- MYSQL PERFORMANCE TUNING PRIMER --
- By: Matthew Montgomery -

MySQL Version 5.1.32-enterprise-gpl-log x86_64

Uptime = 4 days 0 hrs 48 min 3 sec
Avg. qps = 255
Total Questions = 88956118
Threads Connected = 4

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.1/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 = 10.000000 sec.
You have 9589 out of 88956228 that take longer than 10.000000 sec. to complete
Your long_query_time seems to be fine

BINARY UPDATE LOG
The binary update log is enabled
The expire_logs_days is not set.
The mysqld will retain the entire binary log until RESET MASTER or PURGE MASTER LOGS commands are run manually
Setting expire_logs_days will allow you to remove old binary logs automatically
See http://dev.mysql.com/doc/refman/5.1/en/purge-master-logs.html


WORKER THREADS
Current thread_cache_size = 32
Current threads_cached = 29
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 = 4
Historic max_used_connections = 84
The number of used connections is 55% of the configured maximum.
Your max_connections variable seems to be fine.

MEMORY USAGE
Max Memory Ever Allocated : 11.87 G
Configured Max Per-thread Buffers : 10.38 G
Configured Max Global Buffers : 6.10 G
Configured Max Memory Limit : 16.48 G
Physical Memory : 8.00 G

Max memory limit exceeds 90% of physical memory

(内存设置严重有问题!--By Me)

KEY BUFFER
1714734 * 1024 / 2147483648 * 100
Current MyISAM index space = 8 K
Current key_buffer_size = 2.00 G
Key cache miss rate is 1 : 585673
Key buffer free ratio = 0 %
Your key_buffer_size seems to be too high.
Perhaps you can use these resources elsewhere



(错误参数设置:query_cache_size > query_cache_limit --By Me)
SORT OPERATIONS
Current sort_buffer_size = 4 M
Current read_rnd_buffer_size = 64 M
Sort buffer seems to be fine

JOINS
Current join_buffer_size = 132.00 K
You have had 1 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.

join_buffer_size设置过小,另外存在一个查询使用了join但是没有走索引 --By Me

OPEN FILES LIMIT
Current open_files_limit = 1185 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 = 512 tables
Current table_definition_cache = 256 tables
You have a total of 0 tables
You have 125 open tables.


TABLE SCANSCurrent read_buffer_size = 2 M
Current table scan ratio = 4650 : 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 = 1 : 5833374
Your table locking seems to be fine

相关文章

  • mysql数据库的内外连接

    mysql数据库的内外连接

    这篇文章主要介绍了mysql数据库的内外连接,内连接实际上就是利用where子句对两种表形成的笛卡儿积进行筛选,我们前面学习的查询都是内连接,也是在开发过程中使用的最多的连接查询,需要的朋友可以参考下
    2023-07-07
  • 超越MySQL 对流行数据库进行分支的知识小结

    超越MySQL 对流行数据库进行分支的知识小结

    尽管MySQL是最受欢迎的程序之一,但是许多开发人员认为有必要将其拆分成其他项目,并且每个分支项目都有自己的专长。该需求,以及 Oracle 对核心产品增长缓慢的担忧,导致出现了许多开发人员感兴趣的子项目和分支
    2012-01-01
  • MySQL Online DDL原理解析

    MySQL Online DDL原理解析

    MySQL原生OnlineDDL通过允许在表可用的情况下执行DDL操作,大大提升了数据库的可用性,通过不同的执行算法,如COPY、INPLACE和INSTANT,它支持在线修改数据库结构,优化了数据库维护流程,本文给大家介绍MySQL Online DDL原理,感兴趣的朋友跟随小编一起看看吧
    2024-10-10
  • MySql8 WITH RECURSIVE递归查询父子集的方法

    MySql8 WITH RECURSIVE递归查询父子集的方法

    这篇文章主要介绍了MySql8 WITH RECURSIVE递归查询父子集的方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2020-12-12
  • nacos只支持mysql的原因分析

    nacos只支持mysql的原因分析

    nacos的数据源获取都是通过com.alibaba.nacos.config.server.service.datasource.DynamicDataSource来获取的,在获取数据源时,根据配置判断你到底是使用内置的本地数据库还是外部的数据库(mysql),本文给大家详细介绍,需要的朋友可以参考下
    2022-01-01
  • MySQL中如何将字符串替换简单示例

    MySQL中如何将字符串替换简单示例

    mysql是一种常用的关系型数据库管理系统,它提供了多种函数来处理和操作数据,下面这篇文章主要给大家介绍了关于MySQL中如何将字符串替换的相关资料,需要的朋友可以参考下
    2024-07-07
  • mysql中使用date_add()函数讲解

    mysql中使用date_add()函数讲解

    这篇文章主要介绍了mysql中使用date_add()函数讲解,具有很好的参考价值,希望对大家有所帮助。如有错误或未考虑完全的地方,望不吝赐教
    2023-02-02
  • MySQL 普通索引和唯一索引的区别详解

    MySQL 普通索引和唯一索引的区别详解

    这篇文章主要介绍了MySQL 普通索引和唯一索引的区别详解,帮助大家更好的理解和学习使用MySQL,感兴趣的朋友可以了解下
    2021-03-03
  • MySQL入门(一) 数据表数据库的基本操作

    MySQL入门(一) 数据表数据库的基本操作

    这类文章记录我看MySQL5.6从零开始学》这本书的过程,将自己觉得重要的东西记录一下,并有可能帮助到你们,在写的博文前几篇度会非常基础,只要动手敲,跟着我写的例子全部实现一遍,基本上就搞定了,前期很难理解的东西基本没有
    2018-07-07
  • mysql5.7.20第一次登录失败的快速解决方法

    mysql5.7.20第一次登录失败的快速解决方法

    这篇文章主要介绍了mysql5.7.20第一次登录失败的快速解决方法,需要的朋友可以参考下
    2018-09-09

最新评论