Re: -F option, RAM usage, more...

From: "Dominic J(dot) Eidson" <sauron(at)the-infinite(dot)org>
To: Mike Biamonte <mike(at)dbeat(dot)com>
Cc: pgsql-general(at)hub(dot)org
Subject: Re: -F option, RAM usage, more...
Date: 2000-10-04 18:36:46
Message-ID: Pine.LNX.4.10.10010041323500.6452-100000@morannon.the-infinite.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 4 Oct 2000, Mike Biamonte wrote:

> I understand from the docs that -F ".. prevents fsync()'s from
> flushing to disk after every transaction.." and that this boosts
> performance because RAM accesses are far faster than disk accesses. I
> have also seen some impressive stats regarding the degree of this
> performance boost.

Normally, in order to ensure integrity of the database/datafiles,
PostgreSQL calls fsync() after each transaction - what this does, is it
ensures that all disk buffers are flushed to disk - ensuring that any
changes done in that transaction are committed to disk.

> 1. How often DOES PG flush to disk - if at all - when the -F option is
> invoked? Can this be controllled?

Once after each transaction.

> 2. I have no first hand experience with Oracle, but I understand that
> one of the keys to its speed is its ability to pull the entire
> database (or selected tables) into RAM and work them from there. Is
> this comparable to Postgres' -F option?

No. As far as I know PostgreSQL can't load an entire table into memory
beyond what could/would/might be cached in-memory as part of the OS'es
disk caching.

> 3. With -F, does PG pull the database into RAM at startup? Or does it
> pull data into RAM as it is accessed. (eg: the first few queries
> would be slower, but subsequent queries on same data would be
> faster...)?

No.

> 4. Does the -F option speed SELECTs as well as it speeds INSERTs?

I'll wager to assume that fsync() is only called after
INSERT/UPDATE/DELETE/ALTER's - since these are the only ones that modify
the on-disk data - although I could be wrong. So no, it wouldn't speed up
SELECT's.

> 5. I have a dedicated Linux 2.2.16 db server with 2GB of RAM. How can
> I be sure that Postgres is using all the RAM that it can? (-S
> option? -B option?)

Adjust your -S and -B options appropriately - not that I have any
"recommended values" :(

--
Dominic J. Eidson
"Baruk Khazad! Khazad ai-menu!" - Gimli
-------------------------------------------------------------------------------
http://www.the-infinite.org/ http://www.the-infinite.org/~dominic/

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mitch Vincent 2000-10-04 18:44:29 Re: -F option, RAM usage, more...
Previous Message Mikhail Terekhov 2000-10-04 18:32:27 VACUUM