iostat
#
You'll see the term "I/O" or "IO" thrown around a lot. All it means is "Input/Output" and it generally refers to the process of putting data into or onto something or taking data from somewhere or off of something.
When we're talking about network interfaces I/O would mean the packets coming in (I) and the packets going out (O). With disks, it means bytes being written to (I) the disk and bytes being read (O) from the disk.
That's why iostat
is called io
and stat
: input/output statistics. Let's run iostat
:
1 2 3 4 5 6 7 8 9 10 11 12 |
|
It's funny how iostat
also give us the CPU load average because a CPU is an I/O device. We'll ignore this though, as we've covered load averages previously.
Now we have rows representing the disks on this system. I only have one inside of this VM: xvda
. We can safely ignore the loop
devices.
Let's look at each column, above:
tps
- transfers per secondkB_read/s
- Kilobytes (B
= bytes,b
= bits) read from the device, per secondkB_wrtn/s
- Kilobytes (B
= bytes,b
= bits) written to the device, per secondkB_dscd/s
- Kilobytes (B
= bytes,b
= bits) disgarded, per secondkB_read
- Kilobytes (B
= bytes,b
= bits) read from the device, total (since monitoring started)kB_wrtn
- Kilobytes (B
= bytes,b
= bits) written to the device, totalkB_dscd
- - Kilobytes (B
= bytes,b
= bits) disgarded, total
So, we can see my primary device, xvda
, is very idle. There are hardly any transactions per second, hardly anything being read from or written to the device at this moment in time. Let's change that by faking some disk activity.
I've generated a 20GiB file and then used rsync
to transfer the file from one part of the disk to another part of the same disk (basically within the same file system on the disk):
1 2 |
|
Now we can see 665
transactions per second and we're writing 83,916
KiB per second. We're also reading it heavily too. This demonstrates the disk being heavily utilised. If I take a second snapshot moment later, I can see it's still being heavily utilised:'
1 2 |
|
This time I ran iostat
with the -m
flag so that it converted kilobytes (KB) to megabytes (MB). We're writing at a rate of 81.95
megabytes per second. That's pretty slow for a disk, but it's actually being limited by the underlaying provider: AWS Lightsail. They've me a limited amount of disk throughput to protect their infrastructure (and extract more money from me!)
That's a basically look at how measuring disk utilisation works. Simple.
Next#
Now we're going to move on to SSH: configuring it and using it.