Differences

This shows you the differences between two versions of the page.

Link to this comparison view

ep:labs:03:contents:tasks:ex1 [2020/07/30 20:49]
gheorghe.petre2608 [04. [20p] Monitor I/O with vmstat and iostat]
ep:labs:03:contents:tasks:ex1 [2021/10/26 10:46] (current)
radu.mantu [01. [10p] Rotational delay - IOPS calculations]
Line 1: Line 1:
-==== 04. [20pMonitor I/O with vmstat and iostat ​==== +==== 01. [10pRotational delay - IOPS calculations ​====
-We said in the beginning that the disk I/O subsystems are the slowest part of any system. This is why the I/O monitoring is so important, maximizing the performance of the slowest part of a system resulting in an improvement of the performance of the entire system.+
  
-=== [10p] Task A - Script ===+<note tip> 
 +Every disk in your storage system has a maximum theoretical IOPS value that is based on a formula. Disk performance and IOPS is based on three key factors:
  
-Write script that reads the data into memory and generates ​text file 500 times larger, ​by concatenating ​the contents ​of the following novel {{:ep:labs:olivertwist.txt|olivertwist.txt}} to itself.+  * **Rotational speed**. Measured in RPM, mostly 7,200, 10,000 or 15,000 RPM. A higher rotational speed is associated with higher-performing disk. 
 +  * **Average latency**. The time it takes for the sector of the disk being accessed to rotate ​into position under read/write head. 
 +  * **Average seek time**. The time (in ms) it takes for the hard drive’s read/write head to position itself over the track being read or written. 
 +  * **Average IOPS**: Divide 1 by the sum of the average latency in ms and the average seek time in ms (1 / (average latency in ms + average seek time in ms). 
 +</​note>​ 
 +To calculate the **IOPS range** divide 1 by the sum of the average latency in ms and the average seek time in ms. The formula is 
 +<​code>​average IOPS = 1 / (average latency in ms + average seek time in ms). 
 +</​code>​ 
 + 
 +Let's calculate the Rotational Delay - RD for a 10K RPM drive: 
 + 
 +  * Divide 10000 RPM by 60 seconds**''​10000/​60 = 166 RPS''​** 
 +  * Convert 1 of 166 to decimal: **''​1/​166 = 0.006 seconds per Rotation''​** 
 +  * Multiply the seconds per rotation by 1000 milliseconds (6 MS per rotation). 
 +  * Divide the total in half (RD is considered half a revolution around a disk): **''​6/​2 = 3 MS''​** 
 +  * Add an average of 3 MS for seek time: **''​3 MS + 3 MS = 6 MS''​** 
 +  * Add 2 MS for latency (internal transfer): **''​6 MS + 2 MS = 8 MS''​** 
 +  * Divide 1000 MS by 8 MS per I/O: **''​1000/​8 = 125 IOPS''​** 
 + 
 +=== [10p] Task A - Calculate rotational delay === 
 + 
 +Add in your archive the operations and the result you obtained. (Screenshot,​ picture of calculations made by hand on paper) 
 + 
 +Calculate the Rotational Delay, and then the IOPS for a __5400 RPM drive__.
  
 <​solution -hidden> <​solution -hidden>
 +As shown in the //"​Calculating IOs Per Second"//​ section:
 <​code>​ <​code>​
-if __name__ ​== '​__main__':​ +5400 / 60 90 RPS 
-    ​text_file1 ​open("​OliverTwist.txt", "​r"​) +1/90 0.011 seconds per Rotation 
-    ​text_file2 = open("​OliverTwistLarge.txt", "​w+"​) +0.011 * 1000 = 11ms per Rotation 
-    ​lines_file1 ​text_file1.readlines() +11 / 2 5.5ms RD (Rotational Delay = half a revolution around a disk
-    for x in range(0, 500): +add approx. 3ms seek time => 8.5ms 
-    ​ text_file2.writelines(lines_file1)+add 2ms latency => 10.5ms 
 +Divide 1000ms by 10.5ms per I/O => approx. 95 IOPS
 </​code>​ </​code>​
 </​solution>​ </​solution>​
  
-=== [10p] Task B - Monitoring behaviour === 
- 
-Now we want to analyze what is happening with the I/O subsystem during an expensive operation. Monitor the behavior of the system while running your script using **vmstat** and **iostat**. 
- 
-<note tip> 
-Understanding vmstat IO section: 
-  * **bi** - column reports the number of blocks received (or “blocks in”) from a disk per second. 
- 
-  * **bi** - column reports the number of blocks sent (“blocks out”) to a disk per second. 
-</​note>​ 
  
  
ep/labs/03/contents/tasks/ex1.1596131376.txt.gz · Last modified: 2020/07/30 20:49 by gheorghe.petre2608
CC Attribution-Share Alike 3.0 Unported
www.chimeric.de Valid CSS Driven by DokuWiki do yourself a favour and use a real browser - get firefox!! Recent changes RSS feed Valid XHTML 1.0