Re: 回复: [PERFORM] PG as in-memory db? How to warm up and re-populate buffers? How to read in all tuples into memory? - Mailing list pgsql-performance

From Stefan Keller
Subject Re: 回复: [PERFORM] PG as in-memory db? How to warm up and re-populate buffers? How to read in all tuples into memory?
Date
Msg-id CAFcOn2-cdt2=ikUHs-o0aH9tYkVhLD-DnXfo_EmZpFzVrQXEog@mail.gmail.com
Whole thread Raw
In response to 回复: [PERFORM] PG as in-memory db? How to warm up and re-populate buffers? How to read in all tuples into memory?  (Wales Wang <wormwang@yahoo.com>)
Responses Re: [PERFORM] Re: 回复: [PERFORM] PG as in-memory db? How to warm up and re-populate buffers? How to read in all tuples into memory?  (Claudio Freire <klaussfreire@gmail.com>)
Re: 回复: [PERFORM] PG as in-memory db? How to warm up and re-populate buffers? How to read in all tuples into memory?  (Jeff Janes <jeff.janes@gmail.com>)
List pgsql-performance
Hi Wales

2012/2/27 Wales Wang <wormwang@yahoo.com> wrote:
> There are many approach for PostgreSQL in-memory.
> The quick and easy way is making slave pgsql run on persistent RAM
> filesystem, the slave is part of master/slave replication cluster.
>
> The fstab and script make RAM file system persistent is below:
> Setup:
> First, create a mountpoint for the disk :
> mkdir /mnt/ramdisk
> Secondly, add this line to /etc/fstab in to mount the drive at boot-time.
> tmpfs           /mnt/ramdisk tmpfs      defaults,size=65536M 0 0
> #! /bin/sh
> # /etc/init.d/ramdisk.sh
> #
>
> case "$1" in
>   start)
>     echo "Copying files to ramdisk"
>     rsync -av /data/ramdisk-backup/ /mnt/ramdisk/
>     echo [`date +"%Y-%m-%d %H:%M"`] Ramdisk Synched from HD >>
> /var/log/ramdisk_sync.log
>     ;;
>   sync)
>     echo "Synching files from ramdisk to Harddisk"
>     echo [`date +"%Y-%m-%d %H:%M"`] Ramdisk Synched to HD >>
> /var/log/ramdisk_sync.log
>     rsync -av --delete --recursive --force /mnt/ramdisk/
> /data/ramdisk-backup/
>     ;;
>   stop)
>     echo "Synching logfiles from ramdisk to Harddisk"
>     echo [`date +"%Y-%m-%d %H:%M"`] Ramdisk Synched to HD >>
> /var/log/ramdisk_sync.log
>     rsync -av --delete --recursive --force /mnt/ramdisk/
> /data/ramdisk-backup/
>     ;;
>   *)
>     echo "Usage: /etc/init.d/ramdisk {start|stop|sync}"
>     exit 1
>     ;;
> esac
> exit 0
>
> you can run it when startup and shutdown and crontabe hoursly.
>
> Wales Wang

Thank you for the tipp.
Making slave pgsql run on persistent RAM filesystem is surely at least
a possibility which I'll try out.

But what I'm finally after is a solution, where records don't get
pushed back to disk a.s.a.p. but rather got hold in memory as long as
possible assuming that there is enough memory.
I suspect that currently there is quite some overhead because of that
(besides disk-oriented structures).

-Stefan

pgsql-performance by date:

Previous
From: Tom Lane
Date:
Subject: Re: Index condition in a Nested Loop
Next
From: Claudio Freire
Date:
Subject: Re: [PERFORM] Re: 回复: [PERFORM] PG as in-memory db? How to warm up and re-populate buffers? How to read in all tuples into memory?