Created
November 17, 2012 11:02
-
-
Save rapimo/4094917 to your computer and use it in GitHub Desktop.
postgres kernel ressources
This file contains hidden or 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
get https://github.com/gregs1104/pgtune | |
see http://www.postgresql.org/docs/8.4/static/kernel-resources.html for reasonable kernel conf | |
play around with kernel settings without restart | |
sudo sysctl -w kern.sysv.shmmax=4409466880 #4GB must be a multiplier of 4096 | |
kern.sysv.shmmax: 4194304 -> 1073741824 | |
shmall must be shmax / pagesize | |
get pagesize with | |
pagesize | |
sudo sysctl -w kern.sysv.shmall=1076530 | |
save to | |
sudo vim /etc/sysctl.conf | |
if | |
tail -f /usr/local/var/postgres/server.log | |
doesn't show any errors | |
and restart | |
TL;DR | |
For my 16GB RAM MacBook pro I use the following settings | |
/usr/local/var/postgres/postgresql.conf | |
maintenance_work_mem = 1GB | |
checkpoint_segments = 16 | |
checkpoint_completion_target = 0.9 | |
effective_cache_size = 12GB | |
work_mem = 1GB | |
shared_buffers = 4GB | |
wal_buffers = 16MB | |
max_connections = 80 | |
/etc/sysctl.conf | |
kern.sysv.shmmax=5368709120 | |
kern.sysv.shmmin=1 | |
kern.sysv.shmmni=256 | |
kern.sysv.shmseg=64 | |
kern.sysv.shmall=1310720 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment