Performance Measures(Cont.) Mean time to failure(MTTF)-the average time the disk is expected to run continuously without any failure. Typically 3 to 5 years Probability of failure of new disks is quite low,corresponding to a theoretical MTTF"of 500,000 to 1,200,000 hours for a new disk E.g.,an MTTF of 1,200,000 hours for a new disk means that given 1000 relatively new disks,on an average one will fail every 1200 hours MTTF decreases as disk ages Database System Concepts-6th Edition 10.17 @Silberschatz,Korth and Sudarshan
Database System Concepts - 6 10.17 ©Silberschatz, Korth and Sudarshan th Edition Performance Measures (Cont.) Mean time to failure (MTTF) – the average time the disk is expected to run continuously without any failure. Typically 3 to 5 years Probability of failure of new disks is quite low, corresponding to a “theoretical MTTF” of 500,000 to 1,200,000 hours for a new disk E.g., an MTTF of 1,200,000 hours for a new disk means that given 1000 relatively new disks, on an average one will fail every 1200 hours MTTF decreases as disk ages
Optimization of Disk-Block Access Block-a contiguous sequence of sectors from a single track data is transferred between disk and main memory in blocks sizes range from 512 bytes to several kilobytes Smaller blocks:more transfers from disk Larger blocks:more space wasted due to partially filled blocks Typical block sizes today range from 4 to 16 kilobytes Disk-arm-scheduling algorithms order pending accesses to tracks so that disk arm movement is minimized elevator algorithm: R6 R3 R1 R5 R2 R4 Inner track Outer track Database System Concepts -6th Edition 10.18 @Silberschatz,Korth and Sudarshan
Database System Concepts - 6 10.18 ©Silberschatz, Korth and Sudarshan th Edition Optimization of Disk-Block Access Block – a contiguous sequence of sectors from a single track data is transferred between disk and main memory in blocks sizes range from 512 bytes to several kilobytes Smaller blocks: more transfers from disk Larger blocks: more space wasted due to partially filled blocks Typical block sizes today range from 4 to 16 kilobytes Disk-arm-scheduling algorithms order pending accesses to tracks so that disk arm movement is minimized elevator algorithm: R6 R3 R1 R5 R2 R4 Inner track Outer track
Optimization of Disk Block Access (Cont.) File organization-optimize block access time by organizing the blocks to correspond to how data will be accessed E.g.Store related information on the same or nearby cylinders. Files may get fragmented over time E.g.if data is inserted to/deleted from the file Or free blocks on disk are scattered,and newly created file has its blocks scattered over the disk Sequential access to a fragmented file results in increased disk arm movement Some systems have utilities to defragment the file system,in order to speed up file access Database System Concepts-6th Edition 10.19 @Silberschatz,Korth and Sudarshan
Database System Concepts - 6 10.19 ©Silberschatz, Korth and Sudarshan th Edition Optimization of Disk Block Access (Cont.) File organization – optimize block access time by organizing the blocks to correspond to how data will be accessed E.g. Store related information on the same or nearby cylinders. Files may get fragmented over time E.g. if data is inserted to/deleted from the file Or free blocks on disk are scattered, and newly created file has its blocks scattered over the disk Sequential access to a fragmented file results in increased disk arm movement Some systems have utilities to defragment the file system, in order to speed up file access
Optimization of Disk Block Access (Cont.) Nonvolatile write buffers speed up disk writes by writing blocks to a non-volatile RAM buffer immediately Non-volatile RAM:battery backed up RAM or flash memory Even if power fails,the data is safe and will be written to disk when power returns Controller then writes to disk whenever the disk has no other requests or request has been pending for some time Database operations that require data to be safely stored before continuing can continue without waiting for data to be written to disk Writes can be reordered to minimize disk arm movement Log disk-a disk devoted to writing a sequential log of block updates Used exactly like nonvolatile RAM Write to log disk is very fast since no seeks are required No need for special hardware (NV-RAM) File systems typically reorder writes to disk to improve performance Journaling file systems write data in safe order to NV-RAM or log disk Reordering without journaling:risk of corruption of file system data Database System Concepts-6th Edition 10.20 ©Silberschat乜,Korth and Sudarshan
Database System Concepts - 6 10.20 ©Silberschatz, Korth and Sudarshan th Edition Nonvolatile write buffers speed up disk writes by writing blocks to a non-volatile RAM buffer immediately Non-volatile RAM: battery backed up RAM or flash memory Even if power fails, the data is safe and will be written to disk when power returns Controller then writes to disk whenever the disk has no other requests or request has been pending for some time Database operations that require data to be safely stored before continuing can continue without waiting for data to be written to disk Writes can be reordered to minimize disk arm movement Log disk – a disk devoted to writing a sequential log of block updates Used exactly like nonvolatile RAM Write to log disk is very fast since no seeks are required No need for special hardware (NV-RAM) File systems typically reorder writes to disk to improve performance Journaling file systems write data in safe order to NV-RAM or log disk Reordering without journaling: risk of corruption of file system data Optimization of Disk Block Access (Cont.)