2.0 KiB
2.0 KiB
LFCS 3.7: Storage performance
Finding a busy disk and the process behind it, measuring a disk with fio, I/O schedulers, and keeping disk history with sysstat.
Before you start
The lab adds three spare disks, which come back at every boot:
/dev/loop40(1 GiB), with an ext4 filesystem mounted at/data, for your test files;/dev/loop41(256 MiB), empty, for the scheduler tasks;/dev/loop42(256 MiB), which a process the lab started keeps busy.
If sysstat collection was on, the lab turns it off.
Tasks
- One disk is busy. Find the busiest device and the process responsible.
Write the device name (such as
vdb) on the first line of/root/lab-answers/1, and the process's command name (aspsoriotopshows it) on the second line. - Measure
/data's disk with fio, using a test file in/data: first sequential write throughput, then random 4 KiB read IOPS. Write the first test'sBW=figure (such as188MiB/s) on the first line of/root/lab-answers/2and the second test'sIOPS=figure (such as48.2k) on the second line. Remove the test file afterwards. - Find the I/O scheduler of
/dev/loop41and write its name to/root/lab-answers/3. Then change it tomq-deadlineuntil the next reboot. - Make that scheduler choice for
/dev/loop41survive a reboot. - Turn on sysstat collection and, once it has collected some data, show today's disk activity.
Hints
iostat -xz 2(ignore the first report),sudo iotop -o,pidstat -d 2(packagessysstatandiotop).fio --name=... --filename=/data/fio.test --rw=write --bs=1M --size=... --direct=1, then--rw=randread --bs=4k.cat /sys/block/loop41/queue/scheduler;echo ... | sudo teeit.- A rule in
/etc/udev/rules.d/(KERNEL==,ATTR{queue/scheduler}=),udevadm control --reload,udevadm trigger. systemctl enable --now sysstat; data comes every 10 minutes (thesa1in/usr/lib64/sa/or/usr/lib/sysstat/collects a sample by hand:sa1 1 2);sar -d -p.