and troubleshooting with pmm mysql performance optimization › ... ›...

86
MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev, CEO, Percona

Upload: others

Post on 25-Jun-2020

19 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

MySQL Performance Optimization and Troubleshooting with PMM

Peter Zaitsev, CEO, Percona

Page 2: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

2

In the Presentation

Practical approach to deal with some of the

common MySQL Issues

Page 3: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

3

Assumptions

You’re looking to Have your MySQL Queries Run Faster

You want to troubleshoot sudden MySQL Performance Problem

You want to find way to run more efficiently (use less Resources)

Page 4: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

4

Few words about Percona Monitoring and Management (PMM)

Free, Open Source database troubleshooting and performance optimization platform for MySQL and MongoDB

100% Free and Open Source

Based on Industry Leading Technology

Roll your own in and out of the Cloud

Page 5: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

5

Exploring Percona Monitoring and Management

• http://bit.ly/InstallPMM

You should be able to install

PMM in 15 minutes or less

• https://pmmdemo.percona.com

Would like to follow along in

the demo ?

Page 6: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

6

How to Look at MySQL Performance

Query Based Approach

• All the users (developers) care is how quickly their queries perform

Resource Based Approach

• Queries use resources. Slow Performance often caused by resource constraints

Page 7: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

7

Primary Resources

CPU

Disk IO

Memory

Network

Page 8: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

8

Low Resource Usage + Poor Performance

Contention

• Table Locks/Row Level Locks

• Locking/Latching in MySQL and Kernel

Mixed Resource Usage

• Single worker spending 33% on CPU

• 33% Waiting on Disk• 33% on Network • Will not be seen as

directly constrained by any resource

Page 9: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

9

Load Average

• What can you tell me about server load ?

Page 10: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

10

Problems with Load Average

Mixes CPU and IO resource usage (on Linux)

Is not normalized for number of CPU cores available

Does not keep into account Queue Depth Needed for optimal storage performance

Page 11: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

11

CPU Usage

• Can observe overall or per core• Matching Load Average in the previous screen

Page 12: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

12

Saturation Metrics • Good to understand where waits are happening• IO Load is not normalized

Page 13: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

13

Looking at CPU Saturation Separately

• Can normalize CPU Saturation based on number of threads

Page 14: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

14

Context Switches – Contention Indicator

• Even in the best case you should count on few context switches per query

Page 15: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

15

Innodb Contention Indicators

• Not all Contention exposed in Spin Rounds and OS Waits • Performance Schema “sync” instrumentation is not enabled by default

and does not cover everything

Page 16: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

16

Row Locks – Logical Contention

• Row Locks are often declared by transaction semantics • But more transactions underway also mean more locks

Page 17: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

17

Zooming in on Row Locks Wait Load

• How many MySQL Connections are Blocked because or Row Level Lock Waits

Page 18: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

18

“Load at MySQL Side”

• “threads_running” - MySQL is busy handling query • CPU ? Disk ? Row Level Locks ? Need to dig deeper

Page 19: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

19

MySQL Questions – Inflow of Queries

• Are we serving more queries or less queries ?• Any spikes or dips ?

Page 20: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

20

Innodb Rows – Actual Work Being Done

• Better number to think re system capacity • Not all rows are created equal, but more equal than queries

Page 21: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

21

Commands – What kind of operations

• Note if prepared statements are used MySQL is “double counting”

Page 22: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

22

Disk IO – Watch Latency

• Increasing latency best way to see overloaded disk • Look at read and write latency separately

Page 23: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

23

Disk Load – Saturation for Reads and Writes• For SSD hard to know the optimal level of concurrency/ queue depth

Page 24: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

24

Disk IO – Great Measure of Inflow Work

• Number of request and bandwidth are both important measures these days

• Reads and Writes are Different

Page 25: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

25

Disk IO Utilization

• Not Very Helpful. • 100% Does not really mean disk resources are fully used

Page 26: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

26

MySQL Threads running Avg vs Peak

• Short Term Spikes not the big are expected• Sustained high values often signal performance problems

Page 27: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

27

Row Lock Load and Query Rate

• Increasing Query Rate 3x, Row lock load spikes 100x• Performance response is not linear

Page 28: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

28

Deadlocks can too if there are hot rows

• Do not expect deadlocks be zero

Page 29: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

29

Memory usage by MySQL

Leave some memory available for OS Cache and other needs

Page 30: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

30

MySQL “Handlers” low lever row access

• Works for all storage engines• Gives more details on access type • Mixes Temporary Tables and Non-Temporary tables together

Page 31: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

Innodb in Depth

Page 32: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

32

Innodb Checkpointing

• The log file size is good enough as Uncheckpointed bytes are fraction of log file size

Page 33: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

33

Innodb Checkpointing

• Very Close – Innodb Log File Size too small for optimal performance

Page 34: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

34

Innodb Buffer pool Dirty Data

• Dirty Data good for efficient write workloads• Longer shutdown time and crash recovery

Page 35: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

35

Innodb Transaction History - not yet Purged Transactions• Short term spikes are normal if some longer transactions are ran on the

system

Page 36: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

36

Innodb Transaction History

• Growth over long period of time without long queries in the processlist• Often identifies orphaned transactions (left open)

Page 37: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

37

Transaction History Recovery

• If Backlog is resolved quickly it is great • If not you may be close to the limit of purge subsystem

Page 38: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

38

Innodb Change Buffer – Delay Index Updates• Can take very long time to warmup to impact your workload

