[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

Re: DB Upgrade complete



On Tue, 2007-07-10 at 01:56 -0500, Mike McGrath wrote:
> We'll have to do some tweaking.  Toshio pointed out that our postgres 
> config is pretty vanilla.  There are probably many tweaks we can do to 
> it so I've included it in this email.  I'm a MySQL guy so any assistance 
> on the postgres side of things would be appreciated.  If you have any 
> questions about our database, our real concern is koji, its the most 
> used database in terms of traffic and it is, by far, our largest.

I've attached some suggested changes to the default postgresql.conf
below.  They are based on reading the tuning docs on postgresql.org and
powerpostgresql.com, particularly the annotated config doc.  Let me know
if there are any questions or comments.

--- postgresql.conf.orig	2007-07-10 09:38:10.000000000 -0400
+++ postgresql.conf	2007-07-10 10:41:01.000000000 -0400
@@ -89,18 +89,23 @@
 #---------------------------------------------------------------------------
 
 # - Memory -
-#shared_buffers = 65536                 # min 16 or max_connections*2, 8KB each
-#temp_buffers = 1000                    # min 100, 8KB each
-#max_prepared_transactions = 5          # can be 0 or more
+# Note: set "kernel.shmmax = 1073741824" in sysctl.conf to make sure there's
+# enough shared memory available
+# 512M, 10% of RAM
+shared_buffers = 65536                 # min 16 or max_connections*2, 8KB each
+temp_buffers = 8192                    # min 100, 8KB each
+max_prepared_transactions = 64          # can be 0 or more
 # note: increasing max_prepared_transactions costs ~600 bytes of shared memory
 # per transaction slot, plus lock space (see max_locks_per_transaction).
-#work_mem = 1024                        # min 64, size in KB
-#maintenance_work_mem = 16384           # min 1024, size in KB
+# max memory available per-operation for sorts, aggregates, etc.
+work_mem = 32768                        # min 64, size in KB
+# memory available for vacuuming, analyzing, etc.
+maintenance_work_mem = 131072           # min 1024, size in KB
 #max_stack_depth = 2048                 # min 100, size in KB
 
 # - Free Space Map -
 
-#max_fsm_pages = 20000                  # min max_fsm_relations*16, 6 bytes each
+max_fsm_pages = 100000                  # min max_fsm_relations*16, 6 bytes each
 #max_fsm_relations = 1000               # min 100, ~70 bytes each
 
 # - Kernel Resource Usage -
@@ -110,7 +115,7 @@
 
 # - Cost-Based Vacuum Delay -
 
-#vacuum_cost_delay = 0                  # 0-1000 milliseconds
+vacuum_cost_delay = 100                  # 0-1000 milliseconds
 #vacuum_cost_page_hit = 1               # 0-10000 credits
 #vacuum_cost_page_miss = 10             # 0-10000 credits
 #vacuum_cost_page_dirty = 20            # 0-10000 credits
@@ -146,7 +151,7 @@
 
 # - Checkpoints -
 
-#checkpoint_segments = 3                # in logfile segments, min 1, 16MB each
+checkpoint_segments = 8                # in logfile segments, min 1, 16MB each
 #checkpoint_timeout = 300               # range 30-3600, in seconds
 #checkpoint_warning = 30                # in seconds, 0 is off
 
@@ -174,7 +179,8 @@
 
 # - Planner Cost Constants -
 
-#effective_cache_size = 1000            # typically 8KB each
+# 3GB
+effective_cache_size = 393216            # typically 8KB each
 #random_page_cost = 4                   # units are one sequential page fetch
                                         # cost
 #cpu_tuple_cost = 0.01                  # (same)
@@ -329,7 +335,7 @@
 # - Query/Index Statistics Collector -
 
 #stats_start_collector = on
-#stats_command_string = off
+stats_command_string = on
 #stats_block_level = off
 #stats_row_level = off
 #stats_reset_on_server_start = off
@@ -339,7 +345,7 @@
 # AUTOVACUUM PARAMETERS
 #---------------------------------------------------------------------------
 
-#autovacuum = off                       # enable autovacuum subprocess?
+autovacuum = on                       # enable autovacuum subprocess?
 #autovacuum_naptime = 60                # time between autovacuum runs, in secs
 #autovacuum_vacuum_threshold = 1000     # min # of tuple updates before
                                         # vacuum

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]