Re: POSIX file updates - Mailing list pgsql-performance

From Mark Mielke
Subject Re: POSIX file updates
Date
Msg-id 47F1436D.4030905@mark.mielke.cc
Whole thread Raw
In response to POSIX file updates  (James Mansion <james@mansionfamily.plus.com>)
Responses Re: POSIX file updates
Re: POSIX file updates
Re: POSIX file updates
List pgsql-performance
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>


pgsql-performance by date:

Previous
From: James Mansion
Date:
Subject: POSIX file updates
Next
From: James Mansion
Date:
Subject: Re: POSIX file updates