Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

The host VMs for the DB have 8GB of RAM.
We'll set aside 2GB for the OS and assume we have 6GB for the DB.

Here I discuss the settings in the postgresql.conf file.
The default settings are for low resource environments and will result in relatively poor performance.
These seetings are my "best guess".

We'll need to do some monitoring in PROD to tune these values.

  • shared_buffers: 500MB2GB (see 1 and 2 below)
  • work_mem: 16MB (see 2)
  • maintenance_work_mem: 128MB (see 2)
  • wal_buffers: 1MB (see 2)
  • checkpoint_segments: 6 (see 2)
  • random_page_cost: 2 (see 2)
  • seq_page_cost: 1 (see 2)
  • effective_cache_size 4GB (see 1)
  • max_connections: 100 (default)

Do not forget to reload or restart for these configurations to take affect.

Links
1 - http://www.westnet.com/~gsmith/content/postgresql/pg-5minute.htm
2 - http://workshops.opengeo.org/postgis-intro/tuning.html
3 - http://wiki.postgresql.org/wiki/Tuning_Your_PostgreSQL_Server
4 - http://postgis.refractions.net/docs/ch06.html

Security - Production

The dataserver should be accessible only from the following:

...