Created
June 6, 2012 20:42
-
-
Save brianglass/2884627 to your computer and use it in GitHub Desktop.
postgres ramdisk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Create ramdisk: | |
sudo mkdir <foo> | |
Add to /etc/fstab: | |
tmpfs <foo> tmpfs size=4G,mode=1700,uid=114,gid=125 0 1 | |
Mount the ramdisk: | |
sudo mount <foo> | |
From psql: | |
create tablespace ramdisk location '/var/lib/postgres_ramdisk'; | |
I actually have a script I run to fix this since it gets corrupted after a reboot. It's just: | |
echo "drop tablespace ramdisk; create tablespace ramdisk location '/var/lib/postgres_ramdisk';" | psql | |
Add to settings.py: | |
TEST_INIT_SQL = 'set default_tablespace = ramdisk; set synchronous_commit = off' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment