Como optimizar MySQL/MariaDB

Existe un excelente script que nos permite determinar fácil y rápidamente que valores de la configuración de MySQL/MariaDB deben ser optimizados, esto nos ayudará a extraer el máximo rendimiento de nuestras bases de datos, el script es mysqltuner y su instalación es servidores Linux es extremadamente sencilla:

cd /sbin
rm -f mysqltuner.pl
wget -N --no-check-certificate https://raw.githubusercontent.com/major/MySQLTuner-perl/master/mysqltuner.pl
chmod 700 mysqltuner.pl
./mysqltuner.pl

La salida será algo como:

>> MySQLTuner 1.6.0 - Major Hayden <major@mhtx.net>
 >> Bug reports, feature requests, and downloads at http://mysqltuner.com/
 >> Run with '--help' for additional options and output filtering
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 10.0.21-MariaDB-log
[OK] Operating on 64-bit architecture
-------- Storage Engine Statistics -------------------------------------------
[--] Status: +ARCHIVE +Aria +BLACKHOLE +CSV +FEDERATED +InnoDB +MRG_MyISAM 
[--] Data in MyISAM tables: 226M (Tables: 88)
[--] Data in InnoDB tables: 296M (Tables: 251)
[!!] Total fragmented tables: 8
-------- Security Recommendations -------------------------------------------
[OK] There is no anonymous account in all database users
[OK] All database users have passwords assigned
[!!] There is not basic password file list !
-------- Performance Metrics -------------------------------------------------
[--] Up for: 1m 32s (5K q [62.250 qps], 253 conn, TX: 6M, RX: 799K)
[--] Reads / Writes: 90% / 10%
[--] Binary logging is disabled
[--] Total buffers: 984.0M global + 4.7M per thread (151 max threads)
[OK] Maximum reached memory usage: 1002.6M (24.48% of installed RAM)
[OK] Maximum possible memory usage: 1.6G (41.19% of installed RAM)
[OK] Slow queries: 0% (0/5K)
[OK] Highest usage of available connections: 2% (4/151)
[OK] Aborted connections: 1.58% (4/253)
[OK] Query cache efficiency: 44.4% (3K cached / 8K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (0 temp sorts / 84 sorts)
[!!] Joins performed without indexes: 46
[OK] Temporary tables created on disk: 2% (6 on disk / 213 total)
[OK] Thread cache hit rate: 98% (4 created / 253 connections)
[OK] Table cache hit rate: 185% (137 open / 74 opened)
[OK] Open file limit used: 0% (31/50K)
[OK] Table locks acquired immediately: 100% (1K immediate / 1K locks)
-------- MyISAM Metrics -----------------------------------------------------
[!!] Key buffer used: 18.4% (24M used / 134M cache)
[OK] Key buffer size / total MyISAM indexes: 128.0M/117.5M
[!!] Read Key buffer hit rate: 62.0% (400 cached / 152 reads)
[!!] Write Key buffer hit rate: 0.0% (143 cached / 143 writes)
-------- InnoDB Metrics -----------------------------------------------------
[--] InnoDB is enabled.
[OK] InnoDB buffer pool / data size: 512.0M/296.3M
[OK] InnoDB buffer pool instances: 1
[!!] InnoDB Used buffer: 4.65% (1523 used/ 32767 total)
[OK] InnoDB Read buffer efficiency: 99.17% (163125 hits/ 164484 total)
[!!] InnoDB Write buffer efficiency: 0.00% (0 hits/ 1 total)
[OK] InnoDB log waits: 0.00% (0 waits / 309 writes)
-------- AriaDB Metrics -----------------------------------------------------
[--] AriaDB is disabled.
-------- Replication Metrics -------------------------------------------------
[--] No replication slave(s) for this server.
[--] This is a standalone server..
-------- 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
Variables to adjust:
 join_buffer_size (> 2.0M, or always use indexes with joins)

En la sección “Recommendations” nos ofrecerá los valores que debemos agregar o cambiar en el archivo /etc/my.cnf

NOTA: Todos nuestros servicios son 100% administrados por lo cual Usted NO tiene necesidad de realizar estos cambios, basta con solicitar a soporte técnico que optimicen MySQL por Usted

Last Update: junio 15, 2017  

mayo 11, 2017   1481   DATA-Guille    MySQL Y MariaBD    
Total 1 Votos
0

Tell us how can we improve this post?

+ = Verify Human or Spambot ?

Dejar un Comentario