mysql性能优化脚本mysqltuner.pl使用介绍

 更新时间:2013年02月24日 23:45:56   作者:  
无意中发现了,major哥们开发的一个性能分析脚本,很有意思,可以通过这个脚本学学他的思想

MySQLTuner 下载地址:http://github.com/rackerhacker/MySQLTuner-perl

MySQLTuner 使用方法:
Downloading and using MySQLTuner is actually a very simple process:

wget mysqltuner.pl
perl mysqltuner.pl

If you'd rather not invoke perl every time, just make it executable:

chmod u+x mysqltuner.pl
./mysqltuner.pl

» Latest development version
If you want to get the bleeding edge commits, you can check out the latest code with git:

git clone git://github.com/rackerhacker/MySQLTuner-perl.git

看看我的运行结果

复制代码 代码如下:

>> MySQLTuner 1.1.1 - Major Hayden
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.1.43-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated -InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 889M (Tables: 479)
[--] Data in MEMORY tables: 1M (Tables: 4)
[!!] Total fragmented tables: 29

-------- Security Recommendations -------------------------------------------
[OK] All database users have passwords assigned

-------- Performance Metrics -------------------------------------------------
[--] Up for: 12h 55m 27s (4M q [105.230 qps], 295K conn, TX: 9B, RX: 546M)
[--] Reads / Writes: 82% / 18%
[--] Total buffers: 432.0M global + 6.3M per thread (500 max threads)
[!!] Maximum possible memory usage: 3.5G (175% of installed RAM)
[OK] Slow queries: 0% (48K/4M)
[OK] Highest usage of available connections: 3% (16/500)
[OK] Key buffer size / total MyISAM indexes: 384.0M/332.6M
[OK] Key buffer hit rate: 100.0% (2B cached / 205K reads)
[OK] Query cache efficiency: 49.3% (1M cached / 3M selects)
[!!] Query cache prunes per day: 268042
[OK] Sorts requiring temporary tables: 0% (10 temp sorts / 122K sorts)
[OK] Temporary tables created on disk: 19% (4K on disk / 22K total)
[OK] Thread cache hit rate: 99% (16 created / 295K connections)
[!!] Table cache hit rate: 18% (256 open / 1K opened)
[OK] Open file limit used: 19% (497/2K)
[!!] Table locks acquired immediately: 88%

-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
Reduce your overall MySQL memory footprint for system stability
Increase table_cache gradually to avoid file descriptor limits
Optimize queries and/or use InnoDB to reduce lock wait
Variables to adjust:
*** MySQL's maximum memory usage is dangerously high ***
*** Add RAM before increasing MySQL buffer variables ***
query_cache_size (> 32M)
table_cache (> 256)

相关文章

  • Mysql查询数据库或数据表中的数据量以及数据大小

    Mysql查询数据库或数据表中的数据量以及数据大小

    许多数据库的元数据都是存储在mysql中的,本文主要介绍了Mysql查询数据库或数据表中的数据量以及数据大小,文中通过示例代码介绍的非常详细,需要的朋友们下面随着小编来一起学习学习吧
    2024-02-02
  • mysql 忘记密码的解决方法(linux和windows小结)

    mysql 忘记密码的解决方法(linux和windows小结)

    下面是linux和windows下mysql丢失密码的解决办法
    2008-12-12
  • 详解MySQL 数据分组

    详解MySQL 数据分组

    这篇文章主要介绍了MySQL 数据分组的相关资料,帮助大家更好的理解和使用MySQL,感兴趣的朋友可以了解下
    2020-12-12
  • MySQL中Binlog日志的使用方法详细介绍

    MySQL中Binlog日志的使用方法详细介绍

    MySQL的binlog(二进制日志)是一种记录MySQL服务器所有更改的二进制日志文件,下面这篇文章主要给大家介绍了关于MySQL中Binlog日志的使用方法,文中通过代码介绍的非常详细,需要的朋友可以参考下
    2024-02-02
  • Navicat for MySQL的使用教程详解

    Navicat for MySQL的使用教程详解

    本文给大家介绍Navicat for MySQL的使用教程,本文通过图文实例相结合给大家介绍的非常详细,对大家的学习或工作具有一定的参考借鉴价值,需要的朋友跟随小编一起学习下吧
    2021-05-05
  • MySQL并行DDL的实现方法

    MySQL并行DDL的实现方法

    本文详细介绍了MySQL8.0.27并行DDL的实现方法,文中通过示例代码介绍的非常详细,对大家的学习或者工作具有一定的参考学习价值,需要的朋友们下面随着小编来一起学习学习吧
    2024-10-10
  • 使用PDO防sql注入的原理分析

    使用PDO防sql注入的原理分析

    这篇文章主要给大家介绍了关于使用PDO防sql注入的原理的相关资料,文中还给大家介绍了使用PDO的注意事项,通过示例代码介绍的非常详细,需要的朋友可以参考借鉴,下面随着小编来一起学习学习吧
    2018-12-12
  • SQL如何获取目标时间点或日期的方法实例

    SQL如何获取目标时间点或日期的方法实例

    日期获取在我们日常开发中经常会遇到,这篇文章主要给大家介绍了关于SQL如何获取目标时间点或日期的相关资料,文中通过实例代码介绍的非常详细,需要的朋友可以参考下
    2022-10-10
  • 深入理解Mysql的四种隔离级别

    深入理解Mysql的四种隔离级别

    开发工作中我们会使用到事务,那你们知道事务又分哪几种吗?MYSQL标准定义了4类隔离级别,用来限定事务内外的哪些改变是可见的,哪些是不可见的。低的隔离级一般支持更高的并发处理,并拥有更低的系统开销。下面通过这篇文章我们来一起深入理解Mysql中的四种隔离级别。
    2016-11-11
  • MySQL字符集中文乱码解析

    MySQL字符集中文乱码解析

    这篇文章主要给大家解析了MySQL字符集中文乱码的问题,文章通过代码示例讲解的非常详细,对我们的学习或工作有一定的帮助,需要的朋友可以参考下
    2023-09-09

最新评论