Presentation is loading. Please wait.

Presentation is loading. Please wait.

SECTION 13.3 Eilbroun Benjamin CS 257 – Dr. TY Lin SECONDARY STORAGE MANAGEMENT.

Similar presentations


Presentation on theme: "SECTION 13.3 Eilbroun Benjamin CS 257 – Dr. TY Lin SECONDARY STORAGE MANAGEMENT."— Presentation transcript:

1 SECTION 13.3 Eilbroun Benjamin CS 257 – Dr. TY Lin SECONDARY STORAGE MANAGEMENT

2 Presentation Outline  13.3 Accelerating Access to Secondary Storage  13.3.1 The I/O Model of Computation  13.3.2 Organizing Data by Cylinders  13.3.3 Using Multiple Disks  13.3.4 Mirroring Disks  13.3.5 Disk Scheduling and the Elevator Algorithm  13.3.6 Prefetching and Large-Scale Buffering

3 13.3 Accelerating Access to Secondary Storage  Several approaches for more-efficiently accessing data in secondary storage:  Place blocks that are together in the same cylinder.  Divide the data among multiple disks.  Mirror disks.  Use disk-scheduling algorithms.  Prefetch blocks into main memory.  Scheduling Latency – added delay in accessing data caused by a disk scheduling algorithm.  Throughput – the number of disk accesses per second that the system can accommodate.

4 13.3.1 The I/O Model of Computation  The number of block accesses (Disk I/O’s) is a good time approximation for the algorithm.  This should be minimized.  Ex 13.3: You want to have an index on R to identify the block on which the desired tuple appears, but not where on the block it resides.  For Megatron 747 (M747) example, it takes 11ms to read a 16k block.  A standard microprocessor can execute millions of instruction in 11ms, making any delay in searching for the desired tuple negligible.

5 13.3.2 Organizing Data by Cylinders  If we read all blocks on a single track or cylinder consecutively, then we can neglect all but first seek time and first rotational latency.  Ex 13.4: We request 1024 blocks of M747.  If data is randomly distributed, average latency is 10.76ms by Ex 13.2, making total latency 11s.  If all blocks are consecutively stored on 1 cylinder:  6.46ms + 8.33ms * 16 = 139ms (1 average seek)(time per rotation)(# rotations)

6 13.3.3 Using Multiple Disks  If we have n disks, read/write performance will increase by a factor of n.  Striping – distributing a relation across multiple disks following this pattern:  Data on disk R 1 : R 1, R 1+n, R 1+2n,…  Data on disk R 2 : R 2, R 2+n, R 2+2n,… …  Data on disk R n : R n, R n+n, R n+2n, …  Ex 13.5: We request 1024 blocks with n = 4.  6.46ms + (8.33ms * (16/4)) = 39.8ms (1 average seek)(time per rotation)(# rotations)

7 13.3.4 Mirroring Disks  Mirroring Disks – having 2 or more disks hold identical copied of data.  Benefit 1: If n disks are mirrors of each other, the system can survive a crash by n-1 disks.  Benefit 2: If we have n disks, read performance increases by a factor of n.  Performance increases further by having the controller select the disk which has its head closest to desired data block for each read.

8 13.3.5 Disk Scheduling and the Elevator Problem  Disk controller will run this algorithm to select which of several requests to process first.  Pseudo code:  requests[] // array of all non-processed data requests  upon receiving new data request:  requests[].add(new request)  while(requests[] is not empty)  move head to next location  if(head location is at data in requests[])  retrieve data  remove data from requests[]  if(head reaches end)  reverse head direction

9 13.3.5 Disk Scheduling and the Elevator Problem (con’t) Events: Head starting point Request data at 8000 Request data at 24000 Request data at 56000 Get data at 8000 Request data at 16000 Get data at 24000 Request data at 64000 Get data at 56000 Request Data at 40000 Get data at 64000 Get data at 40000 Get data at 16000 datatime Current time 0 4.3 Current time 10 Current time 13.6 Current time 20 Current time 26.9 Current time 30 Current time 34.2 Current time 45.5 Current time 56.8 8000 16000 24000 32000 40000 48000 56000 64000 datatime 8000..4.3 datatime 8000..4.3 24000..13.6 datatime 8000..4.3 24000..13.6 56000..26.9 datatime 8000..4.3 24000..13.6 56000..26.9 64000..34.2 datatime 8000..4.3 24000..13.6 56000..26.9 64000..34.2 40000..45.5 datatime 8000..4.3 24000..13.6 56000..26.9 64000..34.2 40000..45.5 16000..56.8

10 13.3.5 Disk Scheduling and the Elevator Problem (con’t) datatime 8000..4.3 24000..13.6 56000..26.9 64000..34.2 40000..45.5 16000..56.8 datatime 8000..4.3 24000..13.6 56000..26.9 16000..42.2 64000..59.5 40000..70.8 Elevator Algorithm FIFO Algorithm

11 13.3.6 Prefetching and Large-Scale Buffering  If at the application level, we can predict the order blocks will be requested, we can load them into main memory before they are needed.

12 Questions


Download ppt "SECTION 13.3 Eilbroun Benjamin CS 257 – Dr. TY Lin SECONDARY STORAGE MANAGEMENT."

Similar presentations


Ads by Google