Re: VX_CONCURRENT flag on vxfs( 5.1 or later) for performance for postgresql?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Mr. Greg Smith

since the block size is 8k for the default, and it consisted with many
tuple/line; as my understand, if any tuple/line is changed(maybe
update, insert, delete). the block will be marked as dirty block. and
then it will be flashed to disk by bgwriter.

so my question is if the data block(8k) is aligned with the file
system block?  if it is aligned with file system block, so what's the
potential issue make it is not safe for direct io. (please  assume
vxfs, vxvm and the disk sector is aligned ).please correct me if any
incorrect.

thank you very much
Tony


On 4/30/11, Greg Smith <greg@xxxxxxxxxxxxxxx> wrote:
> On 04/30/2011 12:24 AM, Hsien-Wen Chu wrote:
>> I'm little bit confuse why it is not safe. and my question is following.
>>
>> for database application, we need to avoid double cache, PostgreSQL
>> shared_buffer will cache the data, so we do not want to file system to
>> cache the data right?. so  the DIRECT IO is better, right?.
>>
>
> No.  There are parts of PostgreSQL that expect the operating system to
> do write caching.  Two examples are the transaction logs and the
> processing done by VACUUM.  If you eliminate that with direct I/O, the
> slowdown can be much, much larger than what you gain by eliminating
> double-buffering on reads.
>
> On the read side, PostgreSQL also expects that operating system features
> like read-ahead are working properly.  While this does introduce some
> double-buffering, the benefits for sequential scans are larger than that
> overhead, too.  You may not get the expected read-ahead behavior if you
> use direct I/O.
>
> Direct I/O is not a magic switch that makes things faster; you have to
> very specifically write your application to work around what it does,
> good and bad, before it is expected to improves things.  And PostgreSQL
> isn't written that way.  It definitely requires OS caching to work well.
>
>> for VXFS, if the we use ioctl(fd,vx_cacheset,vx_concurrent) API,
>> according to the vxfs document, it will hold a shared lock for write
>> operation, but not the exclusive clock, also it is a direct IO,
>>
>
> There are very specific technical requirements that you must follow when
> using direct I/O.  You don't get direct I/O without also following its
> alignment needs.  Read the "Direct I/O best practices" section of
> http://people.redhat.com/msnitzer/docs/io-limits.txt for a quick intro
> to the subject.  And there's this additional set of requirements you
> mention in order for this particular VXFS feature to work, which I can't
> even comment on.  But you can be sure PostgreSQL doesn't try to do
> either of those things--it's definitely not aligning for direct I/O.
> Has nothing to do with ACID or the filesystem.
>
> Now, the VXFS implementation may do some tricks that bypass the
> alignment requirements.  But even if you got it to work, it would still
> be slower for anything but some read-only workloads.  Double buffering
> is really not that big of a performance problem, you just need to make
> sure you don't set shared_buffers to an extremely large value.
>
> --
> Greg Smith   2ndQuadrant US    greg@xxxxxxxxxxxxxxx   Baltimore, MD
> PostgreSQL Training, Services, and 24x7 Support  www.2ndQuadrant.us
> "PostgreSQL 9.0 High Performance": http://www.2ndQuadrant.com/books
>
>

-- 
Sent via pgsql-performance mailing list (pgsql-performance@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-performance


[Postgresql General]     [Postgresql PHP]     [PHP Users]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Yosemite]

  Powered by Linux