Troubleshooting Dennis Shasha and Philippe Bonnet, 2013.

Slides:



Advertisements
Similar presentations
1 CS 5226: Database Administration and Performance Tuning.
Advertisements

Database Tuning Principles, Experiments and Troubleshooting Techniques Baseado nos slides do tutorial com o mesmo nome da autoria de: Dennis Shasha
Performance Tuning Compiled from: Oracle Database Administration, Session 13, Performance, Harvard U Oracle Server Tuning Accelerator, David Scott, Intec.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Overview of performance tuning strategies Oracle Performance Tuning Allan Young June 2008.
Adam Jorgensen Pragmatic Works Performance Optimization in SQL Server Analysis Services 2008.
Database System Concepts and Architecture
Performance and Scalability. Optimizing PerformanceScaling UpScaling Out.
Keeping our websites running - troubleshooting with Appdynamics Benoit Villaumie Lead Architect Guillaume Postaire Infrastructure Manager.
AOBD 07/08H. Galhardas DBMS Performance Monitoring.
Chapter 14 Chapter 14: Server Monitoring and Optimization.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Measuring Performance Chapter 12 CSE807. Performance Measurement To assist in guaranteeing Service Level Agreements For capacity planning For troubleshooting.
1 External Sorting for Query Processing Yanlei Diao UMass Amherst Feb 27, 2007 Slides Courtesy of R. Ramakrishnan and J. Gehrke.
Chapter 9 Overview  Reasons to monitor SQL Server  Performance Monitoring and Tuning  Tools for Monitoring SQL Server  Common Monitoring and Tuning.
Module 8: Monitoring SQL Server for Performance. Overview Why to Monitor SQL Server Performance Monitoring and Tuning Tools for Monitoring SQL Server.
Connect with life Praveen Srvatsa Director | AsthraSoft Consulting Microsoft Regional Director, Bangalore Microsoft MVP, ASP.NET.
Module 15: Monitoring. Overview Formulate requirements and identify resources to monitor in a database environment Types of monitoring that can be carried.
1 CSE544 Database Architecture Tuesday, February 1 st, 2011 Slides courtesy of Magda Balazinska.
Module 8: Server Management. Overview Server-level and instance-level resources such as memory and processes Database-level resources such as logical.
Performance and Scalability. Performance and Scalability Challenges Optimizing PerformanceScaling UpScaling Out.
Computer System Lifecycle Chapter 1. Introduction Computer System users, administrators, and designers are all interested in performance evaluation. Whether.
IBM Software Group Washington Area Informix User Group Forum 2004 The DB2 DBA Checklist Dwaine R Snow, DB2 & Informix.
Continuous resource monitoring for self-predicting DBMS Dushyanth Narayanan 1 Eno Thereska 2 Anastassia Ailamaki 2 1 Microsoft Research-Cambridge, 2 Carnegie.
Database Systems: Design, Implementation, and Management Tenth Edition Chapter 11 Database Performance Tuning and Query Optimization.
Database Systems: Design, Implementation, and Management Eighth Edition Chapter 10 Database Performance Tuning and Query Optimization.
2 Copyright © 2006, Oracle. All rights reserved. Performance Tuning: Overview.
CSC271 Database Systems Lecture # 30.
Introduction. Outline What is database tuning What is changing The trends that impact database systems and their applications What is NOT changing The.
Index tuning-- B+tree. overview © Dennis Shasha, Philippe Bonnet 2001 B+-Tree Locking Tree Traversal –Update, Read –Insert, Delete phantom problem: need.
 DATABASE DATABASE  DATABASE ENVIRONMENT DATABASE ENVIRONMENT  WHY STUDY DATABASE WHY STUDY DATABASE  DBMS & ITS FUNCTIONS DBMS & ITS FUNCTIONS 
