dance with mysql
DESCRIPTION
Dance with MySQL. Manage MySQL with Open source. 周振兴 @ Taobao DBA. 2010-06. 1. What MySQL do for us. 950G data 650G index Total 1.6T IOPS 18947 Delta 3.2G 8000*1024 = 800W. System A. What MySQL do for us. System B 15 ,0000,0000 records Total: 4T Delta 1000,0000. 16 *. - PowerPoint PPT PresentationTRANSCRIPT
1
Dance with MySQL
周振兴@Taobao DBA
2010-06
Manage MySQL with Open source
What MySQL do for us
• 950G data• 650G index
• Total 1.6T• IOPS 18947 • Delta 3.2G
– 8000*1024 = 800W
System A
What MySQL do for us
• System B– 15,0000,0000 records
– Total:4T– Delta
• 1000,000016 *
Uptime:217 days 18 hours 34 min 2 sec
What about my topic
–How to manage 200+ MySQL Instance
What we do• Test
• routine Install
• Find Problem/debug
• Backup
• Monitor
Why
• Why we think about this a lot?– We have 200+ MySQL Instance
Which one you can drop?
Test is about MoneyInstall is about TimeDebug is aboutStability Backup is about SafetyMonitor is about Status
Why Test
• Simple math– Performance increase 10%
• 200*2W *10% = 40W• 200*2W *20% = 80W
What can 80W do ?
Why Test
• Performance• Stable
– Last year >85% accident can be avoided– This year < 5%
How Test
• Sysbench– How to use sysbench
• How many row• Read write rate
How Test
• Why sysbench?
• Why not sysbench?
• Why supersmack?– Data set > 120G – 95% query for 5%data– 80% query for 20% data
How Test
• Supersmack
ALL 10:2
20% 10:2
5% 10:2
ALL 20:2
20% 20:2
5% 20:2
0
200
400
600
800
1000
1200
1400
1600
1800
6*SAS RAID10
7*SSD RAID5
How Test
• Supersmack– Dell PowerEdge 2950 – Mem:24G 6*300 SAS RAID10– We test different PC Server/Hardware
What Test
• Decide which value we chooseInnoDB_IO_CAPACITY
One hour average in blueTow hour average in red
Install
Test Money Sysbench/supersmack
Install Time
Debug Stability
Backup Safety
>mysql_install_auto -h 172.23.119.257 -v 5.1.45
File descriptorSwappiness.......
Debug
• It’s a real complicated work
• One point: tcpdump + mk-query-digest• It’s a talent work
Debug
• tcpdump + mk-query-digest
Backup
• mysqldump is cool– 39G .sql takes 80 min– Restore takes 206 min(3.4)
• Still we need Xtrabackup– On line– No lock– Some environment
• it’s quick && restore is quick
Xtrabackup
• Using InnoDB Redo (Transaction log)
• No effect to the Online system
• Also help u to setup a new slave
• System can be more Available
More backup strategy
• Last 4 Day Last 3 month Last 3 Year
• 1 3 5 mysqldump 2 4 6 xtrabackup
MySQL Monitor
• Quick way: Cacit + RRDTool– Screenshot
What we monitor
• Com_select – Com_insert – Com_update – Com_delete
• Principle: The bigger the system is,
the more simple the basic layer is
• InnoDB– Logical read/write– Physical read/write– Row operation
Finally
Test Money Sysbench/supersmack
Install Time Linux/bash
Debug Stability mk-query-digest / iostat / ...
Backup Safety Xtrabackup
Monitor Status Cacti / RRDTool
• Enjoy....
What I know is so limited
Still I like Sharing
Q & A