rightscale/rightscale_cookbooks — pull request #154 by ryancragun (2013-11-05 23:45:44+00:00)
Title: block_device cookbook should support LVM block size attribute

16KB is the maximum preferred block size for EBS.[0][5]
The LVM block size should be about 1-4x the block size of the filesystem.[1]
The xfs filesystem defaults to 4K[2] and that is the recommended size for filesystems over 100MB.[3]
Innodb defaults to 16K block size[4]

Based on this data my suggested default would be a 16k block size, native to EBS and Innodb and exactly 4x the size of the default xfs block size.

Our current tools default to a 256k block size for LVM, which is a 64x size difference from the XFS filesystem.[6]

18:23:44: running lvcreate --extents 90%VG --name lvol0 --stripes 1 --stripesize 256 vg-rightscale-data_storage_01-92freaatratfa

It's likely that by simply changing the block size for LVM that we'll yield, on average, close to an order of magnitude better performance in I/O with EBS by making this change. Further research we'll need to be done for other cloud block storage devices but 16K seems like a much more sane default than 256.

[0] http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/EBSPerformance.html
[1] http://www.redhat.com/archives/linux-lvm/2001-June/msg00142.html
[2] http://linux.die.net/man/8/mkfs.xfs
[3] http://docs.cray.com/books/S-2377-22/html-S-2377-22/z1029460436.html
[4] http://lists.mysql.com/mysql/212711
[5] http://architects.dzone.com/articles/understanding-amazon-ebs-io
[6] https://github.com/rightscale/rightscale_tools/blob/master/lib/rightscale_tools/block_device/lvm.rb#L203