A Metadata Based Approach For Supporting Subsetting Queries Over Parallel HDF5 Datasets Vignesh Santhanagopalan Graduate Student Department Of CSE.
March 19981© Dennis Adams Associates Tuning Oracle: Key Considerations Dennis Adams 25 March 1998.
Lecture Set 14 B new Introduction to Databases - Database Processing: The Connected Model (Using DataReaders)
© Dennis Shasha, Philippe Bonnet – 2013 Communicating with the Outside.
Oracle9i Performance Tuning Chapter 1 Performance Tuning Overview.
Oracle Tuning Considerations. Agenda Why Tune ? Why Tune ? Ways to Improve Performance Ways to Improve Performance Hardware Hardware Software Software.
Oracle Tuning Ashok Kapur Hawkeye Technology, Inc.
© Dennis Shasha, Alberto Lerner, Philippe Bonnet 2004 DBMS Performance Monitoring.
1 Wenguang WangRichard B. Bunt Department of Computer Science University of Saskatchewan November 14, 2000 Simulating DB2 Buffer Pool Management.
Oracle9i Performance Tuning Chapter 12 Tuning Tools.
SEMANTEC 1 Oracle Performance Tuning - Part I Krasen Paskalev Oracle 8i Certified DBA.
© Dennis Shasha, Philippe Bonnet 2001 Log Tuning.
By Shanna Epstein IS 257 September 16, Cnet.com Provides information, tools, and advice to help customers decide what to buy and how to get the.
© Dennis Shasha, Alberto Lerner, Philippe Bonnet 2004 DBMS Performance Monitoring.
CS338Parallel and Distributed Databases11-1 Parallel and Distributed Databases Lecture Topics Multi-CPU and distributed systems Monolithic system Client–server.
Communicating with the Outside. Hardware [Processor(s), Disk(s), Memory] Operating System Concurrency ControlRecovery Storage Subsystem Indexes Query.
CERN IT Department CH-1211 Geneva 23 Switzerland t Oracle Tutorials CERN June 8 th, 2012 Performance Tuning.
CSC Multiprocessor Programming, Spring, 2012 Chapter 11 – Performance and Scalability Dr. Dale E. Parson, week 12.
Physical Database Design Purpose- translate the logical description of data into the technical specifications for storing and retrieving data Goal - create.
MISSION CRITICAL COMPUTING Siebel Database Considerations.
Query Optimization CMPE 226 Database Systems By, Arjun Gangisetty
Your Data Any Place, Any Time Performance and Scalability.
1 Copyright © 2005, Oracle. All rights reserved. Following a Tuning Methodology.
Lock Tuning. Overview Data definition language (DDL) statements are considered harmful DDL is the language used to access and manipulate catalog or metadata.
Copyright Sammamish Software Services All rights reserved. 1 Prog 140  SQL Server Performance Monitoring and Tuning.
Troubleshooting Dennis Shasha and Philippe Bonnet, 2013.
SQL Advanced Monitoring Using DMV, Extended Events and Service Broker Javier Villegas – DBA | MCP | MCTS.
3 Copyright © 2006, Oracle. All rights reserved. Designing and Developing for Performance.
Oracle Database Architectural Components
© Dennis Shasha, Alberto Lerner, Philippe Bonnet 2004 DBMS Performance Monitoring.
SQL Database Management
CS 540 Database Management Systems
SQL Server Monitoring Overview
Database Performance Tuning and Query Optimization
Troubleshooting Techniques(*)
Chapter 11 Database Performance Tuning and Query Optimization
Performance And Scalability In Oracle9i And SQL Server 2000
Query Processing.
CSC Multiprocessor Programming, Spring, 2011
Presentation transcript:

Troubleshooting Dennis Shasha and Philippe Bonnet, 2013

Outline DBMS architecture overview – Overview for now – More details as we progress through lectures Troubleshooting and experimentation Troubleshooting methodologies – Resource consumption model – Time-spent Dennis Shasha and Philippe Bonnet, 2013

