Some benchmarks (especially with SSDs) make a distinction between (4k-)aligned and non-aligned reads/writes. I understand why aligning can be faster, but I don’t see how I can ensure in my programm that reads/writes will be properly aligned to the actual medium.
I don’t suppose it’s as simple as making sure to not seek to any adress within a file that isn’t evenly divisible by 4096? After all, the system doesn’t guarantee the start of the file will be properly aligned (or does it?)
How do programms like IOMeter align their I/O? Is there any way to do it in Java? (Or more generally, programs running inside VMs).
My other question is how IOMeter can have a queue depth of > 1, with only one thread/process (and how I can do this myself) – but I’m not sure wether this is related to aligned I/O any more, or wether to open a new question about it.
I doubt you can do it absolutely, but you can greatly increase your chances.