Mysql配置诊断和优化

时间:2013-10-15 11:56:20

标签: mysql

我们在专用服务器上运行Magento。我运行了一个perl脚本mysqloptimizer,以了解我们是否需要进行调整。这些是结果。我不是那样进入MYSQL配置,有人可以给我一些关于如何优化配置的建议吗?我觉得目前的设置没有最佳设置。

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

- [--] Up for: 2h 58m 40s (321K q [29.965 qps], 1K conn, TX: 405M, RX: 112M)
- [--] Reads / Writes: 63% / 37%
- [--] Total buffers: 2.1G global + 2.9M per thread (500 max threads)
- [!!] Maximum possible memory usage: 3.5G (91% of installed RAM)
- [OK] Slow queries: 0% (2/321K)
- [OK] Highest usage of available connections: 1% (6/500)
- [OK] Key buffer size / total MyISAM indexes: 8.0M/1.4M
- [OK] Key buffer hit rate: 99.2% (251K cached / 2K reads)
- [OK] Query cache efficiency: 77.3% (210K cached / 272K selects)
- [!!] Query cache prunes per day: 46109
- [OK] Sorts requiring temporary tables: 0% (0 temp sorts / 17K sorts)
- [!!] Joins performed without indexes: 44
- [OK] Temporary tables created on disk: 16% (5K on disk / 30K total)
- [OK] Thread cache hit rate: 99% (6 created / 1K connections)
- [!!] Table cache hit rate: 1% (128 open / 6K opened)
- [OK] Open file limit used: 0% (2/2K)
- [OK] Table locks acquired immediately: 100% (174K immediate / 174K locks)
- [OK] InnoDB data size / buffer pool: 365.1M/2.0G

-------- 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

    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:

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

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

    query_cache_size (> 64M)

    join_buffer_size (> 256.0K, or always use indexes with joins)

    table_cache (> 128)

这里是当前的配置变量

local-infile=0
max_allowed_packet=16M
query_cache_size=64M
join_buffer_size=256K
tmp_table_size=16M
max_heap_table_size=64M
innodb_buffer_pool_size=2048M
innodb_additional_mem_pool_size=20M
innodb_lock_wait_timeout=500
thread_cache_size=16
wait_timeout=120
max_connections=500
table_cache=128

0 个答案:

没有答案