readv: parallel or sequential?
Julian Elischer
julian at elischer.org
Thu Dec 20 14:25:24 PST 2007
Bernd Walter wrote:
> On Thu, Dec 20, 2007 at 09:40:00PM +0100, Peter Schuller wrote:
>>> Yes, but how can it now that it is on a RAID0 and taking advantage of
>>> multiple spindles instead of making it worse?
>>> The FS has to do sensible things for single spindle as well.
>>> And normaly disks are fastest when reading linear and with disk read
>>> caches this doesn't even have to be interleaved.
>>> I don't see any potential for parallell access within the same file
>>> beside some special constructed cases maybe.
>> I strongly disagree here. I would expect the operating system to not serialize
>> all I/O to the same file descriptor/file, if done in paralell from multiple
>> threads or through AIO. I have at least on use case heavily dependent on
>> this - does this mean FreeBSD would not be usable for this?
>
> No - I just didn't though about this.
> In most cases a single file means serialized use from the application,
> but of course this is not true in every case.
> In case the application uses serialized access there is not much to do
> beside preread or caching writes to make use of multiple spindles.
> But an application has to be carefull, because parallel access within
> a single file almost always mean that access is not linear anymore, so
> many opther performance tunings won't work as good as they could, so
> this could easily outweight the performance gain from multiple access.
> Nonlinear access from within an application has to be for another reason
> and not as a performance tuning.
If you want to write to different points in a file you can always open
multiple file descriptors to the same file.
All IO to a single descriptor MUST be serialised.
More information about the freebsd-fs
mailing list