0% found this document useful (0 votes)
615 views

Disk Performance Optimization

The document discusses disk performance optimization through disk scheduling algorithms. It describes the components and operations of a moving head disk storage system and issues like seek time, rotational latency, and response time that disk scheduling aims to optimize. Several disk scheduling algorithms are covered, including FCFS, SSTF, and SCAN, along with their goals, how they work, advantages, and disadvantages.

Uploaded by

Senthildevi K.A
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
615 views

Disk Performance Optimization

The document discusses disk performance optimization through disk scheduling algorithms. It describes the components and operations of a moving head disk storage system and issues like seek time, rotational latency, and response time that disk scheduling aims to optimize. Several disk scheduling algorithms are covered, including FCFS, SSTF, and SCAN, along with their goals, how they work, advantages, and disadvantages.

Uploaded by

Senthildevi K.A
Copyright
© © All Rights Reserved
Available Formats
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 56

DISK PERFORMANCE

OPTIMIZATION
Introduction
• In multi programmed computing system inefficiency is
caused by improper use of rotational storage devices such
as disks and drums.
• This is a schematic representation of the side view of a
moving-head disk. Data is recorded on a series of
magnetic disk or platters.
Operation of moving head disk
storage
• Data is recorded on a series of magnetic disks or
platters.
• Disks are connected by spindle.

• Data is accessed by a series of read-write heads.


One head per disk surface.
• Read-write head fixed in position.
• Platter: it is a circular disk on which magnetic
data is stored in a hard disk drive.
• Spindle: it holds rotating hard disk drive platters
in place.
• Read/Write head: it is responsible for reading
data from & writing data to the disk.
• Boom: Read/Write head of the disks are collected
in common stick is known as boom.
• Track : circular path on the surface of a disk.
• Sector : subdivision of a track on disk.
Hard Disk
Hard Disk Inside view
Hard Disk Inside View
• Latency time – time it takes for data to rotate
from its current position to a position adjacent
to the read-write head is called latency time.
• Seek time – time taken to locate the disk arm to a
specified track where the data is to be
read/write.
• Seek operation – the process of moving the
boom to a new cylinder is called seek
operation.
• Response time : average of time spent by a
request waiting to perform it I/O operation.
Schematic of moving head disk

Read-write heads
platters
spindle boom
Operations of moving head disk
• First the boom moved to the appropriate
cylinder.
• Then the portion of disk on which data is
stored must rotate under the read-write
head.
• Then the record of arbitrary size must be
spin by the read-write head is called
transmission time.
Components of disk access

transmission
Seek time boom
time

latency time
What is Mutliprogramming?
• Multiprogramming in an operating system as the name
suggests multi means more than one and programming
means the execution of the program.
• When more than one program can execute in an
operating system then this is termed a multiprogramming 
operating system.
• The major task of multiprogramming is to maximize the
utilization of resources.
What is Mutliprogramming…

Multiprogramming OS is an ability of an operating system


that executes more than one program using a single
processor machine.
More than one task or program or jobs are present inside the
main memory at one point of time.
It is used for dividing the total time of the CPU between
the number of processes so that the processes can
execute concurrently at a single time.
Multiprogramming approaches
To increase resource utilization, .

Let’s P1 and P2 are two programs present in the main memory. The OS
picks one program and starts executing it.
During execution if the P1 program requires I/O operation, then the OS
will simply switch over to P2 program. If the p2 program requires I/O
then again it switches to P3 and so on.
If there is no other program remaining after P3 then the CPU will pass
its control back to the previous program.
What is disk scheduling?
• In multiprogrammed systems many
process generating requests for reading and
writing disk records.
• Disk scheduling is done by operating
systems to schedule I/O requests arriving
for the disk. Disk scheduling is also known
as I/O scheduling.
Why disk scheduling is
 
necessary
A process needs two type of time, CPU time and IO time.

For I/O, it requests the Operating system to access the


