Skip to content

Commit

Permalink
Set max_replication_slots and max_wal_senders based on number of repl…
Browse files Browse the repository at this point in the history
…icas
  • Loading branch information
dstufft committed Jan 4, 2015
1 parent e15478d commit 5ffe27a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
1 change: 1 addition & 0 deletions pillar/base/postgresql/server.sls
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ postgresql:

port: 5432
max_connections: 100
replicas: 1

databases:
# database: owner
Expand Down
3 changes: 2 additions & 1 deletion salt/postgresql/server/configs/postgresql.conf.jinja
Original file line number Diff line number Diff line change
Expand Up @@ -91,7 +91,8 @@ checkpoint_completion_target = {{ checkpoint_completion_target }}

# - Sending Server(s) -

max_wal_senders = 3
max_replication_slots = {{ postgresl.replicas }}
max_wal_senders = {{ (postgresl.replicas * 1.5)|round(method="ceil")|int }}
wal_keep_segments = 32

# - Master Server -
Expand Down

0 comments on commit 5ffe27a

Please sign in to comment.