On Fri, Nov 11, 2011 at 04:10:00AM -0500, Christoph Hellwig wrote:
> On Fri, Nov 11, 2011 at 06:06:16PM +0900, MORITA Kazutaka wrote:
> > posix_fallocate() shows very poor performance if the underlying
> > filesystem doesn't support fallocate() (e.g. ext3).  How about using
> > fallocate() instead of posix_fallocate(), and if it returns
> > EOPNOTSUPP, writing SD_DATA_OBJ_SIZE bytes with one pwrite() call?
> 
> At least for the samba use case (which is preallocating in 1MB chunks
> and then filling it with 64k chunks) even the dumb preallocation has
> shown benefit for ext3.  I'll try to benchmark it soon and will report
> the results to you.

Numbers on my laptop with ext3 on the second dedicated test SSD,
averaged over three runs (recreated fs each time, restarted sheepdog),
all using

        dd if=/dev/zero of=/dev/vdc bs=67108864 count=16 oflag=direct

note that this is on a fairly old kernel, and I manually had to mount
with -o barrier=1

With pwrite to the last sectors:

        52.9MB/s for the intial write
        49.0MS/s for the rewrite

With fallocate:

        62.7MB/s for the initial write
        54.4MB/s for the rewrite

>From this it seems even the dumb fallocate is a clear win, which matches
the Samba observations.
-- 
sheepdog mailing list
[email protected]
http://lists.wpkg.org/mailman/listinfo/sheepdog

Reply via email to