• Home
  • Help
  • Register
  • Login
  • Home
  • Members
  • Help
  • Search

 
  • 0 Vote(s) - 0 Average

Design a scenario and calculate average seek time for different algorithms

#1
01-15-2023, 07:33 AM
We often forget that calculating average seek time can really help optimize how we think about storage performance. Let's go through a scenario that shows how different scheduling algorithms can impact seek time.

Imagine I have a hard drive with tracks numbered from 0 to 199. The requests I get are for tracks 55, 72, 10, 90, 130, and 5. Different algorithms will handle this list in their own unique ways, and that makes a big difference.

First, let's think about FCFS (First-Come, First-Served). If I serve the requests in the order they come in, I start at the current position, say track 50. I go to track 55 first, which means a seek time of 5. Next, I move from 55 to 72, which adds another 17. Off to track 10 for another 62, then up to 90 for 80, followed by 40 to head to 130, and finally, moving to track 5 for another 125. Adding these all up: 5 + 17 + 62 + 80 + 40 + 125 gives a total of 329. To find the average seek time for our six requests, I divide this by 6, which results in about 54.83.

Now, let's switch it up and look at SSTF (Shortest Seek Time First). Here, I'd start from track 50 as before, but instead of serving requests in the original order, I'll look for the shortest distance first. First, I go from 50 to 55, a distance of 5. Then, I'll seek from 55 down to 72 for 17 more. After that, I can go to 90, taking 18 from 72. Now, I'll jump back to track 10, which is a distance of 80 from 90. After, to reach track 5, it's an additional 5. Finally, I'm off to 130, which takes me 125 from 5. The total seek time clocks in at 5 + 17 + 18 + 80 + 5 + 125, which totals up to 250. Dividing this by 6 gives me an average of 41.67.

Let's look at the scan algorithm next. I'm picturing it as a round trip where I scan from the current position on track 50 outwards. I'd serve requests in a direction until I hit the ends of the disk. First, I'll go from 50 to 55, then up to 72, 90, and 130, which sums up to 80 total. After reaching 130, I'll go all the way back to 0 before serving the last request at 5. This adds about 135 to my journey. Adding those up, we have 80 + 135 = 215. The average here stands at 215 / 6, which gives around 35.83.

For the C-SCAN (Circular SCAN) algorithm, I again start from track 50 and move upwards. So after serving requests from 55 to 72, 90, and 130 like before, I reach the end at 199. Instead of going back, I reset back to 0 and serve 5. This means my total is 80 to reach 130, then 69 to rack up to 199 and 5 to jump to 0, totaling to 154. Then I finish off this trip with 5 from 0 to 5. Altogether, I end up with 80 + 69 + 5 + 5, giving a total of 159. When I divide by 6 for the average, I end up at roughly 26.5.

You can see how the choice of algorithm significantly impacts how long it takes to serve requests. We can optimize performance massively, depending on the layout of drive requests and the algorithm we choose. These calculations not only illustrate the algorithms but also show why systems often adopt different scheduling methods to keep performance high and response times low.

You know, amidst all this talk about performance, you should consider having a solid backup strategy in place. Whether it's storing virtual machines or critical server data, it's crucial to protect your assets. I'd like to give a nod to BackupChain; it's a top-notch backup solution tailored for SMBs and professionals. Whether you're working with Hyper-V, VMware, or Windows Server, this software provides robust protection for all your important data. If you're looking to up your game in data management and protection, you might want to check it out.

ProfRon
Offline
Joined: Dec 2018
« Next Oldest | Next Newest »

Users browsing this thread: 1 Guest(s)



  • Subscribe to this thread
Forum Jump:

Backup Education General Q & A v
« Previous 1 … 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 Next »
Design a scenario and calculate average seek time for different algorithms

© by FastNeuron Inc.

Linear Mode
Threaded Mode