c'e' solo un modo di fare le cose: farle bene
MySQLTuner è uno script Perl che in analizza il server MySQL e suggerisce le impostazioni migliori basandosi sulle statistiche di utilizzo del server.
Premesso che MySQLTuner non fa miracoli ma semplici ottimizzazioni, vediamo come installarlo:
apt-get install mysqltuner
Adesso con un semplice mysqltuner lanciamo il nuovo tool:
>> MySQLTuner 0.9.0 - Major Hayden
>> Bug reports, feature requests, and downloads at http://mysqltuner.com/
>> Run with '--help' for additional options and output filtering
Please enter your MySQL administrative login: root
Please enter your MySQL administrative password:
-------- General Statistics --------------------------------------------------
[!!] There is a new version of MySQLTuner available
[OK] Currently running supported MySQL version 5.0.51a-24+lenny4-log
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 4M (Tables: 1311)
[--] Data in InnoDB tables: 300M (Tables: 2275)
-------- Performance Metrics -------------------------------------------------
[--] Up for: 17h 28m 59s (6M q [97.770 qps], 18K conn, TX: 11B, RX: 1B)
[--] Reads / Writes: 84% / 16%
[--] Total buffers: 2.6M per thread and 106.0M global
[OK] Maximum possible memory usage: 368.5M (9% of installed RAM)
[OK] Slow queries: 0% (2/6M)
[OK] Highest usage of available connections: 11% (11/100)
[OK] Key buffer size / total MyISAM indexes: 16.0M/4.7M
[OK] Key buffer hit rate: 99.2%
[OK] Query cache efficiency: 93.5%
[!!] Query cache prunes per day: 362758
[OK] Sorts requiring temporary tables: 0%
[!!] Joins performed without indexes: 5599
[!!] Temporary tables created on disk: 78%
[OK] Thread cache hit rate: 99%
[!!] Table cache hit rate: 0%
[OK] Open file limit used: 0%
[OK] Table locks acquired immediately: 100%
[!!] InnoDB data size / buffer pool: 300.1M/8.0M
-------- Recommendations -----------------------------------------------------
General recommendations:
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
When making adjustments, make tmp_table_size/max_heap_table_size equal
Reduce your SELECT DISTINCT queries without LIMIT clauses
Increase table_cache gradually to avoid file descriptor limits
Variables to adjust:
query_cache_size (> 64M)
join_buffer_size (> 128.0K, or always use indexes with joins)
tmp_table_size (> 32M)
max_heap_table_size (> 16M)
table_cache (> 128)
innodb_buffer_pool_size (>= 300M)
Il risultato è più che eplicito.
MySQLTuner mi dice che vanno aggiunte o modificati i valori, delle seguenti variabili:
query_cache_size (> 64M)
join_buffer_size (> 128.0K, or always use indexes with joins)
tmp_table_size (> 32M)
max_heap_table_size (> 16M)
table_cache (> 128)
innodb_buffer_pool_size (>= 300M)
Edito il file di configurazione di MySQL (in Debian /etc/mysql/my.cnf) e lo modifico come suggerito.
Fatta la modifica va ovviamente riavviato il servizio MySQL.
Vedete miglioramenti?
RT @lddio: La mafia teme più la scuola della giustizia. L'istruzione toglie erba sotto i piedi della cultura mafiosa. (A. Caponnetto, 19 ... [gianlucagentile]
RT @gzaffagnini: @riotta Dio accolga coloro che lo #Stato non riesce a proteggere [gianlucagentile]
RT @donati_giacomo: Solo delle Merde possono piazzare una bomba davanti una scuola! #brindisi [gianlucagentile]
Powered by Lifestream.