This is an old revision of the document!
Let's calculate the Rotational Delay - RD for a 10K RPM drive:
10000/60 = 166 RPS
1/166 = 0.006 seconds per Rotation
6/2 = 3 MS
3 MS + 3 MS = 6 MS
6 MS + 2 MS = 8 MS
1000/8 = 125 IOPS
Calculate the rotational delay (RD) for a 5400 RPM drive.
#iostat [ -x for extended statistics, -d to display device stastistics only, -m for displaying r/w in MB/s ] iostat -xdm #iostat with -p for specific device statistics iostat -xdm -p sda
$ df -kh /dev/loop*
Iotop is an utility similar to top command, that interfaces with the kernel to provide per-thread/process I/O usage statistics.
Debian/Ubuntu Linux install iotop $ sudo apt-get install iotop How to use iotop command $ sudo iotop OR $ iotop
Supported options by iotop command:
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) |
Datafile: dummy.sh.
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.
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 olivertwist.txt to itself.
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.