Ecotrust / cogs-priorities

national-scale refuge planning tool
Other
1 stars 1 forks source link

postgres memory optimization [1 day] #15

Open perrygeo opened 10 years ago

perrygeo commented 10 years ago

deploy kernel tweaks and postgres config to automatically adjust working memory set.

perrygeo commented 10 years ago

Done manually on production, Need to add this to ansible deploy and auto determine values based on available memory

# /etc/postgresql/9.1/main/postgresql.conf 
shared_buffers = 1648MB

sudo sysctl -w kernel.shmmax=2147483648
sudo sysctl -w kernel.shmall=524288

# /etc/sysctl.conf
kernel.shmall = 524288
kernel.shmmax = 2147483648
perrygeo commented 10 years ago
effective_cache_size = 4096MB
work_mem = 20MB