mysqltuner推荐建议

时间:2015-05-18 18:34:48

标签: mysql database tunneling mysqltuner

问题:每当我运行mysqltuner时,它总会抱怨三个组件,即使我将其值更改为高但仍显示需要更多,他们正在关注,我有表MyISAM和{{1}我们也加入了等等但是我听说将InnoDB值设置得更高是不好的,下面是框的详细信息,请建议我的盒子是否可以调整?

join_buffer_size

硬件: Variables to adjust: query_cache_size (> 128M) join_buffer_size (> 4.0M, or always use indexes with joins) table_cache (> 512) 40 CPUs

MySQL: 64 GB Memory

my.cnf

mysql-5.1.73-3.el6_5.x86_64

mysqltunner

[mysqld]
datadir=/var/lib/mysql
socket=/var/lib/mysql/mysql.sock
user=mysql
symbolic-links=0
bind-address    = 0.0.0.0

max_connections = 1000


max_allowed_packet=32M
join_buffer_size=4M
thread_cache_size=8

query_cache_limit=4M
query_cache_size=128M
thread_cache_size=4
table_cache=512
key_buffer_size=2G

innodb-buffer-pool-size = 16G
open-files-limit = 35535
sort_buffer_size = 6M
query-cache-type = 1

tmp_table_size=1G
innodb_log_buffer_size=1G

server-id=1
binlog-format   = mixed
log-bin=mysql-bin
datadir=/var/lib/mysql
innodb_flush_log_at_trx_commit=1
sync_binlog=1

[mysqld_safe]
log-error=/var/log/mysqld.log
pid-file=/var/run/mysqld/mysqld.pid

状态

-------- Performance Metrics -------------------------------------------------
[--] Up for: 18h 33m 52s (121M q [1K qps], 4M conn, TX: 32B, RX: 16B)
[--] Reads / Writes: 99% / 1%
[--] Total buffers: 19.1G global + 10.6M per thread (1000 max threads)
[OK] Maximum possible memory usage: 29.5G (46% of installed RAM)
[OK] Slow queries: 0% (4/121M)
[OK] Highest usage of available connections: 8% (88/1000)
[OK] Key buffer size / total MyISAM indexes: 2.0G/1.7G
[OK] Key buffer hit rate: 99.4% (15M cached / 90K reads)
[OK] Query cache efficiency: 71.1% (75M cached / 106M selects)
[!!] Query cache prunes per day: 27253282
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 21M sorts)
[!!] Joins performed without indexes: 12267
[OK] Temporary tables created on disk: 3% (1K on disk / 49K total)
[OK] Thread cache hit rate: 99% (1K created / 4M connections)
[!!] Table cache hit rate: 1% (365 open / 21K opened)
[OK] Open file limit used: 1% (449/35K)
[OK] Table locks acquired immediately: 99% (30M immediate / 30M locks)
[OK] InnoDB data size / buffer pool: 115.6M/16.0G

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Enable the slow query log to troubleshoot bad queries
    Adjust your join queries to always utilize indexes
    Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
    query_cache_size (> 128M)
    join_buffer_size (> 4.0M, or always use indexes with joins)
    table_cache (> 512)

注意:我们每晚都在运行mysqldump。

1 个答案:

答案 0 :(得分:0)

mysqltuner正在输出: MySQL在过去24小时内启动 - 建议可能不准确

请确保,已经提出要求确保mysqltuner正确地建议您。