disk.
However, the operating system must be fare enough to
satisfy each request and at the same time, operating
system must maintain the efficiency and speed of process
execution.
The technique that operating system uses to determine the
request which is to be satisfied next is called disk
scheduling.
Disk scheduling is important..
• Multiple I/O requests may arrive by different processes
and only one I/O request can be served at a time by the
disk controller. Thus other I/O requests need to wait in
the waiting queue and need to be scheduled.
• Two or more requests may be far from each other so can
result in greater disk arm movement.
• Hard drives are one of the slowest parts of the computer
system and thus need to be accessed in an efficient
manner.
•Seek Time:Seek time is the time taken to locate the disk arm
to a specified track where the data is to be read or write. So the
disk scheduling algorithm that gives minimum average seek
time is better.
•Rotational Latency: Rotational Latency is the time taken by
the desired sector of disk to rotate into a position so that it can
access the read/write heads. So the disk scheduling algorithm
that gives minimum rotational latency is better.
•Transfer Time: Transfer time is the time to transfer the data.
It depends on the rotating speed of the disk and number of
bytes to be transferred.
•Disk Access Time: 

Disk Access Time = Seek Time + Rotational Latency +Transfer Time


•Disk Response Time: Response Time is the average of
time spent by a request waiting to perform its I/O
operation. Average Response time is the response time of the
all requests. Variance Response Time is measure of how
individual request are serviced with respect to average
response time. So the disk scheduling algorithm that gives
minimum variance response time is better.
Why disk scheduling is necessary contd…

• Disk Scheduler: it examines the positional


relationship among waiting requests.
• Interleaving : is a method in which data is written
to a hard disk in non-sequential sectors.
• Sequential files are separated by n-1 disk. This
result is called n-way disk interleaving.
• Types of scheduling
– Seek optimization
– Rotational optimization
Purpose of Disk Scheduling
The main purpose of disk scheduling algorithm is to
select a disk request from the queue of IO requests and
decide the schedule when this request will be
processed.
The goal of Disk Scheduling Algorithm
•Fairness
•High throughout
•Minimal traveling head time
FCFS random seek pattern

2 4 3 1
Desirable characteristics of disk
scheduling policies
• Scheduling policies
– Throughput : number of processes
completed per unit time.
– Mean response time : is the response time of
the all requests.
– Variance of response time : is the measure of
how individual request are serviced with
respect to average response time.
Desirable characteristics of disk
scheduling policies contd..
• Scheduling policies can minimize time wasted in
performing lengthy seeks, throughput can be
improved over FCFS scheduling.
• Scheduling policy used to minimize mean
response time.
• Variance is a mathematical measure of how far
individual items tend to deviate from the average
of items.
• Example
– Airline reservation system – sell a ticket.
Seek optimization
• Seek optimization strategies
– FCFS First-Come-First-Served

– SSTF Shortest-Seek-Time-First

– SCAN:

– C-SCAN Circular Scan

– N-Step scan

– Eschenbach scheme
FCFS (First-Come-First-Served)
Scheduling
• FCFS : The first request to arrive is the first one
serviced.
• There is no recording no queue.
• A request cannot displaced because of the arrival
of a higher priority request.
• Requests are uniformly distributed over the disk
surfaces.
• FCFS scheduling results in random seek pattern.
No attempt at optimizing the seek pattern.
FCFS contd…
• FCFS is acceptable when the load on disk
is light.
• FCFS does offer small variance but this is
of little solace to the request sitting back to
the disk queue .
• It ignores positional relationship among
the pending requests in the queue.
FCFS contd…
• Merit
Every request gets a fair chance.
No indefinite postponement.
• Demerit
Does not try to optimize seek time.
May not provide the best possible
service.
FCFS
Work Queue : 23, 89, 132, 42, 189
SSTF (Shortest-Seek-Time-
First) Scheduling
• SSTF : The request that result in shortest
seek distance is serviced next even if that
request is not the first one in the queue.
• SSTF is a cylinder-oriented scheme ,this
observation will be investigated.
• SSTF seek patterns is highly localized with
the result that the innermost and outermost
tracks receive poor service compared with
the mid-range tracks.
SSTF Contd…
• It results in better throughput rates
than FCFS.
• Response time is lower for moderate
loads.
SSTF Contd…
• Merit
– It is useful in batch processing.
– Average response time decreases and
throughput increases.
• Drawback
Higher variance of response time.
SSTF localized seek pattern
SSTF
Work Queue : 23, 89, 132, 42, 187
SCAN Scheduling
• SCAN : disk arm sweeps back and forth across the
disk surface, servicing all requests in its path. It
chooses the request that results in the shortest seek
distance in a preferred direction.
• Denning developed the SCAN scheduling.
• If the preferred direction is currently outward, then
the SCAN strategy chooses the shortest seek
distance in the outward direction.
• It doesn’t change the direction until it reaches the
outermost cylinder or until there are no further
requests pending in the preferred direction.
SCAN Contd….
• It is sometimes called elevator algorithm.
Because an elevator normally continues in
one direction until there are no more requests
pending and then it reverses direction.
• SCAN behaves very much like SSTF in terms
of improved means of response times.
• It is a cylinder-oriented strategy.
• Merit
High throughput.
Low variance of response time.
• Demerit
Long waiting time for requests.
SCAN scheduling with
preferred directions

