MySQLTuner :: High-performance MySQL optimization script

Полезный скрипт для проверки производительности вашей СУБД MySql.
Внимание, перед запуском скрипта убедитесь, что СУБД работает в непрерывном режиме не менее 24 часов.

Скачиваем, устанавливаем и запускаем:

# wget http://github.com/rackerhacker/MySQLTuner-perl/zipball/v1.1.1

Также можно воспользоваться git, чтобы получить последнюю версию:

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

# unzip rackerhacker-MySQLTuner-perl-v1.1.1-0-gb2dfc87.zip

Archive:  rackerhacker-MySQLTuner-perl-v1.1.1-0-gb2dfc87.zip
b2dfc8789a531bbf848237a36fb984e346974e58
   creating: rackerhacker-MySQLTuner-perl-b2dfc87/
  inflating: rackerhacker-MySQLTuner-perl-b2dfc87/LICENSE
  inflating: rackerhacker-MySQLTuner-perl-b2dfc87/README
  inflating: rackerhacker-MySQLTuner-perl-b2dfc87/mysqltuner.pl
# cd rackerhacker-MySQLTuner-perl-b2dfc87/
# chmod u+x mysqltuner.pl
# ./mysqltuner.pl
 >>  MySQLTuner 1.1.1 - Major Hayden <major@mhtx.net>
 >>  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.50-log
[!!] Switch to 64-bit OS - MySQL cannot currently use all of your RAM

-------- Storage Engine Statistics -------------------------------------------
[--] Status: -Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 69M (Tables: 1080)
[--] Data in InnoDB tables: 15M (Tables: 312)
[--] Data in MEMORY tables: 0B (Tables: 2)
[!!] Total fragmented tables: 349

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

-------- Performance Metrics -------------------------------------------------
[--] Up for: 12m 28s (7K q [9.762 qps], 322 conn, TX: 16M, RX: 878K)
[--] Reads / Writes: 97% / 3%
[--] Total buffers: 1.0G global + 4.5M per thread (750 max threads)
[!!] Allocating > 2GB RAM on 32-bit systems can cause system instability
[!!] Maximum possible memory usage: 4.3G (144% of installed RAM)
[!!] Slow queries: 7% (584/7K)
[OK] Highest usage of available connections: 0% (2/750)
[!!] Key buffer size / total MyISAM indexes: 8.0M/20.3M
[!!] Key buffer hit rate: 85.3% (8K cached / 1K reads)
[!!] Query cache efficiency: 18.9% (370 cached / 1K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 60 sorts)
[!!] Joins performed without indexes: 192
[!!] Temporary tables created on disk: 28% (1K on disk / 3K total)
[OK] Thread cache hit rate: 99% (2 created / 322 connections)
[OK] Table cache hit rate: 39% (1K open / 4K opened)
[OK] Open file limit used: 29% (2K/8K)
[OK] Table locks acquired immediately: 100% (2K immediate / 2K locks)
[OK] InnoDB data size / buffer pool: 15.5M/900.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    MySQL started within last 24 hours - recommendations may be inaccurate
    Adjust your join queries to always utilize indexes
    When making adjustments, make tmp_table_size/max_heap_table_size equal
    Reduce your SELECT DISTINCT queries without LIMIT clauses
Variables to adjust:
  *** MySQL's maximum memory usage is dangerously high ***
  *** Add RAM before increasing MySQL buffer variables ***
    key_buffer_size (> 20.3M)
    query_cache_limit (> 1M, or use smaller result sets)
    join_buffer_size (> 2.0M, or always use indexes with joins)
    tmp_table_size (> 16M)
    max_heap_table_size (> 20M)

Related posts:

  1. Включение query cache в MySQL – улучшаем производительность Если выхотите оптимизировать скорость ответа вашего MySQL сервера, тогда вам...
  2. Asterisk – храним CDR в БД MySQL. Asterisk. Настройка. Статья#1. Складываем CDR в MySQL. Должны быть установлены...
You can leave a response, or trackback from your own site.

Оставить комментарий

*