On Thu, Mar 25, 2010 at 4:15 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:
> These questions always get the first question back, what are you
> trying to accomplish? Different objectives will have different
> answers.
We have a real-time application that processes data as it comes in.
Doing some simple math tells us that a disk-based DB cannot possible
perform fast enough to allow us to process the data.
> Now, if your pg_xlog directory is a problem, then you either need
> bigger faster hard drives, or your data is more transient in nature
> and you can recreate it and you put the whole db into RAM.
When we only saw a 3x improvement in speed with the RAM based DB, we
were still seeing a fair bit of disk activity but were not sure what
was going on. Then we thought about pg_xlog and moved it to RAM as
well, but as I recall still not a great improvement.
We are trying a test right now where "initdb" was run against
/ramdisk/data so that absolutely everything should be in there. Will
report back with results.
We are also about to try another test with a regular disk-based DB and
fsync turned OFF
> Note that the query planner wasn't designed with RAM as the storage
> space for pg, so it might make some bad decisions until you adjust
> postgresql.conf to stop that. and then it still might make some bad
> decisions.
What thinks might need adjusting?
thanks,
-Alan
--
“Don't eat anything you've ever seen advertised on TV”
- Michael Pollan, author of "In Defense of Food"