Re: memory strangeness (fwd)

From: Tim Ellis <Tim(dot)Ellis(at)gamet(dot)com>
To: Curt Sampson <cjs(at)cynic(dot)net>
Cc: stigmata(at)blackangel(dot)net, pgsql-admin(at)postgresql(dot)org
Subject: Re: memory strangeness (fwd)
Date: 2002-07-09 17:19:47
Message-ID: 20020709101947.3bd8e3d0.Tim.Ellis@gamet.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Bob Smith 2002-07-09 18:27:26 Re: Meaning of message in logfile
Previous Message Naomi Walker 2002-07-09 16:47:48 Re: R: How robust is postgre in case of power failure?