This shows you the differences between two versions of the page.
|
ep:labs:03:contents:tasks:ex5 [2020/08/10 22:25] cristian.marin0805 [05. [20p] Multitool Comparison] |
ep:labs:03:contents:tasks:ex5 [2026/03/16 16:52] (current) florin.stancu |
||
|---|---|---|---|
| Line 1: | Line 1: | ||
| - | ==== 05. [20p] Multitool Comparison ==== | + | ==== 05. [10p] Feedback ==== |
| - | Now we will see in a slightly different approach, as for more special situations, a classic tool is not enough as long as we want to have a more detailed analysis of the behavior of I/O mechanisms. | + | |
| + | Please take a minute to fill in the **[[https://forms.gle/moWQFAfMMmNmA2Q17 | feedback form]]** for this lab. | ||
| - | === [10p] Task A - Different tool, same I/O === | ||
| - | |||
| - | An example would be to create an infinite loop that **copies endlessly** (simulation of a demanding process for a long time) a **large file** (use one of the files obtained previously). | ||
| - | |||
| - | Put the command below in a script: | ||
| - | <code bash> | ||
| - | $ while true; do cp original_file1 copied_file2; done | ||
| - | </code> | ||
| - | |||
| - | Use several special monitoring tools for I/O to investigate the state of the system. | ||
| - | |||
| - | Choose 3-4 from here: | ||
| - | [[https://www.golinuxcloud.com/monitor-disk-io-performance-statistics-linux/]] | ||
| - | |||
| - | === [10p] Task B - Plot of Comparison === | ||
| - | |||
| - | Plot a graph with the results obtained with iostat, iotop and one of the previously chosen tools. Interpret the graph and the values obtained using those tools. | ||
| - | <note> | ||
| - | * basic plot | ||
| - | * the values used should represent the same metric (eg: kb written per second) | ||
| - | * you can take the values manually or automatically | ||
| - | * standardize the values (kb/s) | ||
| - | * preferably use the matplotlib module in python | ||
| - | |||
| - | </note> | ||
| - | |||
| - | <solution -hidden> | ||
| - | <code python> | ||
| - | #!/usr/bin/python3 | ||
| - | |||
| - | import matplotlib.pyplot as plt | ||
| - | |||
| - | |||
| - | def main(): | ||
| - | level = list(range(5)) | ||
| - | iostat = [12538, 16918, 22001, 24112, 28796] | ||
| - | iotop = [22138, 20111, 28011, 20819, 27940] | ||
| - | nmon = [24912, 29112, 28091, 27812, 29012] | ||
| - | |||
| - | # plot data | ||
| - | fig, axs = plt.subplots() | ||
| - | |||
| - | axs.plot(level, iotop, 'bo-') | ||
| - | axs.plot(level, iostat, 'ro-') | ||
| - | axs.plot(level, nmon, 'go-') | ||
| - | |||
| - | axs.set_xticks(level) | ||
| - | axs.grid(True, which='both') | ||
| - | |||
| - | axs.set_xlabel('Time [ms]') | ||
| - | axs.set_ylabel('Write [Kb/s]') | ||
| - | |||
| - | plt.show() | ||
| - | |||
| - | if __name__ == '__main__': | ||
| - | main() | ||
| - | </code> | ||
| - | </solution> | ||