Hace algún tiempo buscando como optimizar nuestro servidor MySQL encontré MySQLTuner, un pequeño script para optimizar la configuración del servidor, guiándote sobre cuales valores debes modificar. MySQLTuner fue desarrollado principalmente por Major Hayden quién es DBA Certificado por MySQL y trabaja como Ingeniero en Rackspace, popular empresa de hosting.

Hay que recalcar que no se deben seguir las recomendaciones de MySQLTuner al pie de la letra, se da el caso que te recomienda aumentar más el uso de memoria en algún buffer y tal vez el servidor ya no tiene más RAM, o esta es compartida con otros servicios y el OS. El siguiente es un reporte generador por MySQLTuner:

# ./mysqltuner.pl 

 >>  MySQLTuner 0.9.9 - Major Hayden 
 >>  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.0.67-community
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster 
[--] Data in MyISAM tables: 5G (Tables: 703)
[--] Data in InnoDB tables: 9M (Tables: 40)
[--] Data in MEMORY tables: 10M (Tables: 2187)
[!!] Total fragmented tables: 117

-------- Performance Metrics -------------------------------------------------
[--] Up for: 12d 22h 23m 50s (149M q [134.069 qps], 13M conn, TX: 1900B, RX: 46B)
[--] Reads / Writes: 71% / 29%
[--] Total buffers: 716.0M global + 5.0M per thread (700 max threads)
[!!] Maximum possible memory usage: 4.1G (106% of installed RAM)
[OK] Slow queries: 0% (60/149M)
[OK] Highest usage of available connections: 50% (351/700)
[OK] Key buffer size / total MyISAM indexes: 256.0M/8.3G
[OK] Key buffer hit rate: 99.9% (4B cached / 4M reads)
[OK] Query cache efficiency: 56.2% (57M cached / 102M selects)
[!!] Query cache prunes per day: 11868
[OK] Sorts requiring temporary tables: 0% (60K temp sorts / 15M sorts)
[!!] Temporary tables created on disk: 46% (924K on disk / 2M total)
[OK] Thread cache hit rate: 99% (351 created / 13M connections)
[OK] Table cache hit rate: 38% (4K open / 12K opened)
[OK] Open file limit used: 23% (3K/12K)
[OK] Table locks acquired immediately: 99% (148M immediate / 148M locks)
[!!] InnoDB data size / buffer pool: 9.5M/8.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
    Run OPTIMIZE TABLE to defragment tables for better performance
    Reduce your overall MySQL memory footprint for system stability
    Enable the slow query log to troubleshoot bad queries
    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 exceeds your installed memory ***
  *** Add more RAM before increasing any MySQL buffer variables  ***
    query_cache_size (> 350M)
    tmp_table_size (> 100M)
    max_heap_table_size (> 128M)
    innodb_buffer_pool_size (>= 9M)

A pesar que solo pretende que se tome como una guía, las recomendaciones las encuentro muy útiles para ajustar rápidamente el servidor, principalmente si se está usando una instalación por defecto. Un punto sobre Query Cache, es que siempre hay que analizar si conviene o no activarlo o cuanta memoria asignarle; depende mucho de como funciona la aplicación y si hay otros sistemas de caché ya presentes.

¿Han usado alguna otra herramienta para optimizar MySQL? MySQLTuner es la primera que he usado, y que va más alla de solo resumir el estado de MySQL. Cualquier referencia se agradece.