patch for new feature: Buffer Cache Hibernation - Mailing list pgsql-hackers

From Mitsuru IWASAKI
Subject patch for new feature: Buffer Cache Hibernation
Date
Msg-id 20110504.231048.113741617.iwasaki@jp.FreeBSD.org
Whole thread Raw
Responses Re: patch for new feature: Buffer Cache Hibernation  (Andrew Dunstan <andrew@dunslane.net>)
Re: patch for new feature: Buffer Cache Hibernation  (Greg Stark <gsstark@mit.edu>)
Re: patch for new feature: Buffer Cache Hibernation  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: patch for new feature: Buffer Cache Hibernation  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-hackers
Hi,

I am working on new feature `Buffer Cache Hibernation' which enables
postgres to keep higher cache hit ratio even just started.

Postgres usually starts with ZERO buffer cache.  By saving the buffer
cache data structure into hibernation files just before shutdown, and
loading them at startup, postgres can start operations with the saved
buffer cache as the same condition as just before the last shutdown.

Here is the patch for 9.0.3 (also tested on 8.4.7)
http://people.freebsd.org/~iwasaki/postgres/buffer-cache-hibernation-postgresql-9.0.3.patch

The patch includes the following.
- At shutdown, buffer cache data structure (such as BufferDescriptors, BufferBlocks and StrategyControl) is saved into
hibernationfiles.
 
- At startup, buffer cache data structure is loaded from hibernation files and buffer lookup hashtable is setup based
onbuffer descriptors.
 
- Above functions are enabled by specifying `enable_buffer_cache_hibernation=on' in postgresql.conf.

Any comments are welcome and I would very much appreciate merging the
patch in source tree.

Have fun and thanks!


pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: branching for 9.2devel
Next
From: Andrew Dunstan
Date:
Subject: Re: DLL export with mingw-w64: currently a no-op