Ver Mensaje Individual
  #1 (permalink)  
Antiguo 28/05/2013, 23:00
wayward
(Desactivado)
 
Fecha de Ingreso: enero-2004
Mensajes: 136
Antigüedad: 20 años, 3 meses
Puntos: 0
OPtimizar Mysql

Hola a todos.

Tengo un VPS (Centos 5.8) con 1&1 (Opteron Quad con 8GB de Ram)donde alojo Webs creadas con Wordpress.
Tengo problemas de rendimiento, y decidido analizar la DB con Mysqltuner.

El fichero my.cnf es:
Código MySQL:
Ver original
  1. [mysqld]
  2. datadir=/var/lib/mysql
  3. socket=/var/lib/mysql/mysql.sock
  4. user=mysql
  5. query_cache_size=128M
  6. query_cache_limit=148M
  7. query_cache_type=1
  8. max_connections=200
  9. collation_server=utf8_unicode_ci
  10. character_set_server=utf8
  11. delayed_insert_timeout=40
  12. interactive_timeout=10
  13. wait_timeout=3000
  14. connect_timeout=300
  15. thread_cache_size=16k
  16. key_buffer=256M
  17. join_buffer=2M
  18. max_connect_errors=20
  19. max_allowed_packet=8M
  20. table_cache=96K
  21. table_definition_cache=24K
  22. open_files_limit = 24K
  23. sort_buffer_size=8M
  24. read_buffer_size=8M
  25. read_rnd_buffer_size=8M
  26. thread_concurrency=2
  27. myisam_sort_buffer_size=512M
  28. myisam_max_sort_file_size = 2048M
  29. innodb_file_per_table=1
  30. innodb_buffer_pool_size=512M
  31. log-slow-queries=/var/log/mysql-slow-queries.log
  32. table_open_cache=96
  33. low_priority_updates=1
  34. concurrent_insert=ALWAYS
  35. tmp_table_size=128M
  36. max_heap_table_size=24M
  37. server-id=3613594
  38. log-bin=mysql-bin
  39. log-error=mysql-bin.err
  40. binlog_ignore_db=loquosex2013
  41.  
  42. # Disabling symbolic-links is recommended to prevent assorted security risks
  43. symbolic-links=0
  44.  
  45. # Semisynchronous Replication
  46. # http://dev.mysql.com/doc/refman/5.5/en/replication-semisync.html
  47. # uncomment next line on MASTER
  48. ;plugin-load=rpl_semi_sync_master=semisync_master.so
  49. # uncomment next line on SLAVE
  50. ;plugin-load=rpl_semi_sync_slave=semisync_slave.so
  51.  
  52. # Others options for Semisynchronous Replication
  53. ;rpl_semi_sync_master_enabled=1
  54. ;rpl_semi_sync_master_timeout=10
  55. ;rpl_semi_sync_slave_enabled=1
  56.  
  57. # http://dev.mysql.com/doc/refman/5.5/en/performance-schema.html
  58. ;performance_schema
  59.  
  60. [mysqld_safe]
  61. log-error=/var/log/mysqld.log
  62. pid-file=/var/run/mysqld/mysqld.pid

Y el resultado del test es:

-------- General Statistics --------------------------------------------------
[--] Skipped version check for MySQLTuner script
[OK] Currently running supported MySQL version 5.5.30-log
[OK] Operating on 64-bit architecture

-------- Storage Engine Statistics -------------------------------------------
[--] Status: +Archive -BDB -Federated +InnoDB -ISAM -NDBCluster
[--] Data in MyISAM tables: 8M (Tables: 272)
[--] Data in InnoDB tables: 493M (Tables: 231)
[--] Data in PERFORMANCE_SCHEMA tables: 0B (Tables: 17)
[!!] Total fragmented tables: 232

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

-------- Performance Metrics -------------------------------------------------
[--] Up for: 5m 30s (115K q [350.488 qps], 177 conn, TX: 76M, RX: 11M)
[--] Reads / Writes: 99% / 1%
[--] Total buffers: 936.0M global + 26.2M per thread (200 max threads)
[OK] Maximum possible memory usage: 6.0G (75% of installed RAM)
[OK] Slow queries: 0% (0/115K)
[OK] Highest usage of available connections: 2% (5/200)
[OK] Key buffer size / total MyISAM indexes: 256.0M/1.1M
[!!] Key buffer hit rate: 50.0% (6 cached / 3 reads)
[OK] Query cache efficiency: 95.7% (110K cached / 115K selects)
[OK] Query cache prunes per day: 0
[OK] Sorts requiring temporary tables: 0% (2 temp sorts / 767 sorts)
[!!] Temporary tables created on disk: 49% (645 on disk / 1K total)
[OK] Thread cache hit rate: 97% (5 created / 177 connections)
[!!] Table cache hit rate: 1% (96 open / 4K opened)
[OK] Open file limit used: 0% (82/24K)
[OK] Table locks acquired immediately: 100% (6K immediate / 6K locks)
[OK] InnoDB data size / buffer pool: 493.5M/512.0M

-------- Recommendations -----------------------------------------------------
General recommendations:
Run OPTIMIZE TABLE to defragment tables for better performance
MySQL started within last 24 hours - recommendations may be inaccurate
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:
tmp_table_size (> 128M)
max_heap_table_size (> 24M)
table_cache (> 96)

Que debería hacer para corregir los errores?

Muchas gracias de antemano.