mysql调优工具

下载地址:

https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl

直接使用

wget https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl

下载即可。

chmod +x mysqltuner.pl

./mysqltuner.pl 然后输入用户名和密码即可。

下图是我一台线上服务器的检测结果。

浏览输出的结果,特别是末尾的 Recommendations ,里面一般会提到您需要在 my.cnf 修改的内容。修改 my.cnf 后记得重启 MySQL 。重启后再运行 MySQLTuner 检查。

另外需要注意的是 MySQL 需要启动 24 小时候再运行 MySQLTuner ,不然有些内容会不准。

另外,./mysqltuner.pl --help 能显示支持哪些参数。

Connection and Authentication

--host <hostname>    Connect to a remote host to perform tests (default: localhost)

--socket <socket>    Use a different socket for a local connection

--port <port>        Port to use for connection (default: 3306)

--user <username>    Username to use for authentication

--pass <password>    Password to use for authentication

--defaults-file <path>  Path to a custom .my.cnf

--mysqladmin <path>  Path to a custom mysqladmin executable

--mysqlcmd <path>    Path to a custom mysql executable

--noask              Don‘t ask password if needed

Performance and Reporting Options

--skipsize           Don‘t enumerate tables and their types/sizes (default: on)

(Recommended for servers with many tables)

--skippassword       Don‘t perform checks on user passwords(default: off)

--checkversion       Check for updates to MySQLTuner (default: don‘t check)

--updateversion      Check for updates to MySQLTuner and update when newer version is available (default: don‘t check)

--forcemem <size>    Amount of RAM installed in megabytes

--forceswap <size>   Amount of swap memory configured in megabytes

--passwordfile <path>Path to a password file list(one password by line)

Output Options:

--silent             Don‘t output anything on screen

--nogood             Remove OK responses

--nobad              Remove negative/suggestion responses

--noinfo             Remove informational responses

--debug              Print debug information

--dbstat             Print database information

--idxstat            Print index information

--sysstat            Print system information

--pfstat             Print Performance schema information

--bannedports        Ports banned separated by comma(,)

--maxportallowed     Number of ports opened allowed on this hosts

--cvefile            CVE File for vulnerability checks

--nocolor            Don‘t print output in color

--json               Print result as JSON string

--prettyjson         Print result as human readable JSON

--buffers            Print global and per-thread buffer values

--outputfile <path>  Path to a output txt file

--reportfile <path>  Path to a report txt file

--template   <path>  Path to a template file

--verbose            Prints out all options (default: no verbose)

例如我有1台服务器,上面跑的是多实例的mysql上面,体检的话,需要使用

./mysqltuner.pl --socket /data/multi_instance/3306/mysql.sock

时间: 2024-08-09 00:21:24

mysql调优工具的相关文章

mysql性能瓶颈分析、性能指标、指标搜集方法与性能分析调优工具

本文主要讲解mysql的性能瓶颈分析.性能指标.性能指标信息的搜集工具与方法.分析调优工具的使用. 文章尚未完成. 性能瓶颈: 慢.写速度比读速度慢很多  主要的性能指标: 访问频度, 并发连接量, 缓存命中率, index使用, slow log开启与分析, query Log,查询log Threads_cached:连接线程缓存是否开启  -> ONthread_cache_size :线程缓存数的大小query_cache_size: 查询缓存大小join_buffer_size :jo

mysql性能调优工具之mytop

Mysql性能调优工具之mytop 的安装和使用 1.       mytop 的下载地址 http://yunpan.cn/cVG3uSs2Jtt9h  访问密码 7ef1 2.       首先安装mytop必要的组件 .   yum -y install perl-DBD-MySQL perl-DBIperl-TermReadKey 如果提示找不到安装包,可以先安装 Yum –y install  epel-release epel-release 这个可以使用到最新的yum源. 如果安装

MySQL 调优/优化的 100 个建议

