Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
SlideShare a Scribd company logo
Practical MySQL Performance
Optimization
Peter Zaitsev,
CEO, Percona
Los Angeles MySQL Meetup
February, 20, 2014
About Presentation
Define “Performance”

Provide Practical Approach to getting
Performance you need
Talk about Tools you can use
2

www.percona.com
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
Speaking about Performance

We
mean
we
want
system
which is
4

•Responsive
•Efficient
•Scalable
www.percona.com
Good Enough

System
needs • Responsiveness
to be • Efficiency
Good
• Scalability
Enough
in
5

www.percona.com
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
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
Putting it in Practice

Look at Complete System
• Start with Architecture

Do not focus on tuning
database alone
8

www.percona.com
What Databases Do ?

Databases Handle
Queries
9

www.percona.com
Queries ?
Selects
Inserts
Updates
Deletes
Others
10

www.percona.com
What do we need from it ?

To
Handle
Our
Queries
11

•Quickly
•Efficiently
•Reliably
www.percona.com
Are those Right Queries ?
One of Architecture Questions
Changing how Application Logic
translates to Queries is a great
optimization
12

www.percona.com
Putting It in Practice

Look at Application Transactions
See what Queries they Use
Check out how those queries perform

13

www.percona.com
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
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
pt-query-digest example

16

www.percona.com
Top Queries

17

www.percona.com
Query Details

18

www.percona.com
More Query Details

19

www.percona.com
Percona Cloud Tools

20

www.percona.com
Server Profile

21

www.percona.com
Query Details

22

www.percona.com
Graphs!

23

www.percona.com
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
Query Performance always
shows it
Workload Changes
Data Size
Changing Query Plans
Upgrading MySQL Version
Changing MySQL Settings
Hardware Changes
25

www.percona.com
Efficiency

Right Queries
Executed Most
Efficiently
26

www.percona.com
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
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
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
How Percona Can Help

Support
RemoteDBA
Consulting
30

www.percona.com
Thank You!
Peter Zaitsev
pz@percona.com

31

www.percona.com
www.percona.com

More Related Content

Peter Zaitsev - Practical MySQL Performance Optimization