Skip to content

Instantly share code, notes, and snippets.

@bartek
Last active April 6, 2019 21:08
Show Gist options
  • Select an option

  • Save bartek/4670192 to your computer and use it in GitHub Desktop.

Select an option

Save bartek/4670192 to your computer and use it in GitHub Desktop.
Postgres memory optimization

After some reading and help from #postgresql. I settled on these changes to my memory settings in postgresql.conf. This is on a box with 8gb of ram and 2 cpus.

shared_buffers = 1GB
work_mem = 128MB
maintenance_work_mem = 256MB
effective_cache_size = 6GB

For kernel settings, I did this:

kernel.shmmax=1288490000
kernel.shmall=2097152

I received shmmax from shared_buffers plus overhead. But I am not sure if this is correct, or what are the issues with setting this either too low, or too high. This is where I would like some insight and thoughts. Same with shmall

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment