Differences

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

Link to this comparison view

ep:labs:03:contents:tasks:ex3 [2020/11/01 11:59]
gheorghe.petre2608 [03. [10p] Iotop]
ep:labs:03:contents:tasks:ex3 [2025/03/17 20:53] (current)
radu.mantu [03. [15p] Zip with compression levels]
Line 1: Line 1:
-==== 03. [10pIotop ==== +==== 03. [15pZip with compression levels ​==== 
-<note tip> +The **zip** command ​is used for compression and file packaging under Linux/Unix operating systemIt provides 10 levels of compression,​ where: 
-**Iotop** is an utility similar to top command, that interfaces with the kernel to provide per-thread/process I/O usage statistics.+  * **level 0** : provides no compression,​ only packaging 
 +  * **level 6** : used as default compression level 
 +  * **level 9** : provides maximum compression
  
-<​code>​ +<​code ​bash
-Debian/​Ubuntu Linux install iotop +zip -5 file.zip file.txt
-sudo apt-get install iotop +
- +
-How to use iotop command +
-$ sudo iotop OR $ iotop+
 </​code>​ </​code>​
  
-Supported options by iotop command: +=== [10p] Task A - Measurements ​=== 
- +Write a script to measure ​the compression rate and the time required for each levelYou have few large files in the code skeleton but feel free to add moreIf you do add new files, make sure that they are not random data!
-| **Options** | **Description** ^^ +
-| --version | show program’s version number and exit || +
-| -h, --help | show this help message and exit || +
-| -o, --only | only show processes or threads actually doing I/O || +
-| -b, --batch | non-interactive mode || +
-| -n NUM, --iter=NUM | number of iterations before ending [infinite] || +
-| -d SEC, --delay=SEC | delay between iterations [1 second] || +
-| -p PID, --pid=PID | processes/​threads to monitor [all] || +
-| -u USER, --user=USER | users to monitor [all] || +
-| -P, --processes | only show processes, not all threads || +
-| -a, --accumulated | show accumulated I/O instead of bandwidth || +
-| -k, --kilobytes | use kilobytes instead of a human friendly unit || +
-| -t, --time | add a timestamp on each line (implies –batch) || +
-| -q, --quiet | suppress some lines of header (implies –batch) || +
-</​note>​ +
- +
-=== [10p] Task A - Monitoring the behaviour ​=== +
- +
-  * Run iotop (install it if you do not already have it) in separate shell showing only processes or threads actually doing I/O. +
-  * Inspect the script ​code ({{:​ep:​laboratoare:​dummy.sh|dummy.sh}}) ​to see what it does. +
-  * Monitor the behaviour of the system with iotop while running the script. +
-  * Identify ​the PID and PPID of the process running the dummy script and kill the process using command line from another shell (sending SIGINT signal to both parent & child processes). +
-  * Hint - [[https://​superuser.com/​questions/​150117/​how-to-get-parent-pid-of-a-given-process-in-gnu-linux-from-command-line|How ​to get parent PID of a given process in GNU/Linux from command line?]] +
- +
-:!: :!: NON-DEMO TASK +
- +
-Provide a screenshot in which it shows the iotop with only the active processes and one of them being the running scriptThen another screenshot after you succeeded to kill it.  +
- +
-<​solution -hidden>​ +
-{{:​ep:​laboratoare:​lab3-ex4.png?​600}} +
- +
-Find PPID from PID: ps -o ppid= -p PID+
  
-Send SIGINT signal: kill -SIGINT PID,PPID +=== [5p] Task B Plot === 
-</solution>​+Generate a plot illustrating the compression rate, size decrease, etc. as a function of **zip** compression level. Make sure that your plot is //​understandable//​ (i.e., has labels, a legend, etc.) Make sure to average multiple measurements for each compression level.
ep/labs/03/contents/tasks/ex3.1604224759.txt.gz · Last modified: 2020/11/01 11:59 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