outward sweep

inward sweep
SCAN
Work Queue : 23, 89, 132, 42, 187
N-Step SCAN Scheduling
• N-Step SCAN : Disk arm sweeps back and forth
in SCAN but all requests that arrive during the
sweep in one direction are batched and reordered
for optimal service during the return sweep.
• One interesting modification of the basic SCAN
Strategy is called N-Step Scan.
• Good performance in throughput and response
time.
• Lower variance of response time than SSTF or
SCAN scheduling.
N-Step SCAN cond…
• N-Step avoids the possibility of indefinite
postponement .
• If a large number of requests arrive for the
current cylinder.
• It saves these request for servicing on the
return sweep.
N-Step SCAN scheduling

Request after
Inward sweep

Inward sweep

outward sweep
C-SCAN Scheduling
• C-SCAN : The arm moves from the outer cylinder to the
inner cylinder servicing requests on a shortest seek basis.
• When the arm has completed its inward sweep, its jumps
to the request nearest the outermost cylinder and then
resumes its inward sweep processing requests.
• It has small variance in response times.
• It operates in two stages:
• At low loading, SCAN policy is best. At medium to
heavy loading, C-SCAN provides best results.
• C-SCAN with rotational optimization handles heavy
loading conditions effectively.
C-SCAN scheduling

Request after
Inward sweep
Inward sweep

Jump to outward sweep

Next Inward sweep


C-SCAN
Work Queue : 23, 89, 132, 42, 187
Eschenbach Scheme
• Eschenbach : disk arm movement is circular as
in C-SCAN. Every cylinder is serviced for
exactly one full track of information whether or
not there is a request for that cylinder.
• Two requests overlap sector positions within a
cylinder, only one is serviced for the current
sweep of the disk arm.
• It handles extremely heavy loads.
• Example
– Airline reservation system.
Rotational optimization
• Rotational optimization used with fixed-head devices
such as drums.
• Rotational delay – amount of time it takes for the
desired sector of a disk.
• Paralleling SSTF of seek optimization is the SLTF
(Shortest-Latency-Time-First) for rotational
optimization.
• SLTF examines all these requests and services the one
with the shortest rotational delay first.
• Rotational optimization referred to as sector queueing.
Requests are queued by sector position around the disk
and the nearest sectors are serviced first.
SLTF scheduling
Multiple Disk Subsystems
• Disk hardware has often been built so that
• Several physical disk units are managed by
a single disk controller device.
• The controller in turn is connected to an
input\output channel ultimately transmits
information from the disk in to the central
computer.
Multiple Disk Subsystems
• The bottleneck could be due to saturation of the
controller or it could be caused by channel
congestion.
• These situations can often be detected by
performance monitoring software and hardware
designed to measure channel and controller.
• To help reduce channel congestion a technique
called rational position sensing(RPS)
DISK CACHING
• When a write occurs one would think that
the record is immediately written to the
disk.
• If a recently written record needs to be
read , it can be recalled from the disk cache
buffer in primary storage much faster than
if it had to be read from disk.
DISK CACHING
• To minimize the chance that disks are “out
of sync” with that programs think the disks
contain , the UNIX operating system
periodically execute the sync system call
to flush all the buffer to disk.
• The key to disk caching is keeping
frequently accessed records in the disk
cache buffer in primary storage.
RAM DISKS
• A RAM disk is a disk device simulated in
conventional random access memory.
• It completely eliminates delay suffered in
conventional disks because of the
mechanical inherent in seeks and in
spinning disk.
• RAM disks are especially useful in high
performance applications.
RAM DISKS
• The simple magnetic disk and laser diska
are dependent on slow mechanical motion.
• They are separate from main memory so
they do not occupy space needed by the
operating system.
• RAM disks are more expensive than the
regular disks.
OPTICAL DISKS
• The first optical disk are write-once-read-
many(WORM)devices.
• Several rewritable optical disks products
have appeared on the market recently , thus
challenging the dominance of magnetic disk
storage.
• Optical disk technology appears to have
stunning upper limits.

You might also like