mysql mysqltuner.pl_MySQL参数优化辅助工具_mysqltuner.pl

简单说明(E文水平有限,有误之处,请多指教)

# ./mysqltuner.pl --help

MySQLTuner 1.2.0 - MySQL High Performance Tuning Script

Bug reports, feature requests, and downloads at http://mysqltuner.com/

Maintained by Major Hayden (major@mhtx.net) - Licensed under GPL

Important Usage Guidelines:

To run the script with the default options, run the script without arguments

Allow MySQL server to run for at least 24-48 hours before trusting suggestions

#建议在MySQL服务器运行24-48小时,测试才有依赖性

Some routines may require root level privileges (script will provide warnings)

#对于越权的权限会报警

You must provide the remote server's total memory when connecting to other servers

#当连接其他服务器时,须提供远程服务器的总内存

Connection and Authentication#连接、认证

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

--socket    Use a different socket for a local connection#通常在本机测试时使用

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

--user    Username to use for authentication

--pass    Password to use for authentication

Performance and Reporting Options#性能报告选项

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

#不列举表名以及类型和大小,默认打开,推荐打开此选项

(Recommended for servers with many tables)

-------- Storage Engine Statistics -------------------------------------------

[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster

[--] Data in MyISAM tables: 392K (Tables: 116)

[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)

[!!] InnoDB is enabled but isn't being used

[OK] Total fragmented tables: 0

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

#检查更新,加了该参数效果如下

#[OK] You have the latest version of MySQLTuner

#不加的话

#[--] Skipped version check for MySQLTuner script

--forcemem    Amount of RAM installed in megabytes

--forceswap   Amount of swap memory configured in megabytes

#设置物理内存和swap分区的大小(单位MB),这两个参数一般成对配置

#[--] Assuming 512 MB of physical memory

#[--] Assuming 1024 MB of swap space

Output Options:

#输出显示的参数试一下就清楚了

--nogood             Remove OK responses

--nobad              Remove negative/suggestion responses

--noinfo             Remove informational responses

--nocolor            Don't print output in color

例如

./mysqltuner.pl --socket /var/lib/mysql2/mysql2.sock

……

-------- Performance Metrics -------------------------------------------------

[--] Up for: 23h 37m 18s (542 q [0.006 qps], 176 conn, TX: 442K, RX: 33K)

下面是该程序给的一些修改建议,大家可参考修改。有时间的话,还可以用sysbench进行测试。

-------- Recommendations -----------------------------------------------------

General recommendations:

Add skip-innodb to MySQL configuration to disable InnoDB

MySQL started within last 24 hours - recommendations may be inaccurate

Reduce your overall MySQL memory footprint for system stability

Enable the slow query log to troubleshoot bad queries

Set thread_cache_size to 4 as a starting value

Variables to adjust:

*** MySQL's maximum memory usage is dangerously high ***

*** Add RAM before increasing MySQL buffer variables ***

query_cache_size (>= 8M)

thread_cache_size (start at 4)

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

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

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

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值