Download presentation
Presentation is loading. Please wait.
Published byMalcolm Tyler Modified over 8 years ago
1
Intermediate MySQL Administration Sheeri Cabral Senior DB Admin/Architect, Mozilla @sheeri www.sheeri.com http://bit.ly/intMySQLadmin
2
Plan to Fail “If you don't plan to fail, you fail to plan” Practice failover/switchover Offline maintenance
3
Get Ridiculous...and what happens if the data center fails?...if the entire backend network fails?...it's like load testing...somewhere there is a failure (SPOF)
4
Hardware 64-bit RAM – working data set I/O
5
RAID http://www.flickr.com/photos/tirrell/128638167/
6
RAID note Battery-backed write cache – performance – safety
7
SSDs A valid choice Realize your assumptions – Log files & spinning disks Reliable – Power-loss data protection Benchmark
8
Partitions /tmp and ramdisk If this fills, what happens? Data vs. logs vs. backups LVM across >1 partition
9
OS Tuning (Linux) swappiness open files Linux 2.6 kernel – I/O scheduler – Test what works best for you Other daemons
10
Replication Depends on binary logging Two threads – IO thread – SQL thread ignore
11
Monitoring Only alert on what you can fix Graph the important stuff As close to the user experience as possible
12
Backups Have them Test restore Hot, cold, physical, logical – Mix and match!
13
Pro Tips \G – mysql –auto-vertical-output (5.5 and up) \P \c Workbench
14
Built-in Tools Stored procedures/functions – SQL with loops, conditionals, cursors Views Events Partitioning for defragmentation
15
Percona Toolkit Data integrity Ease of finding information (show grants) Query digest/review Other less proven tools
16
Openark Toolkit Online schema change Block accounts Kill slow queries Repeat query execution Security audit – accounts, privs...and more
17
Securich For ease of user administration Clone user Block user Roles
18
Users user@host is unique – not user Super_priv
19
Locking Table vs. Row MyISAM vs. InnoDB deadlocks
20
Buffering Filesystem buffer – Use direct I/O – Bypass fs buffer – Relies on daemon to provide buffering
21
Configuration A note on _ vs - a-variable-with-more-than-one-word vs. a_variable_with_more_than_one_word MySQL tries to be helpful group=mysql group_concat_max_len
22
Configuration Variables datadir tmpdir default_storage_engine='InnoDB' concurrent_insert=2 character_set_server=utf8
23
Gotchas skip_name_resolve innodb_file_per_table tmp_table_size vs. max_heap_table_size
24
InnoDB Parameters innodb_buffer_pool_size innodb_flush_method innodb_flush_logs_at_trx_commit
25
Logging log_warnings log_error expire_logs_days
26
Logging log_slave_updates log_slow_slave_statements log_slow_admin_statements
27
Logging long_query_time log_queries_not_using_indexes min_examined_row_limit
28
max_ max_connections max_connect_errors max_allowed_packet
29
MySQL Query Cache query_cache_size query_cache_type Tuning assistant: http://dom.as/tech/query-cache-tuner/
30
Caches table_open_cache – file descriptors table_definition_cache thread_cache_size
31
Timeouts wait_timeout interactive_timeout
32
Questions? Comments? MySQL Administrator's Bible - tinyurl.com/mysqlbible kimtag.com/mysql planet.mysql.com
Similar presentations
© 2024 SlidePlayer.com. Inc.
All rights reserved.