Se ha denunciado esta presentación.
Utilizamos tu perfil de LinkedIn y tus datos de actividad para personalizar los anuncios y mostrarte publicidad más relevante. Puedes cambiar tus preferencias de publicidad en cualquier momento.

MySQL 5.6 config 優化

700 visualizaciones

Publicado el

MySQL 5.6 config 優化

Publicado en: Ingeniería
  • Inicia sesión para ver los comentarios

MySQL 5.6 config 優化

  1. 1. MySQL config Tuning Alexis
  2. 2. 調整原則 1.一次調整一個 2.Set Global:若該變數是dynamic,則可用它在 runtime修正variables,但restart即會消失,需設 定option file 3.注意variable的關聯性 4.ram 2x不代表所有東西都2倍
  3. 3. innodb_buffer_pool_size 1.cache both data and index 2.512M:for normal 3.4G:for 寫入多 4.5.6 above 5.redo log
  4. 4. max_connections 1.>1000 is not OK(有人設2000) 2.thread pool 3.connection pool
  5. 5. innodb_file_per_table 1.bad performance 2.>10k table is not good 3.reclaim space as dropping, truncating or rebuilding
  6. 6. innodb_flush_log_at_trx_commit =1 1.safety 2.flush時會有多的fsyncs 3.完全ACID
  7. 7. innodb_flush_log_at_trx_commit =2 1.每秒 flush committed transactions 到 redo log 2.適合replica 3.loss data as OS crash =0 1.crash時會丟失
  8. 8. innodb_flush_method 1.通常O_DIRECT 2.sysbench來判斷
  9. 9. innodb_log_buffer_size -flushed every 1 sec -default is ok for medium write & shorter transactions -more for activity spikes or lots of blobs work
  10. 10. innodb_log_buffer_size -not committed yet -1MB -innodb_log_waits -larger will save disk I/O
  11. 11. innodb_log_file_size larger: -better performance -longer recovery time -less checkpoint flush activity
  12. 12. innodb_log_file_size BUG #69477 5.6.20 5.6.22 10 times larger than the largest BLOB + length of other variable length fields redo log BLOB’s max is 10% of redo log size
  13. 13. Query_cache_size 1.well-known bottleneck 2.better to be zero 3.good indexing, replicas, external cache 4.not good for real practice 5.Today’s machine is much faster than before
  14. 14. log_bin 1.for replication master 2.also got to set server_id 3.to save disk space: a.expire_logs_days b.purge binary logs
  15. 15. skip_name_resolve 1.enable it to prevent the slow DNS let you slow 2.GRANT got to use IP address 3.skip_name_resolve
  16. 16. PS 1.table_cache 2.thread_cache:dont create thread for normal operation
  17. 17. PS http://dev.mysql.com/doc/refman/5. 6/en/server-system-variables. html#sysvar_table_definition_cache

×