moved postgres primary setup

This commit is contained in:
coltoneshaw
2024-03-29 12:50:57 -04:00
parent fc1cfbe612
commit 492130d846
3 changed files with 36 additions and 49 deletions

3
files/postgres/primary/init.sh Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/bash
echo "include '/files/postgres/primary/primary_config.conf'" >> /var/lib/postgresql/data/postgresql.conf

View File

@@ -0,0 +1,25 @@
# This value should match the "SqlSettings.MaxConnections" value within your config.json for Mattermost
# This is a suggestion and can be set lower / higher based on the size of your server.
max_connections = 1020
tcp_keepalives_idle = 5
tcp_keepalives_interval = 1
tcp_keepalives_count = 5
# Set both of the below settings to 65% of total memory. For a 32 GB instance, it should be 21 GB.
# If on a smaller server, set this to 20% or less total RAM.
# ex: 512MB would work for a 4GB RAM server
shared_buffers = 512MB
effective_cache_size = 512MB
# Set it to 16 MB for readers and 32 MB for writers. If it's a single instance, 16 MB should be sufficient. If the instance is of a lower capacity than r5.xlarge, then set it to a lower number.
work_mem = 16MB
# 1GB (reduce this to 512MB if your server has less than 32GB of RAM)
autovacuum_work_mem = 512MB
autovacuum_max_workers = 4
autovacuum_vacuum_cost_limit = 500
#Set it to 1.1 unless the DB is using spinning disks.
random_page_cost = 1.1
restart_after_crash = on