1 Storage Hierarchy Cache Main Memory Virtual Memory File System Tertiary Storage Programs DBMS...

22
1 Storage Hierarchy Cache Main Memory Virtual Memory File System Tertiary Storage Programs DBMS Capacity & Cost Secondary Storage
  • date post

    21-Dec-2015
  • Category

    Documents

  • view

    222
  • download

    0

Transcript of 1 Storage Hierarchy Cache Main Memory Virtual Memory File System Tertiary Storage Programs DBMS...

1

Storage Hierarchy

Cache

MainMemory

VirtualMemory

FileSystem

TertiaryStorage

Programs

DBMS

Capacity&

Cost

Secondary Storage

2

Disks

Direct access storage devices (DASD) It is possible to access data directly as well as

sequentially Accessing data has a lower overhead than serial devices

(e.g., tapes)

Types Fixed-head hard disks Removable hard disks Floppy disks

3

Disk Drives

Platters

Spi

ndle

read/write head

Arm

Boo

m

4

Sector: the smallest addressable portion of a disk.

Tracks

Sector

Disk Organization

Gap

5

Disk PacksSeven

cylinders

Tentracks

6

Capacity Calculation

Capacity = #cylinders Cylinder capacity

= #cylinders (# tracks/cylinder Track capacity)

= #cylinders #tracks/cylinder #sectors/track *

Bytes/sector

7

Data Organization

Sector organization of track fixed length determined by the operating system

Block organization of track variable length user defined

8

Sector Organization

Clusters contiguous group of sectors on cylinder fixed size smallest space assigned to a file

Extents collection of contiguous clusters

can be accessed with a minimum amount of seeking

Therefore each extent consists of several adjacent clusters each cluster consists of several adjacent sectors

9

Cluster Clusternumber location 1 2 3 : :

File Allocation Table (FAT)

10

Sector Organization

Advantages simplifies allocation of storage space simplifies address calculation simplifies synchronization of CPU computation with

record accessing

Disadvantage internal fragmentation: space unused within a sector

11

Block Organization

no internal fragmentation complicated address calculations increased non-data overhead

datablock

datablock

countblock

countblock

User defined length

12

Disk Access Time = Seek time + Rotational delay + transfer time Seek time: time to move access arm to correct cylinder

T(seek) = S + Const N ,

where S = Initial time, N = # of cylinders moved For PC’s T(seek)= 20 + 0.3 N ms; For large disks T(seek)= 3 + 0.1 N ms

Rotational delay: time to find correct place on track on average: half a revolution

Transfer time: time to move data (# of bytes transferred)(# of bytes of track ) rotation time

Cost of Disk Access

13

Example Consider

A 300 Mbyte disk with average seek time = 18 msec, rotational delay = 8.3 msec, 512 Bytes/sector, 8 sectors/cluster

A file of 8000 256-byte records = 2048 K bytes 500 clusters within 100 extents Case 1:

The file is stored in 100 extents, i.e., 100 seek times and transfer time for one extent is 16.7 msec.

Total time = 100 ( 18 + 8.3 + 16.7) = 4.3 seconds Case 2:

The file is stored in 8000 sectors, randomly distributed over the disk, thus, 8000 seek times are needed

Total time = 8000 (18 + 8.3 + 3.3 ) = 236.8 seconds

14

Program requests Write OS passes job to file manager File manager

finds physical file name does security check search FAT for physical address in disk transfer data to buffer pass job to I/O processor

I/O processor gets data from buffer breaks it into sectors sends it to disk controller

Disk controller instructs disk driver to do dirty job

Disk Access Process

15

Improving Access Time

Organize data by cylinders Use multiple disks Mirror disks More intelligent disk scheduling

Elevator algorithm

Prefetching and buffering

16

Buffer Management

Goal: reduce the number of disk accesses Reside in RAM Buffer strategies

multiple buffering buffer pooling

Program data area

Program data areaI/O Buffer

I/O Buffer

I/O Buffer

I/O Buffer

Disk

Disk

17

Magnetic Tapes

Sequential access devices Very slow Inexpensive (??) Used as backup and archives

18

parity track

Nine Track Tape

Above set-up assumes odd, vertical parity There is no concept of an address; reading is sequential

100010010

19

data block

gap

Tape Layout

A data block is a group of frames whose sizes can very from a few bytes to many kilobytes.

An interblock gap is a space on tape without information that separates blocks. the gap provides sufficient space for the tape to start and/or stop.

20

Tape Drivers

Tape density bits per inch (bpi) commonly 800, 1600, 6250, ... , bpi

Tape speed inches per second (ips) usually 30 to 200 ips

Size of intergap: commonly between 0.3in and 0.75in

21

Calculating Space Requirements

Space requirements: s = n (b + g)

whereb = block size (inches)

g = gap (inches)

n = number of blocks

s = total space

Blocking factor: number of records stored in a physical block

22

Example

Consider: a file with one million 100-byte records type drive: 6250 bpi, with 0.3in gap

Case 1: blocking factor = 1S = n(b + g)

= 1,000,000 (100/6250 + 0.3) = 26,334 (feet)

Case 2: blocking factor = 50S = 20,000 (5000/625 +0.3) = 1834 (feet)