Peter Zaitsev - Practical MySQL Performance Optimization

1,026
-1

Published on

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

No Downloads
Views
Total Views
1,026
On Slideshare
0
From Embeds
0
Number of Embeds
1
Actions
Shares
0
Downloads
47
Comments
0
Likes
3
Embeds 0
No embeds

No notes for slide

Peter Zaitsev - Practical MySQL Performance Optimization

  1. 1. Practical MySQL Performance Optimization Peter Zaitsev, CEO, Percona Los Angeles MySQL Meetup February, 20, 2014
  2. 2. About Presentation Define “Performance” Provide Practical Approach to getting Performance you need Talk about Tools you can use 2 www.percona.com
  3. 3. Focus on Thought Process Right Approach to the problems is a key It is hard to Google “how to approach things” Easy to find a lot of specific advice once you know what you want to do MySQL Performance Blog has a lot of specific information High Performance MySQL Book 3 www.percona.com
  4. 4. Speaking about Performance We mean we want system which is 4 •Responsive •Efficient •Scalable www.percona.com
  5. 5. Good Enough System needs • Responsiveness to be • Efficiency Good • Scalability Enough in 5 www.percona.com
  6. 6. Focus on Application Database Performance • It does only as it Does not impacts an Application Matter Database is a Tool we use 6 • … and problem are we deal with www.percona.com
  7. 7. Things to Note Not all Application Performance Problems come from MySQL Not all Application Performance Problems which come from MySQL • … are resolved on MySQL level 7 www.percona.com
  8. 8. Putting it in Practice Look at Complete System • Start with Architecture Do not focus on tuning database alone 8 www.percona.com
  9. 9. What Databases Do ? Databases Handle Queries 9 www.percona.com
  10. 10. Queries ? Selects Inserts Updates Deletes Others 10 www.percona.com
  11. 11. What do we need from it ? To Handle Our Queries 11 •Quickly •Efficiently •Reliably www.percona.com
  12. 12. Are those Right Queries ? One of Architecture Questions Changing how Application Logic translates to Queries is a great optimization 12 www.percona.com
  13. 13. Putting It in Practice Look at Application Transactions See what Queries they Use Check out how those queries perform 13 www.percona.com
  14. 14. Things to Consider Look beyond averages Make sure to look at trends over time 14 • But avoid focus on extreme outliers • Daily and Weekly cycle • Growth of load and Data Size www.percona.com
  15. 15. Tools to Consider • pt-query-digest (Percona Toolkit) • MySQL Enterprise Monitor • Performance_Schema (MySQL 5.6+) • Check out ps_helper • Box Anemometer • https://github.com/box/Anemometer/wiki • Percona Cloud Tools • http://cloud.percona.com 15 www.percona.com
  16. 16. pt-query-digest example 16 www.percona.com
  17. 17. Top Queries 17 www.percona.com
  18. 18. Query Details 18 www.percona.com
  19. 19. More Query Details 19 www.percona.com
  20. 20. Percona Cloud Tools 20 www.percona.com
  21. 21. Server Profile 21 www.percona.com
  22. 22. Query Details 22 www.percona.com
  23. 23. Graphs! 23 www.percona.com
  24. 24. Process Support Discover New Queries in the Application Mark them as “Needing Attention” or “Reviewed” Tag queries with information about application or user facing function Discuss it with the team and record changes using Comments 24 www.percona.com
  25. 25. Query Performance always shows it Workload Changes Data Size Changing Query Plans Upgrading MySQL Version Changing MySQL Settings Hardware Changes 25 www.percona.com
  26. 26. Efficiency Right Queries Executed Most Efficiently 26 www.percona.com
  27. 27. Practical Metrics How many rows are being scanned vs Sent ? How much IO are we doing ? Is there avoidable overhead ? • Filesorts ? • TMP Tables ? On Disk ? 27 www.percona.com
  28. 28. Areas of Improvement Architecture Hardware http://bit.ly/1dRNtaa Schema and Queries http://bit.ly/1l1KBLN MySQL version (and Variant) MySQL Configuration http://bit.ly/1ctWAN9 28 www.percona.com
  29. 29. Advanced Registration Rate Ends March 2nd, 2014 Special Discount for Webinar Attendees: Use Code PeterZ15 to receive 15% off of standard rates (new registrations only) http://bit.ly/MySQLUC2014 29 www.percona.com
  30. 30. How Percona Can Help Support RemoteDBA Consulting 30 www.percona.com
  31. 31. Thank You! Peter Zaitsev pz@percona.com 31 www.percona.com www.percona.com

×