Skip site navigation (1) Skip section navigation (2)

Re: Best setup for RAM drive

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: chris(at)smoothcorp(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Best setup for RAM drive
Date: 2003-03-05 17:25:30
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers

> The concern of course is if something happends to the RAM drive we are 
> S.O.L. and have to go to the last backup (pg_dump happens each night).

This is the drawback to RAM drives, period.  If there was some way to use a 
RAM drive without risking your data, everyone would do it (or at least 
everyone who can afford it).

I'd reccommend backing up your database every 15 or 30 minutes.   Then when a 
power-out happens, you lose at most 25-45 minutes worth of data.  PG_Dump is 
very fast -- if your database is on a RAM drive and being backed up to a 
second server over fast ethernet, I wouldn't be surprised if it takes no more 
than 2-3 minutes to back up.

If this is a high-transaction database (where INSERTS and UPDATES are 
constant, like 600/minute), then putting the WAL files (the pg_xlog) 
directory on the RAM drive would speed up transaction processing 
considerably, as much as 2x.   However, this still puts you at risk of 
database corruption in the event of an unxepected power-out.

Mostly, you just need a really good UPS strategy ... ideally, this machine 
should be attached to a UPS giving it at least 30 minutes of live time in the 
event of a power-out, and software on the machine that will flush the RAM 
drive to a special partition before shutting down.

Josh Berkus
Aglio Database Solutions
San Francisco

pgsql-hackers by date

Next:From: Bruce MomjianDate: 2003-03-05 19:37:36
Subject: Re: [PATCHES] Non-colliding auto generated names
Previous:From: Peter EisentrautDate: 2003-03-05 17:13:35
Subject: PGTTY?

Privacy Policy | About PostgreSQL
Copyright © 1996-2018 The PostgreSQL Global Development Group