Understanding I/O request or block size

I/O request size which is also referred as block size is the size of request that application uses to perform I/O operation on storage device. Every application uses a different I/O request size and based on how big the request size is, it can have pretty good impact on storage performance.

Storage performance is measure in IOPS and/or Throughput. The size of I/O request impact both of these number. Below formula shows the relationship of these three

Throughput   =   IOPS   x   I/O size

Higher the I/O size, bigger the throughput will be. On the revere size, IOPS will be lower whereas if the I/O size is smaller you will get higher IOPS. Remember, the data is stored on the storage device in size of 512 Bytes (Most common). It take a certain amount of time for storage device to read/write single sector (512 Bytes for hard disk drives). I suggest that you read http://en.wikipedia.org/wiki/Advanced_Format to learn more about sector size.

Now let’s say that you have read I/O request (operations) which is 8KB in size. To complete this request, disk will have to read 16 sectors. As you can guess, it will take more time to read 16 sectors as compared to 1 sector from the disk drive. If we change the I/O request size to 64KB, 128 sectors will be read to complete the request and it will take even more time as compared to complete 8KB size request.

Below chart shows what the typical I/O size looks like along with the access pattern for a given application type.

Application Type Access Pattern Read % Write % Blocks (In KB)
Database (transaction processing) Random 70 30 8
Mail Server Random 70 30 8
File Copy (SMB) Random 50 50 64
Database (log file) Sequential 0 100 64
Web Server Random 0 100 64
Backup Sequential 0 100 64
Restore Sequential 100 0 64

To find the correct block size for your application, you can use your operating systems monitoring capabilities. Windows 2012 has built-in Performance monitor that can provide this data. Look for Avg. Disk Bytes/Read counter.

If you are using Linux, you can do the following to find the I/O request size

  • Run iostat and look at the avgrq-sz data. This column shows the average number of sectors requested in a given I/O request
  • Multiply this number by 512 bytes to get the block I/O request size in bytes

Leave a Reply

Your email address will not be published. Required fields are marked *