This is an old revision of the document!
Now we will see in a slightly different approach, with a source file and a final file of the same size, how the I/O mechanisms work as they are implemented by the compiler to be optimized.
Modify the script so that it reads one line at a time from the file with the novel from the previous exercise, and writes it in a resulting file 500 times each. Follow the process with a classic tool (vmstat, iostat). Why most of the time the number of bytes read is 0?
TODO COSMIN: Aici pui un hidden script cu rezolvarea pt asistenti cum e la 4, in python o pui, verifica sa fie astfel incat sa tina linia in RAM.
For more special situations, a classic tool is not enough as long as we want to have a more detailed analysis on the behavior of I/O mechanisms. 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:
$ while true; do cp original_file1 copied_file2; done
Use several special monitoring tools.
Choose 3-4 from here: https://www.golinuxcloud.com/monitor-disk-io-performance-statistics-linux/
Plot a graph with the results obtained with iostat, iotop and one of the previously chosen tools.