MySQL and InnoDB
Performance
Baron Schwartz | OSDC 2010
MySQL Architecture
MySQL Server
Storage Engines
Parser, Optimizer
Executor, Caches
InnoDB Storage Engine
• Transactional, ACID compliant
• Reliable, Stable
• Complex, Flexible
• A History of Poor Scalabili...
Thinking About Performance
Response Time
Is Everything
Response Time
R = W + S
Utilization
ResponseTime
S
W
Response Time
R = W + S
Utilization
ResponseTime
S
W
MySQL & InnoDB In Context
MySQL & InnoDB In Context
Operating Environment
MySQL Server
InnoDB
Operating Environment
RAM
CPU
I/O
Network
Operating Environment
RAM
CPU
I/O
Network
• Fast
• Up to 24 Cores
• Up to 100's of GB
• RAID + BBU
• Fast SAS Disks
• SSD ...
MySQL Performance
Nested-Loop Joins and Subqueries
MySQL Performance
Cache Scalability
InnoDB's Single “Main Thread”
• Too Much Work! Purging, Flushing
• Main Thread Cannot Keep Up
Special-Purpose Threads
• Main Thread
• Purge Thread
• Multiple Read/Write IO Threads
InnoDB Mutex Contention
Buffer Pool
Splitting the Buffer Pool Mutex
Buffer Pool Flush List LRU Hash Free
Current InnoDB Bottlenecks
• Adaptive Hash Search Mutex
• Index Lock Mutex
• After These Are Solved, ???
How To Improve Performance
Measure Carefully
Proper diagnosis is 95% of the work
Use Good Tools
• New Relic
• MySQL Enterprise Monitor
• Cacti
– http://code.google.com/p/mysql-cacti-templates/
• Maatkit
...
Instrumentation is Key
• The best performance data is INSIDE MySQL
Percona Server with XtraDB
MySQL Server
Storage Engines
Parser, Optimizer
Executor, Caches
Tunability
Instrumentation
Diag...
Current Benchmarks
InnoDB -vs- XtraDB
http://tinyurl.com/xtradb-fusionio-jan-2010
XtraDB is much better than InnoDB in MySQL 5.1.
MySQL 5.5 -vs- Percona Server
http://tinyurl.com/xtradb-mysql5-5-ap2010
High performance is no use without stability.
Other Technologies
• Cloud Computing
– 2 of the 4 critical resources are uncontrollable
• “NoSQL” Databases
– It's too soo...
Summary
• The operating environment is important
• MySQL & InnoDB are getting much faster
• The cloud is not a performance...
Where Do You Go Next?
• Become a performance practitioner
– Read High Performance MySQL 2nd
Edition
– Read Optimizing Orac...
Upcoming SlideShare
Loading in …5
×

MySQL 和 InnoDB 性能

1,030 views

Published on

MySQL 和 InnoDB 性能

http://www.ossez.com/forum.php?mod=viewthread&tid=26844&fromuid=426
(出处: OSSEZ)

Published in: Technology
0 Comments
2 Likes
Statistics
Notes
  • Be the first to comment

No Downloads
Views
Total views
1,030
On SlideShare
0
From Embeds
0
Number of Embeds
3
Actions
Shares
0
Downloads
24
Comments
0
Likes
2
Embeds 0
No embeds

No notes for slide

MySQL 和 InnoDB 性能

  1. 1. MySQL and InnoDB Performance Baron Schwartz | OSDC 2010
  2. 2. MySQL Architecture MySQL Server Storage Engines Parser, Optimizer Executor, Caches
  3. 3. InnoDB Storage Engine • Transactional, ACID compliant • Reliable, Stable • Complex, Flexible • A History of Poor Scalability
  4. 4. Thinking About Performance Response Time Is Everything
  5. 5. Response Time R = W + S Utilization ResponseTime S W
  6. 6. Response Time R = W + S Utilization ResponseTime S W
  7. 7. MySQL & InnoDB In Context
  8. 8. MySQL & InnoDB In Context Operating Environment MySQL Server InnoDB
  9. 9. Operating Environment RAM CPU I/O Network
  10. 10. Operating Environment RAM CPU I/O Network • Fast • Up to 24 Cores • Up to 100's of GB • RAID + BBU • Fast SAS Disks • SSD / FusionIO • XFS Filesystem • Deadline Scheduler • High Bandwidth • Low Latency
  11. 11. MySQL Performance Nested-Loop Joins and Subqueries
  12. 12. MySQL Performance Cache Scalability
  13. 13. InnoDB's Single “Main Thread” • Too Much Work! Purging, Flushing • Main Thread Cannot Keep Up
  14. 14. Special-Purpose Threads • Main Thread • Purge Thread • Multiple Read/Write IO Threads
  15. 15. InnoDB Mutex Contention Buffer Pool
  16. 16. Splitting the Buffer Pool Mutex Buffer Pool Flush List LRU Hash Free
  17. 17. Current InnoDB Bottlenecks • Adaptive Hash Search Mutex • Index Lock Mutex • After These Are Solved, ???
  18. 18. How To Improve Performance
  19. 19. Measure Carefully Proper diagnosis is 95% of the work
  20. 20. Use Good Tools • New Relic • MySQL Enterprise Monitor • Cacti – http://code.google.com/p/mysql-cacti-templates/ • Maatkit • GDB, strace, oprofile
  21. 21. Instrumentation is Key • The best performance data is INSIDE MySQL
  22. 22. Percona Server with XtraDB MySQL Server Storage Engines Parser, Optimizer Executor, Caches Tunability Instrumentation Diagnostics
  23. 23. Current Benchmarks
  24. 24. InnoDB -vs- XtraDB http://tinyurl.com/xtradb-fusionio-jan-2010 XtraDB is much better than InnoDB in MySQL 5.1.
  25. 25. MySQL 5.5 -vs- Percona Server http://tinyurl.com/xtradb-mysql5-5-ap2010 High performance is no use without stability.
  26. 26. Other Technologies • Cloud Computing – 2 of the 4 critical resources are uncontrollable • “NoSQL” Databases – It's too soon to be sure
  27. 27. Summary • The operating environment is important • MySQL & InnoDB are getting much faster • The cloud is not a performance solution • You are the key to better performance
  28. 28. Where Do You Go Next? • Become a performance practitioner – Read High Performance MySQL 2nd Edition – Read Optimizing Oracle Performance – Read The Art Of Capacity Planning – Read http://www.percona.com/about-us/white-papers/ • Contribute! – Sponsor features you need or want – Help improve tools

×