From: Mark Mielke <mark@mark.mielke.cc>
To: James Mansion <james@mansionfamily.plus.com>
Cc: pgsql-performance@postgresql.org
Subject: Re: POSIX file updates
Date: Mon, 31 Mar 2008 16:02:53 -0400
Message-ID: <47F1436D.4030905@mark.mielke.cc> (raw)
In-Reply-To: <47F1413B.40109@mansionfamily.plus.com>
References: <47F1413B.40109@mansionfamily.plus.com>
James Mansion wrote:
> (Declaration of interest: I'm researching for a publication
> on OLTP system design)
>
> I have a question about file writes, particularly on POSIX.
> This arose while considering the extent to which cache memory
> and command queueing on disk
> drives can help improve performance.
>
> Is it correct that POSIX requires that the updates to a single
> file are serialised in the filesystem layer?
Is there anything in POSIX that seems to suggest this? :-) (i.e. why are
you going under the assumption that the answer is yes - did you read
something?)
> So, if we have a number of dirty pages to write back to a single
> file in the database (whether a table or index) then we cannot
> pass these through the POSIX filesystem layer into the TCQ/NCQ
> system on the disk drive, so it can reorder them?
I don't believe POSIX has any restriction such as you describe - or if
it does, and I don't know about it, then most UNIX file systems (if not
most file systems on any platform) are not POSIX compliant.
Linux itself, even without NCQ, might choose to reorder the writes. If
you use ext2, the pressure to push pages out is based upon last used
time rather than last write time. It can choose to push out pages at any
time, and it's only every 5 seconds or so the the system task (bdflush?)
tries to force out all dirty file system pages. NCQ exaggerates the
situation, but I believe the issue pre-exists NCQ or the SCSI equivalent
of years past.
The rest of your email relies on the premise that POSIX enforces such a
thing, or that systems are POSIX compliant. :-)
Cheers,
mark
--
Mark Mielke <mark@mielke.cc>
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-performance@postgresql.org
Cc: mark@mark.mielke.cc, james@mansionfamily.plus.com
Subject: Re: POSIX file updates
In-Reply-To: <47F1436D.4030905@mark.mielke.cc>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox