+ All Categories
Home > Documents > Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle...

Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle...

Date post: 21-Apr-2020
Category:
Upload: others
View: 14 times
Download: 0 times
Share this document with a friend
24
Transcript
Page 1: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,
Page 2: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Real-World Performance TrainingCore Database Performance

Real-World Performance Team

Page 3: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Agenda

Computer Science Basics

Schema Types and Database Design

Database Interface

DB Deployment and Access Options

Application Algorithms

Resource Management

1

2

3

4

5

6

Page 4: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Agenda

Computer Science Basics

Schema Types and Database Design

Database Interface

DB Deployment and Access Options

Application Algorithms

Resource Management

1

2

3

4

5

6

Page 5: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Some Computer Science Basics

Page 6: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Database Performance Core Principles

• The Oracle database is a process based architecture

• To perform efficiently each process requires, at least:

– Idle CPU to schedule a running process

– System services such as network, Disk I/O and inter-process coordination should be fast and efficient

Page 7: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Database Performance Core Principles

• To determine acceptable CPU utilization take a probabilistic approach to the subject.– If a CPU is 50% busy the chance of getting scheduled is 1 in 2

– If a CPU is 66% busy the chance of getting scheduled is 1 in 3

– If a CPU is 80% busy the chance of getting scheduled is 1 in 5

– If a CPU is 90% busy the chance of getting scheduled is 1 in10

• If the probabilities are used as indicator of the predictability of user response time, then the variance in user response time becomes noticeable at about 60-65%

• This has been observed in production and laboratory conditions for many years.

Page 8: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Impact of Too Many Processes

Database Core Principles

02000400060008000

10000

120001400016000

4 8 12 16 20 24 28 32

1 Proc/Core10 Proc/Core Avg50 Proc/Core Avg10 Proc/Core Max50 Proc/Core Max10 Proc/Core Min50 Proc/Core Min

#of CPUs

Tx/s

Page 9: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Response Time

• Response time defines your users (customers) experience

• Response time is a measure of performance quality

• Consistency of response time is an equally important measure of performance quality

• If response time is not consistent, bad things happen !

What it means

Page 10: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

By Numbers

Response Time

0

1

2

3

4

5

6

7

8

9

10

0 1 2 3 4 5 6 7 8 9 10

GOOD

BAD

Frequency X 1,000,000

Response Time ms

Single distinct spike of the majority of transactions

Multi hump indicating inconsistent response

times

Short tail

Long tail

Page 11: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Network Network DatabaseServer

Response Time v DB Time v LatencyApplication

Server

End User

Total User Response Time

Time Line

Page 12: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Database Time – Total time spent in database

Db file sequential read

Run-queue

On CPU

User 1

Actual wait time

Recorded wait time

Db file sequential read

Run-queue Lock Wait

LatchWait

Run-queue

On CPU On CPU On CPUOn CPU On CPU On CPU On CPU On CPUOn CPU

User 2

Actual wait time Actual wait timeActual wait time

Recorded wait time Recorded wait time Recorded wait time

ON DEGRADED SYSTEM

Lock Wait

ON IDLE SYSTEM

Page 13: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Latency - Some Important Numbers

Block Location Access Time

L2 CPU cache ~ 1 nano sec ( 10-9 )

Virtual Memory ~ 1 micro sec ( 10-6 )

NUMA Far Memory ~ 10 micro sec ( 10-6 )

Flash Memory (PCI) ~ 0.01 milli sec ( 10-3 )

Flash Memory (Networked) ~ 0.1 milli sec ( 10-3 )

Disk I/O ~ 1-10 milli sec ( 10-3 )

Best Block Access Speeds

Page 14: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Response Time - Demo

• Users experiencing poor response time

• Low overall system throughput

• Wait events observed in the database

• Culture of blame:

– Blame the database for all performance issues

– Development blames the DBA

– The DBA blames the SW/HW or system administrators

Observations

Page 15: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Performance DataResponse Time

Transaction rate at 3,400 TPS

Response Time > 4 seconds

Page 16: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Application Server Performance DataResponse Time

Majority of time spent in application logic

Application Server CPU at 95%

Page 17: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

ResolutionBad Response Time

Response time ~ 2 ms, Transaction rate ~ 34,000 TPS

Application server changes applied here

Page 18: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Response Time Demo

• Data analysis shows:

– Small proportion of the actual response time is in the database

–Majority of response time spent in application logic

– CPU is overloaded on the application servers

– Potential root cause: • Capacity planning mistake ?

• Application code change last week ?

Application Server Bottleneck

Page 19: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Performance is always and only about time

• Human time is critical to the enterprise

• Systems performance affects business goals

– Human time + technology resource time

• “Time is money”

• Performance improvement means doing things faster

Page 20: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Database Time (DB Time)

• Total time in database calls by foreground sessions

• Includes CPU time, IO time and non-idle wait time

• DB Time <> response time

• Common currency for Oracle performance analysis

Database time is total time spent by user processes either actively working or actively waiting in a database call.

Page 21: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Where is DB Time used?

• ADDM

• EM Performance page and drill downs

• EM Express

• ASH report

• AWR and AWR compare periods reports

Page 22: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

timet0 t1

Avg Active Sessions and DB TimeActive sessions

t = 1 sec

ASH sample count is value of active sessions function at sample times

DB Time

DB time is area under curve

Page 23: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Copyright © 2014, Oracle and/or its affiliates. All rights reserved. |

Page 24: Real-World Performance Training - Oracle · Database Performance Core Principles •The Oracle database is a process based architecture •To perform efficiently each process requires,

Recommended