java - How To Align Filesystem I/O? -
some benchmarks (especially ssds) make distinction between (4k-)aligned , non-aligned reads/writes. understand why aligning can faster, don't see how can ensure in programm reads/writes aligned actual medium.
i don't suppose it's simple making sure not seek adress within file isn't evenly divisible 4096? after all, system doesn't guarantee start of file aligned (or it?)
how programms iometer align i/o? there way in java? (or more generally, programs running inside vms).
my other question how iometer can have queue depth of > 1, 1 thread/process (and how can myself) - i'm not sure wether related aligned i/o more, or wether open new question it.
i doubt can absolutely, can increase chances.
- make sure filesystem aligned physical medium. considerations in linux (just example) see here.
- if you're accessing data sequentially, make sure use buffer size integer multiple of block size. 4096 or 8192 safe bet.
- if you're seeking or doing random access, need seek multiple of block size , fill buffer. again, safe either 4096 or 8192.
Comments
Post a Comment