Difference between revisions of "Tuning the PostgreSQL Database"

From Observer GigaFlow Support | VIAVI Solutions Inc.
Jump to: navigation, search
Line 16: Line 16:
 
  synchronous_commit = off  
 
  synchronous_commit = off  
 
  work_mem = 10MB
 
  work_mem = 10MB
  wal_buffers= 10MB
+
  wal_buffers = 10MB
  commit_delay 10
+
  commit_delay = 10
  max_locks_per_transaction=3000
+
  max_locks_per_transaction = 3000
  
  
Line 30: Line 30:
 
  synchronous_commit = off  
 
  synchronous_commit = off  
 
  work_mem = 10MB
 
  work_mem = 10MB
  wal_buffers= 10MB
+
  wal_buffers = 10MB
  commit_delay 10
+
  commit_delay = 10
  max_locks_per_transaction=3000
+
  max_locks_per_transaction = 3000

Revision as of 08:40, 13 October 2016

Tuning of Postgres is done via the postgresql.conf file.

  • Make a copy of the original file should changes to the file cause any problems (allowing you to revert)


Settings based on available RAM

shared_buffers=1/4 of the available memory

effective_cache_size = 1/2 of available memory

Standard Settings

autovacuum_max_workers = 1
checkpoint_completion_target = 0.9
checkpoint_segments = 32
log_min_duration_statement = 5000
synchronous_commit = off 
work_mem = 10MB
wal_buffers = 10MB
commit_delay = 10
max_locks_per_transaction = 3000


Example for a server with 16GB of RAM

effective_cache_size = 8GB
shared_buffers = 4000MB
autovacuum_max_workers = 1
checkpoint_completion_target = 0.9
checkpoint_segments = 32
log_min_duration_statement = 5000
synchronous_commit = off 
work_mem = 10MB
wal_buffers = 10MB
commit_delay = 10
max_locks_per_transaction = 3000