Skip to content

Instantly share code, notes, and snippets.

@DavidGoussev
Forked from rgreenjr/postgres_config.md
Created April 4, 2017 23:25
Show Gist options
  • Select an option

  • Save DavidGoussev/8e614ceb25de53b1d675220de206ac8b to your computer and use it in GitHub Desktop.

Select an option

Save DavidGoussev/8e614ceb25de53b1d675220de206ac8b to your computer and use it in GitHub Desktop.
PostgreSQL Configuration Optimization

PostgreSQL Configuration Optimization

Memory

Only four values really matter:

  • shared-buffers: below 2GB: set it to 20% of full memory; below 32GB: 25% of your full memory.

  • work_mem: Start low at 32/64MB. Look for temporary file lines in logs. Then set it to 2-3x the largest temp file that you see. This setting can give a huge speed boost (if set properly).

  • maintenance_work_mem: Set it to 10% of system memory.

  • effective_cache_size: Only a hint to postgres. Just set it to the amount of filesystem cache available.

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