Comment 3 for bug 892831

Revision history for this message
Stewart Smith (stewart) wrote : Re: [Bug 892831] Re: Fallocate support in innodb

On Mon, 21 Nov 2011 13:43:38 -0000, Raghavendra D Prabhu <email address hidden> wrote:
> Regarding unwritten extents, I had a doubt regarding that*. However, after
> discussing with XFS developers, I understood that since unwritten extents became
> default years ago, the performance impact in converting unwritten extents to
> written one are negligible now, far outweighed by benefits of fallocate and, of
> course, better than writing zeroes.

There's still a performance impact of converting them - it's file system
metadata IO.

>
> Regarding fallocate, I went with fallocate instead of the posix
> variant because
> posix_fallocate fallsback to old legacy behavior on unsupported
> systems silently
> which may not be desirable.

We use posix_fallocate() in NDB because of the portability (IIRC to
Solaris) and just live with the fact that this may not always be
optimal.

By preallocating and then writing zeros you get the best of both worlds:
you tell the allocator that you want huge chunks of disk and you don't
have the performance impact of unwritten extents.

This is mostly only a benefit when doing parallel operations or direct
IO on non-empty file systems. IIRC InnoDB does not do parallel init of files.

--
Stewart Smith