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

时间:2024-01-17 16:37:02 

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)

标签:mysqltuner
0
投稿

猜你喜欢

  • 30步检查SQL Server安全列表

    2008-12-18 14:28:00
  • 安全校验Session验证码并避免绕开验证码攻击

    2022-06-30 20:15:41
  • 解决Python3.8运行tornado项目报NotImplementedError错误

    2023-08-17 10:15:23
  • Python的迭代器和生成器

    2022-04-29 17:56:09
  • python logging日志模块的详解

    2021-04-27 19:16:55
  • python中的lambda表达式用法详解

    2022-12-01 17:33:57
  • javascript给span标签赋值的方法

    2023-09-05 21:28:53
  • 一千行的MySQL学习笔记汇总

    2024-01-27 22:04:42
  • pymysql之cur.fetchall() 和cur.fetchone()用法详解

    2024-01-15 14:31:50
  • Python科学画图代码分享

    2023-08-19 07:06:25
  • python使用tornado实现简单爬虫

    2022-07-07 12:03:08
  • python编码最佳实践之总结

    2023-02-07 21:04:44
  • MySQL数据库的事务和索引详解

    2024-01-21 00:40:48
  • Python个人博客程序开发实例信息显示

    2022-07-06 15:31:05
  • Python GUI布局尺寸适配方法

    2022-03-07 05:52:26
  • MySQL数据库本地备份和双机相互备份

    2008-05-27 12:25:00
  • Mysql字符串截取函数SUBSTRING的用法说明

    2024-01-24 14:53:51
  • python基础面试题整理

    2023-11-03 02:09:45
  • Python运行出现DeprecationWarning的问题及解决

    2022-01-14 05:26:23
  • Google的产品设计指导思想

    2008-03-23 14:15:00
  • asp之家 网络编程 m.aspxhome.com