Differences

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

Link to this comparison view

ep:labs:03:contents:tasks:ex4 [2020/08/03 16:37]
cristian.marin0805 created
ep:labs:03:contents:tasks:ex4 [2020/08/03 16:39] (current)
cristian.marin0805
Line 1: Line 1:
-salllll+==== 04. [20p] Monitor I/O with vmstat and iostat ==== 
 +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 === 
 + 
 +Write a script that reads the data into memory and generates a text file 500 times larger, by concatenating the contents of the following novel {{:​ep:​labs:​olivertwist.txt|olivertwist.txt}} to itself. 
 + 
 +<​solution -hidden>​ 
 +<​code>​ 
 +if __name__ == '​__main__':​ 
 +    text_file1 = open("​OliverTwist.txt",​ "​r"​) 
 +    text_file2 = open("​OliverTwistLarge.txt",​ "​w+"​) 
 +    lines_file1 = text_file1.readlines() 
 +    for x in range(0, 500): 
 +    text_file2.writelines(lines_file1) 
 +</​code>​ 
 +</​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. 
 + 
 +  * **bo** - column reports the number of blocks sent (“blocks out”) to a disk per second. 
 +</​note>​ 
 + 
ep/labs/03/contents/tasks/ex4.txt · Last modified: 2020/08/03 16:39 by cristian.marin0805
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