반응형

➨ MYSTERY CONFIGURATION

- config(/etc/my.cnf) 파일 수정시 source control(svn, git) 을 사용해라.


➨ ABANDONED EXPERIMENTS

- default 값이 잘 선택된 값일 지라도 해당 작업 환경에서 더 나은 config value 를 테스트하고 적용해라.


➨ AIMLESS TUNING

- 튜닝 방식에 대한 설명..

- e.g. variables sort_buffer_size 에 대한 영향은 status sort_merge_passes 로 확인 할 수 있다. 해당 변수의 변경우 status 확인으로 최적화된 값을 찾는다.

- pt-mtext (percona-toolkit) 과 Percona monitoring plugin 을 활용할 수 있다.

- global variables 와 session 별 할당 가능한 variables 을 구분하여 활용


➨ BRITTLE BACKUPS

- 복원할수 있는 백업을 해라

- 복원에 대한 전략 / 단계 수립 필요

- 단계별 복원에 대한 테스트를 통하여 백업 전략(스크립트) 수정

- Don’t think of a backup strategy – instead think of a restore strategy


➨ DRIFT HAPPENS

- repliction 의 데이타가 master 와 일치 하지 않을 수 있다.

- set global read_only=1 과 binlog_format=row 가 도움을 줄수 있다.

- pt-table-checksum 으로 확인 가능.  cron 활용 주기적으로 확인필요

- pt-table-sync 로 sync


➨ INDEX HOARDING

- index size 측정 : information_schema.tables.index_length,  INFORMATION_SCHEMA.innodb_buffer_page

- duplicate index 확인 : pt-duplicate-key-checker

- unused index 확인 : pt-index-usage

- schema.table_io_waits_summary_by_index_usage


SELECT OBJECT_SCHEMA, OBJECT_NAME, INDEX_NAME, COUNT_STAR

FROM performance_schema.table_io_waits_summary_by_index_usage

WHERE COUNT_STAR = 0 AND INDEX_NAME != 'PRIMARY'

AND OBJECT_SCHEMA NOT IN ('mysql', 'performance_schema');


- schema/application 등의 변경 후 주기적 체크 clean up 작업 필요


➨ NO CAPACITY MONITORING

- disk bottlenecks 체크 (disk full, san failure, raid failure)

- io benchmark -> sysbench

- df, iostat 등 활용 monitoring

- cacti alert plugin 활용


➨ SERVICE INTERRUPTIONS

- ALTER TABLE

  : mysql 5.6 online alter table

  : pt-online-schema-change

- upgrade  ( Use a pair of MySQL servers, replicating both ways / master-master replication)

- server failover -> cluster (Percona XtraDB Cluster)



[출처] Avoiding Common MySQL Operations Mistakes.pdf|작성자 SMR

http://blog.naver.com/suheon_kim/120207747626


반응형

+ Recent posts