Re: Mapping Database completly into memory - Mailing list pgsql-performance

From scott.marlowe
Subject Re: Mapping Database completly into memory
Date
Msg-id Pine.LNX.4.33.0307281155070.19692-100000@css120.ihs.com
Whole thread Raw
In response to Mapping Database completly into memory  (Daniel Migowski <Mig-O@artis.uni-oldenburg.de>)
List pgsql-performance
On Sun, 27 Jul 2003, Daniel Migowski wrote:

> Hallo pgsql-performance,
>
> I just wondered if there is a possibility to map my database running
> on a linux system completly into memory and to only use disk
> accesses for writes.
>
> I got a nice machine around with 2 gigs of ram, and my database at
> the moment uses about 30MB on the disks.
>
> Or does Postgresql do this automtatically, with some cache adjusting
> parameters, and after doing a select * from <everything> on my
> database?

Are you looking at a read only type database thing here?  It's generally
considered bad practice to run databases from memory only, since a loss of
power results in a loss of all data.

Postgresql and whatever OS it runs on can usually cache an entire 30 meg
data set in memory easily.  You'll need to crank up shared buffers a bit
(1000 shared buffers is 8 megs, so 5000 should be enough to cache the
whole thing (~40 megs).  Also, be sure and crank up your
effective_cache_size so the planner knows the kernel has lots of space for
caching data and favors index scans.


pgsql-performance by date:

Previous
From: Andrew Sullivan
Date:
Subject: Re: Mapping a database completly into Memory
Next
From: Josh Berkus
Date:
Subject: Re: Optimization