Page 39: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

39

Innodb Change Buffer

• How many operations go to the buffer vs “Merges”

Page 40: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

40

Innodb Change Buffer

• Merge Ratio is great indicator whenever it is actually helping

Page 41: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

41

Is your Innodb Log Buffer Large Enough?

• You will be surprised to see how little log buffer space Innodb needs

Page 42: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

42

Innodb IO

• Will often roughly match disk IO • Allows to see the writes vs fsyncs

Page 43: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

43

Adaptive Hash Index

• Speed up Index Lookups for data in the buffer pool• How many hits am I getting really ?

Page 44: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

44

AHI Maintenance can be expensive

• How much maintenance are we doing ?

Page 45: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

45

Hot Tables

• It is often helpful to know what tables are getting most Reads• And Writes

Page 46: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

46

Hot Tables through Performance Schema

• Even more details available in Performance Schema• Load is a better measure of actual cost than number of events

Page 47: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

47

Most Active Indexes

• See through which index queries access tables

Page 48: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

48

What about Queries causing the most load?• Can examine through Query Analytics application

Page 49: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

49

Latency Details Explored

• Not enough to look at Average Latency

Page 50: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

50

What are Top Queries ?

Queries Sorted by their “Load”

Query ran 10 times over second each time taking 0.2 sec will be load 2

Not making a difference between queries “causing” the load or just impacted by it

Page 51: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

51

Whole Server Summary #1

• Server Summary Gives a good idea what is going on query wise

Page 52: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

52

Whole Server Summary #2

Page 53: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

53

Specific Query – Update Query

• Significant part of response time comes from row level lock waits

Page 54: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

54

Expensive SELECT Query

• Examining lots of rows per each row sent

Page 55: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

55

Check Query Example

• Expensive Query not poorly optimized one

Page 56: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

56

Explain and JSON Explain

Page 57: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

57

Explore Any Captured Metrics

• Standard Dashboards are only tip of the iceberg• You can also use Prometheus directly

Page 58: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

Lets Look at Couple of Case Studies

Page 59: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

59

Impact Of Durability ?

Running sysbench with rate=1000 to inject 1000 transactions every second

System can handle workloads with both settings

System previously running with sync_binlog=0 and innodb_flush_log_at_trx_commit=0

Set them to sync_binlog=1 and innodb_flush_log_at_trx_commit=1

Page 60: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

60

IO Bandwith

• IO Bandwidth is not significantly impacted

Page 61: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

61

IO Saturation Jumps a Lot

Page 62: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

62

Read and Write Latencies are Impacted

• This SSD (Samsung 960 Pro) Does not like fsync() calls

Page 63: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

63

More Disk IO Operations

• Frequent Fsync() causes more writes of smaller size to storage

Page 64: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

64

Increase In Disk IO Load

• IO Avg Latency Increase + More IOPs = Load Increase

Page 65: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

65

Disk IO Utilization jumps to 100%

• There is at least one disk IO Operation in flight all the time

Page 66: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

66

Average IO Size is down

• Large block writes to binlog and innodb transaction logs do not happen any more

Page 67: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

67

Number of Running Threads Impacted

• Need higher concurrency to be able to drive same number of queries/sec

Page 68: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

68

MySQL Questions

• Why does it increase with same inflow of transactions ?

Page 69: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

69

Because of Deadlocks

• Some transactions have to be retried due to deadlocks• Your well designed system should behave the same

Page 70: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

70

Higher Row Lock Time

• Rows Locks can be only released after successful transaction commit• Which now takes longer time due to number of fsync() calls

Page 71: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

71

And Load Caused by Row Locks

Page 72: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

72

Log Buffer Used even less with durability on

Page 73: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

73

Is Group Commit Working ?

• Do we relay on Group Commit for our workload

Page 74: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

74

Top Queries Impacted

• Commit is now the highest load contributor

Page 75: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

Changing Buffer Pool Size

Page 76: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

76

MySQL 5.7 Allows to change BP Online

• Changing buffer pool from 48GB to 4GB online

mysql> set global innodb_buffer_pool_size=4096*1024*1024;

Query OK, 0 rows affected (0.00 sec)

Page 77: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

77

QPS Impact

• While resizing is ongoing capacity is limited – Queueing happens• After resize completed backlog has to be worked off having higher

number of queries

Page 78: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

78

Saturation spike and when stabilizing on higher level • Guess why the spike with lower QPS Level ?

Page 79: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

79

Two IO Spikes

• First to Flush Dirty Pages • Second to work off higher query rate

Page 80: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

80

What is about Disk IO Latency ?

• Higher Number of IOPS does not always mean much higher latency

Page 81: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

81

Longer Transactions = More Deadlocks

Page 82: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

82

More IO Load Less Contention ?

• Unsure why this is the case • Note not ALL contention is shown in those graphs

Page 83: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

83

Now we see query 80% IO Bound

Page 84: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

84

Summary

Can get a lot of Insights in MySQL Performance with PMM

Great tool to have when you’re challenged troubleshoot MySQL

A lot of insights during benchmarking and evaluation

Page 85: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

85

Thank You Sponsors!

Page 86: and Troubleshooting with PMM MySQL Performance Optimization › ... › PLE17-MySQL-Performance-Optimizat… · MySQL Performance Optimization and Troubleshooting with PMM Peter Zaitsev,

86

SAVE THE DATE!

CALL FOR PAPERS OPENING SOON!www.perconalive.com

April 23-25, 2018Santa Clara Convention Center