Using strace to determine the I/O block size

I'm a big fan of IOMeter, but what if we didn't write the software that we want to test, and don't know the IO sizes it chooses? If it's a VMware VM, we can probably leverage vscsistats, but, I want to make this hypervisor agnostic, and so I turn to strace.

In my baseline observations, I observed that 16KB reads and writes were the best for my storage, the question then became, what size IO is my application using?

To answer this question, we need to leverage strace, and we care about reads and writes. We will assume that we want to look at a simple cat command on a large (2GB) file.

Command:
# strace -e read,write cat iobw.tst -o /var/log/strace.log

This will read the file iobw.tst, and redirect the filtered strace output to /var/log/strace.log.

When we open strace.log we see the following:
write(1, "))))))))))))))))))))))))))))))))"..., 65536) = 65536
read(3, "\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0\0"..., 65536) = 65536

In the examples above, we can see that these were using a 64k read and 64k write as denoted by the last word in each line.


Comments

Popular posts from this blog

Webex Support with Windows 7

Upgrading to the Marlin firmware on the Anycubic Mega S

Installing TinyCore 8x Linux to the Hard Drive via Command Line