This shows you the differences between two versions of the page.
ep:labs:05:contents:tasks:ex1 [2019/10/27 17:10] emilian.radoi created |
ep:labs:05:contents:tasks:ex1 [2025/02/11 23:42] (current) cezar.craciunoiu |
||
---|---|---|---|
Line 1: | Line 1: | ||
- | ==== 01. [20p] Gnuplot graphs ==== | + | ==== 01. [10p] Rotational delay - IOPS calculations ==== |
- | + | ||
- | Using the Gnuplot documentation, implement a script that plots four graphs. Use the data from {{:ep:laboratoare:data4.txt|}} as follows: the first graph should plot columns 1 and 2, the second columns 1 and 3, the third one columns 1 and 4, and the fourth one should be a 3D graph plotting columns 1, 2 and 3. | + | |
- | * Use different colours for the data in each graph. | + | |
- | * Remove the keys for each graph. | + | |
- | * Give a title to each graph. | + | |
- | * Give names to each of the axes: X or Y (or Z for the 3D graph). In the case of the 3D graph: Make the numbers on the axes readable, and correct the position of the names of the axes if these are displayed over the axes numbers. | + | |
- | * Make the script generate the .eps file containing your plot. | + | |
<note tip> | <note tip> | ||
- | **Hint:** Consider the following commands: set key, xlabel, set title, set xtics, set terminal, set output, using. | + | 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: |
+ | |||
+ | * **Rotational speed**. Measured in RPM, mostly 7,200, 10,000 or 15,000 RPM. A higher rotational speed is associated with a higher-performing disk. | ||
+ | * **Average latency**. The time it takes for the sector of the disk being accessed to rotate into position under a 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> | </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> | ||
- | <solution -hidden> | + | Let's calculate the Rotational Delay - RD for a 10K RPM drive: |
- | <code> | + | |
- | reset #flush all variables | + | * 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''** | ||
- | set term postscript color eps enhanced | + | === [10p] Task A - Calculate rotational delay === |
- | set output 'myplot.eps' | + | |
- | set size 1,1 #use default pallet size(100% of width and height) | + | |
- | set multiplot | + | |
- | unset key | + | |
- | #Graph 1 | + | Add in your archive the operations and the result you obtained. (Screenshot, picture of calculations made by hand on paper) |
- | set size 0.5,0.5 #half the width and height | + | |
- | set origin 0,0.5 #x,y | + | |
- | set title 'First' | + | |
- | plot 'data4.txt' using 1:2 w l lw 0.5 | + | |
- | #Graph 2 | + | Calculate the Rotational Delay, and then the IOPS for a __5400 RPM drive__. |
- | set size 0.5,0.5 | + | |
- | set origin 0.5,0.5 | + | |
- | set xlabel 'X' | + | |
- | set ylabel 'Y' | + | |
- | set title 'Second' | + | |
- | plot 'data4.txt' using 1:3 w l lw 0.5 | + | |
- | #Graph 3 | + | <solution -hidden> |
- | set size 0.5,0.5 | + | As shown in the //"Calculating IOs Per Second"// section: |
- | set origin 0,0 | + | <code> |
- | set xlabel 'X' | + | 5400 / 60 = 90 RPS |
- | set ylabel 'Y' | + | 1/90 = 0.011 seconds per Rotation |
- | set title 'Third' | + | 0.011 * 1000 = 11ms per Rotation |
- | plot 'data4.txt' using 1:4 w l lw 0.5 | + | 11 / 2 = 5.5ms RD (Rotational Delay = half a revolution around a disk) |
+ | add approx. 3ms seek time => 8.5ms | ||
+ | add 2ms latency => 10.5ms | ||
+ | Divide 1000ms by 10.5ms per I/O => approx. 95 IOPS | ||
+ | </code> | ||
+ | </solution> | ||
- | #Graph 4 | ||
- | set size 0.5,0.5 | ||
- | set origin 0.5,0 | ||
- | set view 60,15 | ||
- | set xtics 0,1000 | ||
- | set ytics 1.8,0.3 | ||
- | set ztics 1,0.2 | ||
- | set xlabel 'X' offset 0,-1 | ||
- | set ylabel 'Y' | ||
- | set zlabel 'Z' | ||
- | set title 'Fourth' | ||
- | splot 'data4.txt' using 1:2:3 w l lw 0.5 lc rgb 'black' | ||
- | set xtics auto | ||
- | set ytics auto | ||
- | set ztics auto | ||
- | unset multiplot | ||
- | </code> | ||
- | </solution> |