0

For my development machine I need no data consistency in case of a crash. Is there a config for a Debian-like system, that optimizes PostgreSQL for speed (even if it sacrifices reliability)?

So something like: Keep the last 1 GB in RAM. Don't touch the disk with data until the 1 GB is used.

1

Yep, if you don't mind losing commits if postgres crashes or is restarted uncleanly, you can set:

  • synchronous_commit = off

You can also use UNLOGGED tables.

If you're willing to completely re-create the postgres install (re-initdb) after a crash, you can further set:

  • fsync = off (WARNING, will cause data corruption if host crashes)
  • full_page_writes = off (WARNING, may cause data corruption if host crashes)

For more tips, see my SO reply optimise postgres for fast testing.

There is no point trying to use a ramdisk. Just use unlogged tables, tune your checkpoints to happen infrequently, and turn off fsync and full page writes if you want non-durable data. Postgres and the OS won't write things to disk unless it needs to free memory, but are free to do so if they need memory for other things. It'll usually perform better than a pure ramdisk.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.