Re: PostgreSQL as a local in-memory cache

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: postgres performance list <pgsql-performance(at)postgresql(dot)org>
Subject: Re: PostgreSQL as a local in-memory cache
Date: 2010-06-17 23:25:11
Message-ID: 28137.1276817111@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-performance

Josh Berkus <josh(at)agliodbs(dot)com> writes:
>> (a) and (d) are probably simple, if by "reprovisioning" you mean
>> "rm -rf $PGDATA; initdb".

> Exactly. Followed by "scp database_image". Or heck, just replacing the
> whole VM.

Right, that would work. I don't think you really need to implement that
inside Postgres. I would envision having the startup script do it, ie

rm -rf $PGDATA
cp -pr prepared-database-image $PGDATA

# this loop exits when postmaster exits normally
while ! postmaster ...
do
rm -rf $PGDATA
cp -pr prepared-database-image $PGDATA
done

Then all you need is a tweak to make the postmaster exit(1) after
a crash instead of trying to launch recovery.

regards, tom lane

In response to

Browse pgsql-performance by date

  From Date Subject
Next Message Tom Wilcox 2010-06-17 23:46:11 Re: requested shared memory size overflows size_t
Previous Message Tom Lane 2010-06-17 23:17:45 Re: Add slowdown after conversion to UTF8