Traditional Architecture DBMS Application OS HW Q DATA Result Set DBMS Client Dennis Shasha and Philippe Bonnet, 2013

Streaming Dennis Shasha and Philippe Bonnet, 2013 Data (stream) Q Result Set (stream) DBMS LOOK UP: DEBS2013 Grand ChallengeDEBS2013 Grand Challenge

DBMS Components Query Processor Concurrency ControlRecovery Storage Subsystem Indexes Compiler Parser Execution Engine Buffer Dennis Shasha and Philippe Bonnet, 2013

DB2 9.7 Process Dennis Shasha and Philippe Bonnet, 2013 Source: Exercise 2.1: Is intra-query parallelism possible with this process model? In other words, can a query be executed in parallel within a same instance (or partition)? Exercise 2.1: Is intra-query parallelism possible with this process model? In other words, can a query be executed in parallel within a same instance (or partition)?

DB Process Architecture Source: Dennis Shasha and Philippe Bonnet, 2013 No need to know much more about the process abstractions. We will cover much more on the memory abstractions (log tuning), and on the communication abstractions (tuning the application interface, tuning across instances).

MySQL Dennis Shasha and Philippe Bonnet, 2013 Source:

Troubleshooting: Why Production – Users/manager complaints. – Needs monitoring. What is going on NOW? – Once identified, a problem should be represented in a synthetic form (so that others can avoid the problem, or as a request for new features from DBMS/OS) Test – New application / New system / New functionalities / New scale – Can system keep performance up in new settings? – Needs Dennis Shasha and Philippe Bonnet, 2013

Troubleshooting: How You MUST measure system performance (black box) – Profiling tools You MUST instrument your system to get some insight about the internal processes (white box) – System instrumentation You MUST follow a systematic approach for troubleshooting / experimentation – Scientific Method – Troubleshooting Dennis Shasha and Philippe Bonnet, 2013

Experimental Framework 1.System – Application + DBMS + OS + HW – Parameters (fixed/factors) 2.Metrics – Throughput / Response Time – DBMS performance indicators – OS performance indicators 3.Workload – Actual users (production), replay trace or synthetic workload (e.g., TPC benchmark) 4.Experiments – What factor to Dennis Shasha and Philippe Bonnet, 2013 Exercise 2.2: Is throughput always the inverse of response time? Exercise 2.2: Is throughput always the inverse of response time? Exercise 2.3: Define an experiment to measure the write throughput of the file system on your laptop Exercise 2.3: Define an experiment to measure the write throughput of the file system on your laptop

Performance Indicators Type – Counter – Watermark – Gauge – Timestamp Scope – System-wide (snapshot) vs. workload-specific (activity detail) Collection – switched on/off vs. triggered by a specific event – File dump vs. materialized view Frequency of update of the materialized view Access – Table functions, views, XML files – Alert triggered by a specific Dennis Shasha and Philippe Bonnet, 2013 LOOKUP: DB2 monitor elements and interfaces for monitoring, Oracle dynamic performance viewsDB2 monitor elementsnterfaces for monitoringOracle dynamic performance views Exercise 2.4: What are system-wide indicators good for? Exercise 2.4: What are system-wide indicators good for?

Example Statement number: 1 select C_NAME, N_NAME from DBA.CUSTOMER join DBA.NATION on C_NATIONKEY = N_NATIONKEY where C_ACCTBAL > 0 Number of rows retrieved is: Number of rows sent to output is: 0 Elapsed Time is: seconds … Buffer pool data logical reads = Buffer pool data physical reads = Buffer pool data writes = 0 Buffer pool index logical reads = Buffer pool index physical reads = 552 Buffer pool index writes = 0 Total buffer pool read time (ms) = Total buffer pool write time (ms) = 0 … Summary of Results ================== Elapsed Agent CPU Rows Rows Statement # Time (s) Time (s) Fetched Printed DBMS OS Exercise 2.7: Which are the profiling tools on your laptop OS? Exercise 2.7: Which are the profiling tools on your laptop OS? Exercise 2.6: What are the 11 system wide indicators recommended for DB2 10.1?11 system wide indicators Exercise 2.6: What are the 11 system wide indicators recommended for DB2 10.1?11 system wide indicators Windows: Performance monitor Linux: iostat, vmstat More on this in tuning the guts.

