Permalink
Browse files

Finished porting over settings file from puppet manifest.

  • Loading branch information...
rca committed Mar 14, 2013
1 parent c1bdb86 commit 550b02c96c9c00659c4ddd14a50d61ecde620a79
Showing with 9 additions and 6 deletions.
  1. +9 −6 files/etc/postgresql/9.2/main/postgresql.conf
@@ -56,6 +56,7 @@ external_pid_file = '/var/run/postgresql/9.2-main.pid' # write an extra PID fi
# - Connection Settings -
+listen_addresses = '*' # what IP address(es) to listen on;
#listen_addresses = 'localhost' # what IP address(es) to listen on;
# comma-separated list of addresses;
# defaults to 'localhost'; use '*' for all
@@ -109,8 +110,8 @@ ssl_key_file = '/etc/ssl/private/ssl-cert-snakeoil.key' # (change requires rest
#------------------------------------------------------------------------------
# - Memory -
-
-shared_buffers = <%= "%.0fkB" % [[system_memory.to_f / 4, 1024**3 * 8].min / 1024] %> # min 128kB, this makes it 25% of system RAM or ceiling of 8G
+{% set mem = 8192 if 8192 < (grains['mem_total'] / 4) else (grains['mem_total'] / 4) %}
+shared_buffers = {{ (1024 * mem)|int }}kB # min 128kB, this makes it 25% of system RAM or ceiling of 8G
# (change requires restart)
#temp_buffers = 8MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature
@@ -120,7 +121,8 @@ shared_buffers = <%= "%.0fkB" % [[system_memory.to_f / 4, 1024**3 * 8].min / 102
# It is not advisable to set max_prepared_transactions nonzero unless you
# actively intend to use prepared transactions.
work_mem = 64MB # min 64kB; 2-3X size of largest temp file; tune this based on "temporary file" lines in logs.
-maintenance_work_mem = <%= "%.0fkB" % [[system_memory.to_f / 10, 1024**3 * 1].min / 1024] %> # min 1MB, this makes it 10% of system RAM or ceiling of 1G
+{% set mem = 1024 if 1024 < (grains['mem_total'] / 10) else (grains['mem_total'] / 10) %}
+maintenance_work_mem = {{ (1024 * mem)|int }}kB # min 1MB, this makes it 10% of system RAM or ceiling of 1G
#max_stack_depth = 2MB # min 1MB
# - Disk -
@@ -266,7 +268,8 @@ random_page_cost = 1.1 # use 1.1 for AWS, 1.5 for Rackspace Cloud, 2.5 for bar
#cpu_tuple_cost = 0.01 # same scale as above
#cpu_index_tuple_cost = 0.005 # same scale as above
#cpu_operator_cost = 0.0025 # same scale as above
-effective_cache_size = <%= "%.0fkB" % [system_memory.to_f / 2 / 1024] %> # 50% of system memory
+{% set mem = grains['mem_total'] / 2 %}
+effective_cache_size = {{ (1024 * mem)|int }}kB # 50% of system memory
# - Genetic Query Optimizer -
@@ -418,7 +421,7 @@ log_lock_waits = on # log lock waits >= deadlock_timeout
log_temp_files = 0 # log temporary files equal or larger
# than the specified size in kilobytes;
# -1 disables, 0 logs all temp files
-log_timezone = 'localtime'
+log_timezone = 'UTC'
#------------------------------------------------------------------------------
@@ -499,7 +502,7 @@ log_timezone = 'localtime'
datestyle = 'iso, mdy'
#intervalstyle = 'postgres'
-timezone = 'localtime'
+timezone = 'UTC'
#timezone_abbreviations = 'Default' # Select the set of available time zone
# abbreviations. Currently, there are
# Default

0 comments on commit 550b02c

Please sign in to comment.