ToolSphere

Disk Scheduler

Computer science

Total head movement for FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK, with the seek graph, the working for every move, and all six compared.

Disk scheduling simulator

Type the request queue and the head position to get the total head movement (how far the disk arm travels) for FCFS, SSTF, SCAN, C-SCAN, LOOK and C-LOOK, with the working and all six compared.

Total head movement: 640 cylinders with FCFS. The path and each move are shown below.

Seek graph (FCFS)

050100149199539818337122141246567
Total head movement
640
cylinders · average 80.00 per request

Service order

53
98
183
37
122
14
124
65
67

Working

MoveFrom → ToDistance
153 → 98|98 − 53| = 45
298 → 183|183 − 98| = 85
3183 → 37|37 − 183| = 146
437 → 122|122 − 37| = 85
5122 → 14|14 − 122| = 108
614 → 124|124 − 14| = 110
7124 → 65|65 − 124| = 59
865 → 67|67 − 65| = 2

Total = 45 + 85 + 146 + 85 + 108 + 110 + 59 + 2 = 640 cylinders

All six on this queue

AlgorithmTotal head movementAverage per request
64080.00
least23629.50
33141.38
38247.75
29937.38
32240.25

On this browser only

Give feedback

Did this tool help?

Tell us what worked, what didn’t, or what you’d like next.

Opens Google Forms in a new tab with this tool’s name filled in. No sign-in or email required. Feedback is optional.

How to use Disk Scheduler

  1. 1Enter the request queue as cylinder numbers, separated by commas or spaces.
  2. 2Set where the head starts, the number of cylinders, and the direction it is moving.
  3. 3Pick an algorithm and read the seek graph, the working table (|to − from| for every move) and the total head movement.
  4. 4Compare all six algorithms on the same queue, and switch off the C-SCAN / C-LOOK return jump if your course doesn't count it.

About Disk Scheduler

Minimizing Seek Time Across Competing Read Requests

A mechanical disk's read/write head physically moves across platters to reach requested data, and that movement (seek time) is by far the slowest part of a disk operation — disk scheduling algorithms exist specifically to minimize total head movement across a queue of pending requests, rather than serving them in arbitrary arrival order.

FCFS serves requests in arrival order — simple, but can produce a lot of unnecessary back-and-forth head movement if requests arrive in a scattered order. SSTF (Shortest Seek Time First) always services whichever pending request is physically closest to the head's current position, minimizing immediate seek distance but risking starvation of far-away requests if closer ones keep arriving. SCAN moves the head steadily in one direction, servicing requests as it passes them, then reverses at the end — like an elevator, avoiding SSTF's starvation risk while still keeping movement efficient. C-SCAN (Circular SCAN) only services requests in one direction, then jumps back to the start without servicing on the return trip, giving more uniform wait times across the disk. LOOK is SCAN's more practical refinement — reversing direction as soon as no further requests remain ahead, rather than always sweeping all the way to the physical end of the disk. C-LOOK does the same for C-SCAN: it serves requests in one direction, then jumps straight to the lowest pending request instead of the disk's edge.

Comparing total head movement (the sum of absolute differences between consecutive serviced cylinders) across all six algorithms on an identical request queue is exactly how operating systems courses demonstrate the real efficiency gap between naive and elevator-style scheduling.

Worked example

Queue 98, 183, 37, 122, 14, 124, 65, 67 with the head at 53 on a 200-cylinder disk (the textbook example from Silberschatz/Galvin):

  • FCFS: 640 cylinders. |98 − 53| + |183 − 98| + |37 − 183| + … = 45 + 85 + 146 + 85 + 108 + 110 + 59 + 2 = 640
  • SSTF: 236 cylinders, serving 65, 67, 37, 14, 98, 122, 124, 183
  • SCAN toward 0: 236 cylinders: down to 0, then up to 183

The working table prints the |to − from| line for every move, so you can copy the whole calculation, not just the answer.

Does the C-SCAN return jump count?

This is the most common reason an answer "doesn't match". When C-SCAN reaches the end of the disk it jumps back to the other end without serving anything. Galvin and GeeksforGeeks count that jump in the total head movement; some courses treat it as free because the arm returns at high speed. The checkbox switches between the two, and the jump is marked in the working and drawn dashed on the seek graph. For the queue 176, 79, 34, 60, 92, 11, 41, 114 with the head at 50, C-SCAN is 389 cylinders with the jump counted and 190 without.

Where this fits

Disk scheduling orders requests for the disk the way CPU scheduling orders processes for the processor, and many of the same ideas, FCFS fairness against shortest-first efficiency and the risk of starvation, appear in both. Memory, the level above the disk, is covered by the page replacement and memory allocation calculators.

Guides and tutorials

Frequently asked questions

Why is disk seek time the main thing scheduling algorithms try to minimize?

Physically moving the read/write head across platters is dramatically slower than the actual data transfer once positioned — total head movement distance is the dominant cost, which is exactly what these algorithms are designed to reduce.

What's the practical difference between SCAN and LOOK?

SCAN always sweeps all the way to the physical end of the disk before reversing, even with no pending requests out there; LOOK reverses as soon as no further requests remain ahead, avoiding wasted movement past the last actual request.

Can SSTF cause a request to wait indefinitely?

Yes — if requests keep arriving closer to the head's current position than a far-away pending request, that distant request can be repeatedly deprioritized, a form of starvation that SCAN and LOOK's directional sweep pattern avoids.

How do you calculate total head movement?

Add up the distance of every move: |next cylinder − current cylinder| for each request served, in the order the algorithm serves them. For FCFS on the textbook queue with the head at 53, that is 45 + 85 + 146 + 85 + 108 + 110 + 59 + 2 = 640 cylinders.

Is the return seek counted in C-SCAN and C-LOOK?

It depends on your course. Galvin and GeeksforGeeks count the jump back to the start; some syllabi don't because no requests are served on the way. Use the checkbox to match your exam's rule. The working marks which move is the return jump.

What is the difference between C-SCAN and C-LOOK?

C-SCAN runs to the very edge of the disk, then jumps to cylinder 0. C-LOOK turns at the last request in its direction and jumps to the lowest pending request, so it never travels past the requests it needs to serve.

Have a suggestion for Disk Scheduler?Share your feedback ↗