© 2006 IBM Corporation Adaptive Self-Tuning Memory in DB2 Adam Storm, Christian Garcia-Arellano, Sam Lightstone – IBM Toronto Lab Yixin Diao, M. Surendra.

Slides:



Advertisements
Similar presentations
IBM T.J. Watson Research Center Sigmetrics 2008 Tutorial: Introduction to Control Theory and Its Application to Computing Systems Self-Tuning Memory Management.
Advertisements

Chapter 9. Performance Management Enterprise wide endeavor Research and ascertain all performance problems – not just DBMS Five factors influence DB performance.
Module 13: Performance Tuning. Overview Performance tuning methodologies Instance level Database level Application level Overview of tools and techniques.
Hopkins Storage Systems Lab, Department of Computer Science Automated Physical Design in Database Caches T. Malik, X. Wang, R. Burns Johns Hopkins University.
Chapter 6: Memory Management
1 Adapted from UCB CS252 S01, Revised by Zhao Zhang in IASTATE CPRE 585, 2004 Lecture 14: Hardware Approaches for Cache Optimizations Cache performance.
1 A Self-Tuning Configurable Cache Ann Gordon-Ross and Frank Vahid* Department of Computer Science and Engineering University of California, Riverside.
Dynamic Load Balancing for VORPAL Viktor Przebinda Center for Integrated Plasma Studies.
Yoshiharu Ishikawa (Nagoya University) Yoji Machida (University of Tsukuba) Hiroyuki Kitagawa (University of Tsukuba) A Dynamic Mobility Histogram Construction.
IBM Software Group ® Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
Autonomic DBMSs: System Tune Thyself! Pat Martin Database Systems Laboratory School of Computing Supported by IBM, CITO and NSERC.
Chapter 4 M. Keshtgary Spring 91 Type of Workloads.
Online Performance Auditing Using Hot Optimizations Without Getting Burned Jeremy Lau (UCSD, IBM) Matthew Arnold (IBM) Michael Hind (IBM) Brad Calder (UCSD)
Karl Schnaitter and Neoklis Polyzotis (UC Santa Cruz) Serge Abiteboul (INRIA and University of Paris 11) Tova Milo (University of Tel Aviv) Automatic Index.
Chapter 6: Database Evolution Title: AutoAdmin “What-if” Index Analysis Utility Authors: Surajit Chaudhuri, Vivek Narasayya ACM SIGMOD 1998.
OS Fall ’ 02 Performance Evaluation Operating Systems Fall 2002.
High Performance Computing 1 Parallelization Strategies and Load Balancing Some material borrowed from lectures of J. Demmel, UC Berkeley.
DB2 Universal Database February 27, 2003 | BTW 2003 © 2003 IBM Corporation Automatic Database Configuration for DB2 Universal Database Compressing Years.
© 2008 Hewlett-Packard Development Company, L.P. The information contained herein is subject to change without notice Automated Workload Management in.
Lecture-8/ T. Nouf Almujally
Basics of Operating Systems March 4, 2001 Adapted from Operating Systems Lecture Notes, Copyright 1997 Martin C. Rinard.
IBM Software Group Washington Area Informix User Group Forum 2004 The DB2 DBA Checklist Dwaine R Snow, DB2 & Informix.
Introduction and simple using of Oracle Logistics Information System Yaxian Yao
Lecture 11: DMBS Internals
Storage Allocation in Prefetching Techniques of Web Caches D. Zeng, F. Wang, S. Ram Appeared in proceedings of ACM conference in Electronic commerce (EC’03)
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.
Page 19/17/2015 CSE 30341: Operating Systems Principles Optimal Algorithm  Replace page that will not be used for longest period of time  Used for measuring.
1 Robert Wijnbelt Health Check your Database A Performance Tuning Methodology.
Access Path Selection in a Relational Database Management System Selinger et al.
Monitoring the Essentials in DB2 10.5
Oracle Advanced Compression – Reduce Storage, Reduce Costs, Increase Performance Session: S Gregg Christman -- Senior Product Manager Vineet Marwah.
1 Wenguang WangRichard B. Bunt Department of Computer Science University of Saskatchewan November 14, 2000 Simulating DB2 Buffer Pool Management.
Querying Large Databases Rukmini Kaushik. Purpose Research for efficient algorithms and software architectures of query engines.
13 Copyright © 2006, Oracle. All rights reserved. Tuning PGA and Temporary Space.
Efficiently Processing Queries on Interval-and-Value Tuples in Relational Databases Jost Enderle, Nicole Schneider, Thomas Seidl RWTH Aachen University,
4.1 Advanced Operating Systems Desktop Scheduling You are running some long simulations. In the mean time, why not watch an illegally downloaded Simpsons.
Managing the Performance Impact of Administrative Utilities Paper by S. Parekh,K. Rose, J.Hellerstein, S. Lightstone, M.Huras, and V. Chang Presentation.
File Processing - Hash File Considerations MVNC1 Hash File Considerations.
1 Virtual Machine Memory Access Tracing With Hypervisor Exclusive Cache USENIX ‘07 Pin Lu & Kai Shen Department of Computer Science University of Rochester.
Self-Managing Cost Models Shivnath Babu Stanford University.
Goal-Oriented Buffer Management Revisited Kurt P. Brown, Michael J. Carey, Miron Livny Presented by Mike Nie.
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
Virtual Memory 1 1.
Virtual Memory The memory space of a process is normally divided into blocks that are either pages or segments. Virtual memory management takes.
Buffer-pool aware Query Optimization Ravishankar Ramamurthy David DeWitt University of Wisconsin, Madison.
Introduction to Query Optimization, R. Ramakrishnan and J. Gehrke 1 Introduction to Query Optimization Chapter 13.
Modeling Virtualized Environments in Simalytic ® Models by Computing Missing Service Demand Parameters CMG2009 Paper 9103, December 11, 2009 Dr. Tim R.
Bits Eugene Wu, Carlo Curino, Sam Madden
Typing Pattern Authentication Techniques 3 rd Quarter Luke Knepper.
Managing Web Server Performance with AutoTune Agents by Y. Diao, J. L. Hellerstein, S. Parekh, J. P. Bigus Presented by Changha Lee.
32nd International Conference on Very Large Data Bases September , 2006 Seoul, Korea Efficient Detection of Empty Result Queries Gang Luo IBM T.J.
Lecture 1: Basic Operators in Large Data CS 6931 Database Seminar.
DMBS Internals I February 24 th, What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the.
DMBS Internals I. What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently.
DMBS Architecture May 15 th, Generic Architecture Query compiler/optimizer Execution engine Index/record mgr. Buffer manager Storage manager storage.
What Should a DBMS Do? Store large amounts of data Process queries efficiently Allow multiple users to access the database concurrently and safely. Provide.
Introduction to Performance Tuning Chia-heng Tu PAS Lab Summer Workshop 2009 June 30,
Oracle Announced New In- Memory Database G1 Emre Eftelioglu, Fen Liu [09/27/13] 1 [1]
Closing the Query Processing Loop in Oracle 11g Allison Lee, Mohamed Zait.
Self-Tuning Memory Management of A Database System
Introduction to Query Optimization
Bank-aware Dynamic Cache Partitioning for Multicore Architectures
Lecture 11: DMBS Internals
Chapter 15 QUERY EXECUTION.
Predictive Performance
Qingbo Zhu, Asim Shankar and Yuanyuan Zhou
SQL Server Performance Tuning
Recommending Materialized Views and Indexes with the IBM DB2 Design Advisor (Automating Physical Database Design) Jarek Gryz.
COMP755 Advanced Operating Systems
Presentation transcript:

© 2006 IBM Corporation Adaptive Self-Tuning Memory in DB2 Adam Storm, Christian Garcia-Arellano, Sam Lightstone – IBM Toronto Lab Yixin Diao, M. Surendra – T.J. Watson Research Center IBM Toronto Lab VLDB 2006 | Seoul, Korea | September 13, 2006

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 2 The Memory Tuning Problem  Tuning the memory for an industrial RDBMS can be costly –Time consuming even for advanced users due to trial and error methods  Skill in memory tuning is difficult to find  Given a workload, determining memory requirements is difficult –Educated “trial and error” is state-of-the-art tuning method  Any static configuration may be sub-optimal for dynamic workloads  Effect on performance can be huge –Orders of magnitude

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 3 Previous Approaches to Memory Tuning  Wealth of previous approaches in the literature –Can be broadly divided into “Academic” and “Industrial” approaches  Academic Approaches –Sound theoretically, but can be difficult to implement –Hit rate estimations, assumptions on hit rate curve –In some cases, adding memory may create steps in the HR curve –Response time goals –Focused on one type of memory in isolation –Difficult to integrate several solutions into one comprehensive tuner  Industrial Approaches –Difficult to discern inner workings –Oracle –Unable to automatically determine value for total database memory usage –Can’t tune buffer pools which store pages larger than 4KB or trade memory between buffer pools and sort –Microsoft –Is able to automatically determine value for total database memory usage –Doesn’t appear to have sophisticated memory distribution algorithm

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 4 DB2’s Self Tuning Memory Manager (STMM)  Innovative cost-benefit analysis –Simulation technique vs. modeling  Tunes memory distribution and total memory usage  Simple greedy memory tuner  Control algorithms to avoid oscillations  Performs very well in experiments –For both OLTP and DSS

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 5 Cost-Benefit Analysis  How can memory requirements of one consumer be compared against another –Memory consumers can operate in drastically different ways –Buffer pools spend time doing I/O; Sort can uses I/O and CPU –Need a common metric  Metric chosen: simulated seconds saved memory required (in 4 KB pages)  Allows for comparison between different memory consumers  Calculated differently for each consumer using simulation techniques –Technique ensures accuracy of data

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 6 Buffer Pool Benefit Analysis  Technique simulates adding pages to the buffer pool  As pages are removed from buffer pool they are placed in the Simulated Buffer Pool eXtension (SBPX) –SBPX only requires page descriptor and not page data so memory requirements are small  When miss occurs on page read, SBPX is consulted  If page is found in SBPX, physical read would have been avoided if the SBPX contained real pages  For each miss found in SBPX, cost of physical I/O is timed –Allows for detection of asymmetrical read times –(Cumulative time saved) / (Size of SBPX) is the benefit of adding pages to the buffer pool

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 7 SBPX Operation Buffer Pool SBPX Disk 3. Page request for 4. Check Bufferpool 5. Check SBPX 6. Start timer 1. Victimize Page (move to SBPX)2. Load new page from disk7. Victimize BP page (send to SBPX) 8. Load page from disk 9. Stop timer

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 8 Compiled SQL Cache Benefit  Similar to buffer pool approach but Simulated SQL Cache eXtension (SSCX) stores compressed compiled SQL packages  When a package is not found in SQL Cache, SSCX is consulted  If package is found in SSCX then cost of query compilation is timed  (Cumulative time saved) / (Size of SSCX) is the benefit of adding pages to the SQL Cache

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 9 What about cost?  Only discussed benefit calculations –How can cost be calculated?  For the caches (buffer pools, SQL cache) it is possible to simulate cost but the simulation method is cost prohibitive –Extra computation on a miss is dwarfed by read time – not so with hits –In these cases we approximate cost as the inverse of benefit –If growth by 10 pages saves 5 seconds, shrinking by 10 pages will incur and additional 5 seconds of computation time –Can be a crude approximation (i.e. when benefit is 0) but works well in practice  In some other cases (ex. Sort) we can inexpensively determine an accurate cost

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 10 Greedy Memory Tuner  Simply takes memory from consumers with low cost and gives it to consumers with high benefit  Is able to determine how much memory to take from the OS based on free memory usage statistics –Tries to maintain some free physical memory at all times –Uses more memory (or frees up memory) based on current free physical memory and database’s free memory target –See paper for more detail  Has sleep/wake periods –Automatically adapted at run-time

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 11 Control Algorithms  Help reduce tuning oscillations  Used for two purposes –To control the amount of memory moved in each interval –To determine how much time to sleep between tuning intervals  Controlling the amount of memory moved –Two different algorithms (MIMO and Oscillation Dampening) –MIMO (Multiple Input Multiple Output) –Fits historical cost-benefit data to a curve –Uses curve to estimate distance from optimal memory configuration –Sets resize amount for optimal configuration in ~20 intervals –Oscillation Dampening –Used before MIMO model can be generated –Uses resize patterns to detect the presence of oscillations  Determining sleep time  Much more detail in the paper

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 12 Experimental results – tuning a static workload BP Size

Adaptive Self-Tuning Memory | VLDB 2006 | Seoul, Korea © 2006 IBM Corporation 13 Experimental results – workload shift

© 2006 IBM Corporation Adam Storm