Disk Performance Optimization
Disk Performance Optimization
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.
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…
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.
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:
– 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