CPSC-608 Database Systems Fall 2008 Instructor: Jianer Chen Office: HRBB 309B Phone: 845-4259 Notes #6.

Slides:



Advertisements
Similar presentations
DISK FAILURES PROF. T.Y.LIN CS-257 Presenter: Shailesh Benake(104)
Advertisements

I/O Management and Disk Scheduling
- Dr. Kalpakis CMSC Dr. Kalpakis 1 Outline In implementing DBMS we need to answer How should the system store and manage very large amounts of data?
I/O Management and Disk Scheduling
RAID Redundant Array of Independent Disks
CS 6560: Operating Systems Design
CSCE430/830 Computer Architecture
Operating Systems ECE344 Ashvin Goel ECE University of Toronto Disks and RAID.
CS 277 – Spring 2002Notes 21 CS 277: Database System Implementation Notes 02: Hardware Arthur Keller.
RAID- Redundant Array of Inexpensive Drives. Purpose Provide faster data access and larger storage Provide data redundancy.
Using Secondary Storage Effectively In most studies of algorithms, one assumes the "RAM model“: –The data is in main memory, –Access to any item of data.
Reliability of Disk Systems. Reliability So far, we looked at ways to improve the performance of disk systems. Next, we will look at ways to improve the.
Performance/Reliability of Disk Systems So far, we looked at ways to improve the performance of disk systems. Next, we will look at ways to improve the.
Disk Access Model. Using Secondary Storage Effectively In most studies of algorithms, one assumes the “RAM model”: –Data is in main memory, –Access to.
SECTION 13.3 Eilbroun Benjamin CS 257 – Dr. TY Lin SECONDARY STORAGE MANAGEMENT.
Computer ArchitectureFall 2007 © November 28, 2007 Karem A. Sakallah Lecture 24 Disk IO and RAID CS : Computer Architecture.
1 Storage (cont’d) Disk scheduling Reducing seek time (cont’d) Reducing rotational latency RAIDs.
Other Disk Details. 2 Disk Formatting After manufacturing disk has no information –Is stack of platters coated with magnetizable metal oxide Before use,
Lecture 17 I/O Optimization. Disk Organization Tracks: concentric rings around disk surface Sectors: arc of track, minimum unit of transfer Cylinder:
Computer ArchitectureFall 2008 © November 12, 2007 Nael Abu-Ghazaleh Lecture 24 Disk IO.
Cse Feb-001 CSE 451 Section February 24, 2000 Project 3 – VM.
SECTIONS 13.1 – 13.3 Sanuja Dabade & Eilbroun Benjamin CS 257 – Dr. TY Lin SECONDARY STORAGE MANAGEMENT.
CPSC-608 Database Systems Fall 2009 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #5.
CPSC-608 Database Systems Fall 2010 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #5.
Disks CS 416: Operating Systems Design, Spring 2001 Department of Computer Science Rutgers University
Secondary Storage CSCI 444/544 Operating Systems Fall 2008.
CS 4432lecture #31 CS4432: Database Systems II Lecture #3 Using the Disk, and Disk Optimizations Professor Elke A. Rundensteiner.
Data Representation Recovery from Disk Crashes – 13.4 Presented By: Deepti Bhardwaj Roll No. 223_103 SJSU ID:
I/O Systems and Storage Systems May 22, 2000 Instructor: Gary Kimura.
CS4432: Database Systems II Data Storage (Better Block Organization) 1.
1 Storage Refinement. Outline Disk failures To attack Intermittent failures To attack Media Decay and Write failure –Checksum To attack Disk crash –RAID.
CS 346 – Chapter 10 Mass storage –Advantages? –Disk features –Disk scheduling –Disk formatting –Managing swap space –RAID.
Storage & Peripherals Disks, Networks, and Other Devices.
CS 352 : Computer Organization and Design University of Wisconsin-Eau Claire Dan Ernst Storage Systems.
1 Recitation 8 Disk & File System. 2 Disk Scheduling Disks are at least four orders of magnitude slower than main memory –The performance of disk I/O.
Chapter 2 Data Storage How does a computer system store and manage very large volumes of data ?
N-Tier Client/Server Architectures Chapter 4 Server - RAID Copyright 2002, Dr. Ken Hoganson All rights reserved. OS Kernel Concept RAID – Redundant Array.
Disk Access. DISK STRUCTURE Sector: Smallest unit of data transfer from/to disk; 512B 2/4/8 adjacent sectors transferred together: Blocks Read/write heads.
Lecture 9 of Advanced Databases Storage and File Structure (Part II) Instructor: Mr.Ahmed Al Astal.
CMPT 454, Simon Fraser University, Fall 2009, Martin Ester 29 Database Systems II Secondary Storage.
Disk Structure Disk drives are addressed as large one- dimensional arrays of logical blocks, where the logical block is the smallest unit of transfer.
Chapter 111 Chapter 11: Hardware (Slides by Hector Garcia-Molina,
CE Operating Systems Lecture 20 Disk I/O. Overview of lecture In this lecture we will look at: Disk Structure Disk Scheduling Disk Management Swap-Space.
Disks Chapter 5 Thursday, April 5, Today’s Schedule Input/Output – Disks (Chapter 5.4)  Magnetic vs. Optical Disks  RAID levels and functions.
Chapter 2. Data Storage Chapter 2.
I/O and Disk Scheduling CS Spring Overview Review of I/O Techniques I/O Buffering Disk Geometry Disk Scheduling Algorithms RAID.
1 Data Storage (Chap. 11) Based on Hector Garcia-Molina’s slides.
CPSC 404, Laks V.S. Lakshmanan1 External Sorting Chapter 13 (Sec ): Ramakrishnan & Gehrke and Chapter 11 (Sec ): G-M et al. (R2) OR.
CPSC 404, Laks V.S. Lakshmanan1 External Sorting Chapter 13: Ramakrishnan & Gherke and Chapter 2.3: Garcia-Molina et al.
RAID Disk Arrays Hank Levy. 212/5/2015 Basic Problems Disks are improving, but much less fast than CPUs We can use multiple disks for improving performance.
CPSC-608 Database Systems Fall 2015 Instructor: Jianer Chen Office: HRBB 315C Phone: Notes #5.
DBMS 2001Notes 2: Hardware1 Principles of Database Management Systems Pekka Kilpeläinen (after Stanford CS245 slide originals by Hector Garcia-Molina,
Part IV I/O System Chapter 12: Mass Storage Structure.
Disk Failures Skip. Index 13.4 Disk Failures Intermittent Failures Organizing Data by Cylinders Stable Storage Error- Handling.
CS 245Notes 21 Database System Principles Notes 02: Hardware.
Reliability of Disk Systems. Reliability So far, we looked at ways to improve the performance of disk systems. Next, we will look at ways to improve the.
CS422 Principles of Database Systems Disk Access Chengyu Sun California State University, Los Angeles.
© Janice Regan, CMPT 300, May CMPT 300 Introduction to Operating Systems DISK I/0.
Multiple Platters.
Disks and RAID.
CS 554: Advanced Database System Notes 02: Hardware
CPSC-608 Database Systems
RAID Disk Arrays Hank Levy 1.
RAID Disk Arrays Hank Levy 1.
CSE 451: Operating Systems Spring 2005 Module 17 Redundant Arrays of Inexpensive Disks (RAID) Ed Lazowska Allen Center 570.
CSE 451: Operating Systems Autumn 2004 Redundant Arrays of Inexpensive Disks (RAID) Hank Levy 1.
RAID Disk Arrays Hank Levy 1.
Disk Failures Disk failure ways and their mitigation
Disk Scheduling The operating system is responsible for using hardware efficiently — for the disk drives, this means having a fast access time and disk.
CS 245: Database System Principles Notes 02: Hardware
Presentation transcript:

CPSC-608 Database Systems Fall 2008 Instructor: Jianer Chen Office: HRBB 309B Phone: Notes #6

Optimizing Disk Access

(By reducing the seek time and rotational delay via Operating Systems and Disk Controllers)

Optimizing Disk Access (By reducing the seek time and rotational delay via Operating Systems and Disk Controllers) 3 or 5x x 1N Cylinders Traveled Time Average seek time = 20 ms Shortest seek time = 5 ms Average rotational delay = 8 ms

Dealing with many random accesses (disk scheduling) Suppose that we have a large (dynamic) sequence of disk read/write tasks, on blocks randomly distributed in the disk. How do we order the tasks so that the total time can be minimized? Elevator algorithm

Disk head makes sweeps across the disk, stops at a cylinder if a task reads/writes a block in the cylinder, and reverses its direction if no read/write tasks (at that moment) ahead. Intuitively good, in particular when there are a large number of tasks reading/writing blocks uniformly distributed in the disk Real-time manner Precise analysis is difficult

Dealing with a long sequence of data on disk Data in consecutive cylinders Larger buffer Pre-fetch/double buffering Disk arrays Mirrored disks

Example. Sorting on disk (again) A relation R of 10M tuples takes 100K blocks Main memory can store 6400 blocks A disk block read/write: 40 ms seek time = 31 ms, rotational delay = 8 ms transfer time = 1 ms Two-phase Multiway Sorting on randomly distributed blocks takes about 4.5 hours. Also assume that a track holds 500 blocks, and that traversing one cylinder takes 5 ms

Data in consecutive cylinders In phase 1, suppose that we have the input relation stored in consecutive tracks We can read/write 6400 consecutive blocks between main memory and disks Phase 1 read/write: 2*(100K/6400)( * *1) ≈ ms < 4 minutes (save 2 hour)

Larger Buffer In phase 2, we have 16 sublists, each takes a block in main memory, with 6384 blocks left. If we use all these 6384 blocks for output buffer, and write them to disk only when they are all full: Phase 2 writing: (100K/6384)( * *1) = ms < 2 minutes (save 1 hour)

However The reading in phase 2 seems harder to improve: it is kind of random.

Double Buffering For applications where the read/write is predictable. Have a program » Process B1 » Process B2 » Process B3...

Single Buffer Solution 1.Read B1  Buffer 2.Process Data in Buffer 3.Read B2  Buffer 4.Process Data in Buffer... Let P = time to process/block R = time to read in 1 block n = # blocks Single buffer time = n(P+R)

Double Buffering Memory: Disk: ABCDGEF

Double Buffering Memory: Disk: ABCDGEFA

Double Buffering Memory: Disk: ABCDGEF B done process A

Double Buffering Memory: Disk: ABCDGEF C process B done

if P  R Double buffering time = R + nP Single buffering time = n(R+P) P = Processing time/block R = IO time/block n = # blocks

Disk Arrays Taking the advantage that disk read/write can be done in parallel between a single CPU and multiple disks. logically one disk Would not help if the interesting blocks are in the same disk

Mirrored Disks Duplicating disks so that multiple reads in the same disk can be done in parallel. A A B B Writing is more (but not much) expensive

Disk Failures Partial  Total Intermittent  Permanent

Coping with Disk Failures Detection –Checksum Correction –Redundancy

At what level do we cope? Operating System Level (Stable Storage) Logical block Copy A Copy B Database System Level (Log File) Log Current DB Yesterday’s DB

Intermittent Failure Detection (Checksums) Idea: add n parity bits every m data bits –Ex.: m=8, n=1 Block A: :1 (odd # of 1’s) Block B: :0(even # of 1’s) But suppose: Block A instead contains Block A’: :1 (also has odd # of 1’s)  50% change of detection per parity bit More parity bits decrease the probability of an undetected failure  1/2 n (with n ≤ m independent parity bits)

Disk Crash (Disk Arrays) RAIDs (Redundant Arrays of Inexpensive Drives) logically one disk

Disk Arrays RAID Level 1 (Mirroring) –Keep exact copy of data on redundant disks A A B B A A B B

Disk Arrays RAID Level 4 –Keep only one redundant disk –Entire parity blocks on redundant disk A A B B C C P P

Parity Blocks & Modulo-2 Sums Have an array of 3 data disks –Disk 1, block 1: –Disk 2, block 1: –Disk 3, block 1: … and 1 parity disk –Disk 4, block 1: Note: - Sum over each column is always an even # of 1’s - Mod-2 sum can recover any missing single row (e.g., a logical block)

Using Mod-2 Sums for Error Recovery –Suppose we have: –Disk 1, block 1: –Disk 2, block 1: ???????? –Disk 3, block 1: –Disk 4, block 1: (  Parity) –Mod-2 sums for block 1 over disks 1,3,4:  Disk 2, block 1:

Disk Arrays RAID Level 5 (Striping) –Like level 4, but balanced read & write load D D C C B B A A  Parity partition on each disk

Disk Arrays RAID Level 6 (error correction code) more powerful, can recover from more than one task crashes.