Troubleshooting Methodologies Resource Consumption Model (Chapter 7) Primary, DBMS system resources Applications as consumers Instrumentation through counters/watermarks/gauge Time Spent Model response time = execution time + wait time Instrumentation through Dennis Shasha and Philippe Bonnet, 2013 Exercise 2.5: Does DB2 top follow the resource consumption or time spent model?DB2 top Exercise 2.5: Does DB2 top follow the resource consumption or time spent model?DB2 top

Resource Consumption Dennis Shasha and Philippe Bonnet, 2013 An overloading high-level consumer A poorly parameterized subsystem An overloaded primary resource Effects are not always felt first where the cause is!

Resource Consumption Dennis Shasha and Philippe Bonnet, 2013 Question 1: Are critical queries being served in the most efficient manner? Question 2: Are subsystems making optimal use of resources? Question 3: Are there enough primary resources available? Extract indicators to answer the following questions

Dennis Shasha and Philippe Bonnet, 2013 Which are the critical queries? Ask users. Use query log to find queries that take longest. Resource Usage Check out system-wide performance indicators. Use rules of thumbs to check whether they are ok.

Fine Granularity Analysis LOOK UP: – Index usage analysis in DB Index usage analysis – Event and resource monitoring in DB Event and resource Dennis Shasha and Philippe Bonnet, 2013

Time Spent Model Given a critical query / session Where does the time go? – Throughout DBMS/OS/HW components – Waiting / Executing – Find out which components cause a session to be Dennis Shasha and Philippe Bonnet, 2013 LOOK UP: Cary Millsap’s book: Oracle Operational Timing Presentation Issues: How to instrument ONLY a given critical query/sesssion What timestamps indicators are available? Issues: How to instrument ONLY a given critical query/sesssion What timestamps indicators are available?

