Skip to content

Instantly share code, notes, and snippets.

@ralph-tice
Last active May 16, 2017 02:30
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 3 You must be signed in to fork a gist
  • Save ralph-tice/c2943aa672aaa65ecb59 to your computer and use it in GitHub Desktop.
Save ralph-tice/c2943aa672aaa65ecb59 to your computer and use it in GitHub Desktop.
PostgreSQL settings to aggressively vacuum, this config was used for an 18000 TPS steadystate workload on i2.xlarge
#------------------------------------------------------------------------------
# AUTOVACUUM PARAMETERS
#------------------------------------------------------------------------------
#autovacuum = on # Enable autovacuum subprocess? 'on'
# requires track_counts to also be on.
log_autovacuum_min_duration = 0 # -1 disables, 0 logs all actions and
# their durations, > 0 logs only
# actions running at least this number
# of milliseconds.
autovacuum_max_workers = 10 # max number of autovacuum subprocesses
# (change requires restart)
autovacuum_naptime = 15s # time between autovacuum runs
autovacuum_vacuum_threshold = 25 # min number of row updates before
# vacuum
autovacuum_analyze_threshold = 10 # min number of row updates before
# analyze
autovacuum_vacuum_scale_factor = 0.1 # fraction of table size before vacuum
autovacuum_analyze_scale_factor = 0.05 # fraction of table size before analyze
#autovacuum_freeze_max_age = 200000000 # maximum XID age before forced vacuum
# (change requires restart)
autovacuum_vacuum_cost_delay = 5ms # default vacuum cost delay for
# autovacuum, in milliseconds;
# -1 means use vacuum_cost_delay
autovacuum_vacuum_cost_limit = 1000 # default vacuum cost limit for
# autovacuum, -1 means use
# vacuum_cost_limit
vacuum_freeze_min_age = 10000000
vacuum_freeze_table_age = 150000000
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment