Skip to content

Commit

Permalink
Postgres tune for insert
Browse files Browse the repository at this point in the history
Async commit -> Datenverlust beim Crash (max 1 sekunde) dafür drastisch schneller
Autovaccum etwas angepasst (threshold 500 statt 50)
  • Loading branch information
kgbvax committed Apr 3, 2017
1 parent 0020b9b commit 08b72a4
Showing 1 changed file with 14 additions and 14 deletions.
28 changes: 14 additions & 14 deletions gateways_kea_postgres/templates/postgresql.conf.j2
Expand Up @@ -115,7 +115,7 @@ shared_buffers = 128MB # min 128kB
#huge_pages = try # on, off, or try
# (change requires restart)
#temp_buffers = 8MB # min 800kB
#max_prepared_transactions = 0 # zero disables the feature
#max_prepared_transactions = 128 # zero disables the feature
# (change requires restart)
# Caution: it is not advisable to set max_prepared_transactions nonzero unless
# you actively intend to use prepared transactions.
Expand Down Expand Up @@ -152,7 +152,7 @@ dynamic_shared_memory_type = posix # the default is the first option

# - Background Writer -

#bgwriter_delay = 200ms # 10-10000ms between rounds
bgwriter_delay = 333ms # 10-10000ms between rounds
#bgwriter_lru_maxpages = 100 # 0-1000 max buffers written/round
#bgwriter_lru_multiplier = 2.0 # 0-10.0 multipler on buffers scanned/round

Expand All @@ -170,8 +170,8 @@ dynamic_shared_memory_type = posix # the default is the first option

#wal_level = minimal # minimal, archive, hot_standby, or logical
# (change requires restart)
#fsync = on # turns forced synchronization on or off
#synchronous_commit = on # synchronization level;
fsync = on # turns forced synchronization on or off
synchronous_commit = off # synchronization level;
# off, local, remote_write, or on
#wal_sync_method = fsync # the default is the first option
# supported by the operating system:
Expand All @@ -180,20 +180,20 @@ dynamic_shared_memory_type = posix # the default is the first option
# fsync
# fsync_writethrough
# open_sync
#full_page_writes = on # recover from partial page writes
full_page_writes = on # recover from partial page writes
#wal_compression = off # enable compression of full-page writes
#wal_log_hints = off # also do full page writes of non-critical updates
# (change requires restart)
#wal_buffers = -1 # min 32kB, -1 sets based on shared_buffers
# (change requires restart)
#wal_writer_delay = 200ms # 1-10000 milliseconds
wal_writer_delay = 333ms # 1-10000 milliseconds

#commit_delay = 0 # range 0-100000, in microseconds
#commit_siblings = 5 # range 1-1000

# - Checkpoints -

#checkpoint_timeout = 5min # range 30s-1h
checkpoint_timeout = 5min # range 30s-1h
#max_wal_size = 1GB
#min_wal_size = 80MB
#checkpoint_completion_target = 0.5 # checkpoint target duration, 0.0 - 1.0
Expand Down Expand Up @@ -455,7 +455,7 @@ log_timezone = 'localtime'
# - Query/Index Statistics Collector -

#track_activities = on
#track_counts = on
track_counts = on
#track_io_timing = off
#track_functions = none # none, pl, all
#track_activity_query_size = 1024 # (change requires restart)
Expand All @@ -474,18 +474,18 @@ stats_temp_directory = '/var/run/postgresql/9.5-main.pg_stat_tmp'
# AUTOVACUUM PARAMETERS
#------------------------------------------------------------------------------

#autovacuum = on # Enable autovacuum subprocess? 'on'
autovacuum = on # Enable autovacuum subprocess? 'on'
# requires track_counts to also be on.
#log_autovacuum_min_duration = -1 # -1 disables, 0 logs all actions and
log_autovacuum_min_duration = 10000 # -1 disables, 0 logs all actions and
# their durations, > 0 logs only
# actions running at least this number
# of milliseconds.
#autovacuum_max_workers = 3 # max number of autovacuum subprocesses
autovacuum_max_workers = 2 # max number of autovacuum subprocesses
# (change requires restart)
#autovacuum_naptime = 1min # time between autovacuum runs
#autovacuum_vacuum_threshold = 50 # min number of row updates before
autovacuum_naptime = 5min # time between autovacuum runs
autovacuum_vacuum_threshold = 500 # min number of row updates before
# vacuum
#autovacuum_analyze_threshold = 50 # min number of row updates before
autovacuum_analyze_threshold = 500 # min number of row updates before
# analyze
#autovacuum_vacuum_scale_factor = 0.2 # fraction of table size before vacuum
#autovacuum_analyze_scale_factor = 0.1 # fraction of table size before analyze
Expand Down

0 comments on commit 08b72a4

Please sign in to comment.