Example: IBM DB Time-spent monitors Wait time Processing time Elapsed time Scope Database Application handle Workload Resource (lock, buffer, Dennis Shasha and Philippe Bonnet, 2013 LOOK UP: DB GET SNAPSHOT, MON_GET_ACTIVITY_DETAILS table function, work identification by origin with workloadsGET SNAPSHOTMON_GET_ACTIVITY_DETAILS work identification by origin with workloads

@ Dennis Shasha and Philippe Bonnet, 2013 Exercise 2.8: Assume your DBMS is DB express C. How can you answer the following questions: How many IOs are performed from the command line for the execution of a given query? How many pages are actually read? How much space is used in the buffer pool? How much time is spent performing those IOs? What percentage of the total execution time does it take to perform those IOs? What portion of those IOs are sequential? How much overhead is there in obtaining the answer to those questions? Exercise 2.8: Assume your DBMS is DB express C. How can you answer the following questions: How many IOs are performed from the command line for the execution of a given query? How many pages are actually read? How much space is used in the buffer pool? How much time is spent performing those IOs? What percentage of the total execution time does it take to perform those IOs? What portion of those IOs are sequential? How much overhead is there in obtaining the answer to those questions?

@ Dennis Shasha and Philippe Bonnet, 2013 Exercise 2.8: mon_IO.sql SELECT A.AGENT_ID, B.ROWS_RETURNED, B.ROWS_READ, (B.POOL_DATA_L_READS + B.POOL_INDEX_L_READS + B.POOL_TEMP_DATA_L_READS + B.POOL_TEMP_INDEX_L_READS) as BUFFER_POOL_READS, (B.POOL_DATA_P_READS + B.POOL_INDEX_P_READS + B.POOL_TEMP_DATA_P_READS + B.POOL_TEMP_INDEX_P_READS) as IO_TOTAL, B.POOL_READ_TIME as IO_TIME, B.CLIENT_IDLE_WAIT_TIME as CLIENT_WAIT_TIME, B.TOTAL_RQST_TIME as DB2_SPENT_TIME, B.TOTAL_WAIT_TIME as DB2_WAIT_TIME, B.TOTAL_COMPILE_TIME as DB2_COMPILE_TIME, B.TOTAL_SECTION_PROC_TIME as DB2_SECTION_TIME, B.TOTAL_COMMIT_PROC_TIME as DB2_COMMIT_TIME, B.TOTAL_ROLLBACK_PROC_TIME as DB2_ROLLBACK_TIME, B.TOTAL_RUNSTATS_PROC_TIME as DB2_RUNSTATS_TIME, B.TOTAL_REORG_PROC_TIME as DB2_REORG_TIME, B.TOTAL_LOAD_PROC_TIME as DB2_LOAD_TIME FROM SYSIBMADM.APPLICATIONS A, TABLE(MON_GET_CONNECTION(cast(NULL as bigint), -1)) B WHERE A.DB_NAME = 'TUNING' AND SUBSTR(A.APPL_NAME,1,5) = 'db2bp' AND A.AGENT_ID = B.APPLICATION_HANDLE ; Exercise 2.8: mon_IO.sql SELECT A.AGENT_ID, B.ROWS_RETURNED, B.ROWS_READ, (B.POOL_DATA_L_READS + B.POOL_INDEX_L_READS + B.POOL_TEMP_DATA_L_READS + B.POOL_TEMP_INDEX_L_READS) as BUFFER_POOL_READS, (B.POOL_DATA_P_READS + B.POOL_INDEX_P_READS + B.POOL_TEMP_DATA_P_READS + B.POOL_TEMP_INDEX_P_READS) as IO_TOTAL, B.POOL_READ_TIME as IO_TIME, B.CLIENT_IDLE_WAIT_TIME as CLIENT_WAIT_TIME, B.TOTAL_RQST_TIME as DB2_SPENT_TIME, B.TOTAL_WAIT_TIME as DB2_WAIT_TIME, B.TOTAL_COMPILE_TIME as DB2_COMPILE_TIME, B.TOTAL_SECTION_PROC_TIME as DB2_SECTION_TIME, B.TOTAL_COMMIT_PROC_TIME as DB2_COMMIT_TIME, B.TOTAL_ROLLBACK_PROC_TIME as DB2_ROLLBACK_TIME, B.TOTAL_RUNSTATS_PROC_TIME as DB2_RUNSTATS_TIME, B.TOTAL_REORG_PROC_TIME as DB2_REORG_TIME, B.TOTAL_LOAD_PROC_TIME as DB2_LOAD_TIME FROM SYSIBMADM.APPLICATIONS A, TABLE(MON_GET_CONNECTION(cast(NULL as bigint), -1)) B WHERE A.DB_NAME = 'TUNING' AND SUBSTR(A.APPL_NAME,1,5) = 'db2bp' AND A.AGENT_ID = B.APPLICATION_HANDLE ;

@ Dennis Shasha and Philippe Bonnet, 2013 Exercise 2.8: Let us assume you are done with the GettingStarted exercise, then the aircraft table has been populated inside the tuning database on the db2inst1 instance db2 connect to tuning db2 –f mon_IO.sql db2 “select * from aircraft” db2 –f mon_IO.sql Exercise 2.8: Let us assume you are done with the GettingStarted exercise, then the aircraft table has been populated inside the tuning database on the db2inst1 instance db2 connect to tuning db2 –f mon_IO.sql db2 “select * from aircraft” db2 –f mon_IO.sql