To pre-warm an ext4 EBS volume I'm using fio as follows:
fio --name <filename> --filename <filename> --rw read --direct 1 --ioengine libaio --bs <X>k
and I'm trying to understand what the optimal block size should be. I know that I can 'stat' and get the block size of a file but when using that in fio, it will throw an error if the file size is less than its block size.
An option could be to use the block size given by stat by default and if the file size is less than that, get the closest 'standard' number: i.e. if size is less than 4k set block size to 1024.
What's the best way of setting the right block size?
EDIT: I'm restoring a 10TB gp2 volume from a snapshot. There are a few million files - most of them are small files, but another good part is made of 50MB-30GB files and all these files need to be "ready" to be read as fast as possible. I've got a script that runs fio against each file and I'm trying to understand how I can best dynamically adjust the block size for each.