Re: memory strangeness (fwd) - Mailing list pgsql-admin

From Tim Ellis
Subject Re: memory strangeness (fwd)
Date
Msg-id 20020709101947.3bd8e3d0.Tim.Ellis@gamet.com
Whole thread Raw
In response to Re: memory strangeness (fwd)  (Curt Sampson <cjs@cynic.net>)
Responses Re: memory strangeness (fwd)  (Curt Sampson <cjs@cynic.net>)
List pgsql-admin
> > Is there not a method of reading a disk block and instructing the OS
> > not to buffer it, or am I hallucinating?
>
> Yes. Read the block from a raw device. Of course, it's up to you to deal
> with an filesystem issues or whatever. :-)
>
> FreeBSD also has the O_DIRECT flag, but that's not guaranteed not to
> buffer the read. A much smarter way to do this is just to let the OS
> deal with the caching, and use the mmap system call to map blocks you
> want to modify into your processes' address space. This will also let
> you buffer more than 2GB of data, since the number of blocks buffered
> will not be limited by the maximum address space of a single process.

A very diplomatic way to say: "Essentially you are hallucinating" :)

I've always been a proponent of letting the OS do what it does best, so
this letting-the-OS-buffer-for-you concept, to me, is very appealing.

You still must know when the OS-buffered data has truly made it to disk
while not needing to submit lots of sync() calls. Part of that nasty
requirement that databases should guarantee data consistency and
integrity, while still performing well...

--
Tim Ellis
DBA, Gamet

pgsql-admin by date:

Previous
From: Auri Mason
Date:
Subject: TEST, ignore this, plz
Next
From: becks@ultraviolence.org (becks)
Date:
Subject: disk space