MySQL 调优/优化的 100 个建议 提交 我的评论 加载中 已评论 MySQL 调优/优化的 100 个建议 2015-07-08 数据库开发 数据库开发 数据库开发 微信号 DBDevs 功能介绍 分享数据库相关技术文章.教程和工具,另外还包括数据库相关的工作.偶尔也谈谈程序员人生 :) (点击上方蓝字,快速关注我们) (编注:本文写于 2011 年) MySQL是一个强大的开源数据库.随着MySQL上的应用越来越多,MySQL逐渐遇到了瓶颈.这里提供 101 条优化 MySQL 的建议

性能调优工具

[性能调优工具jps.jstack.jmap.jhat.jstat.hprof使用详解]http://my.oschina.net/feichexia/blog/196575 现实企业级Java开发中,有时候我们会碰到下面这些问题: OutOfMemoryError,内存不足 内存泄露 线程死锁 锁争用(Lock Contention) Java进程消耗CPU过高 这些问题在日常开发中可能被很多人忽视(比如有的人遇到上面的问题只是重启服务器或者调大内存,而不会深究问题根源),但能够理解并解决这些

mysql 调优

转载:http://blog.csdn.net/yananwang/article/details/7030029 今天开始学习mysql调优啦 (偶那东一榔头西一棒子的学习历程的又一棒子) 好啦,言归正传: 首先,mysql调优有三个主要的方式,由低到高分别是: 1.硬件调优 2.修改mysql进程 3.优化mysql查询 一.硬件调优 先看看硬件调优吧.这个有两方面你可以考虑,首先对现有硬件条件进行修复,能调整的调整,能替换的替换,例如你可以把中央处理器(CPU)或磁盘速度加倍,也可以让内存

mysql调优

MySQL调优可以从几个方面来做:1. 架构层:做从库,实现读写分离: 2.系统层次:增加内存:给磁盘做raid0或者raid5以增加磁盘的读写速度:可以重新挂载磁盘,并加上noatime参数,这样可以减少磁盘的i/o; 3. MySQL本身调优:(1) 如果未配置主从同步,可以把bin-log功能关闭,减少磁盘i/o(2) 在my.cnf中加上skip-name-resolve,这样可以避免由于解析主机名延迟造成mysql执行慢(3) 调整几个关键的buffer和cache.调整的依据,主要根

Perf Event :Linux下的系统性能调优工具

Perf Event :Linux下的系统性能调优工具 2011-05-27 10:35 刘 明 IBMDW 字号:T | T Perf Event 是一款随 Linux 内核代码一同发布和维护的性能诊断工具,由内核社区维护和发展.Perf 不仅可以用于应用程序的性能统计分析,也可以应用于内核代码的性能统计和分析.得益于其优秀的体系结构设计,越来越多的新功能被加入 Perf,使其已经成为一个多功能的性能统计工具集 .本文将介绍 Perf 在应用程序开发上的应用. AD:2014WOT全球软件技术

[转]Linux常用性能调优工具索引

From:http://www.frostsky.com/2013/03/linux-performance-analysis-tool?wpmp_switcher=desktop 前段时间看到brendangregg的 Linux Performance Analysis and Tools PPT里面提到Linux常用性能调优工具, 见下图: 其中提到了的工具,大部分在我日常工具箱里或者在实践的案例里面使用过, 都有很高的价值,这里方便大家索引下: nicstat: 参见 这里 oprofi

Android系统性能调优工具介绍

经作者授权,发表Tieto某青年牛的一篇<程序员>大作. Android系统性能调优工具介绍 在软件开发过程中,想必很多读者都遇到过系统性能问题.而解决系统性能问题的几个主要步骤是: 测评:对系统进行大量有针对性的测试,以得到合适的测试数据. 分析系统瓶颈:分析测试数据,找到其中的hotspot(热点,即bottleneck). 性能优化:对hotspot相关的代码进行优化. 由上述步骤可知,性能优化的目标对象是hotspot.如果找到的hotspot并非真正的热点,则性能优化的结果必然是事倍