Skip to content

A free and open source instant messaging and VoIP chat app built for friends, groups, and communities.

TypeScript fluxerfluxerapp

chore(self-host): tune bundled postgres for the shipped box (#2143)

Hampus45ed740575fa
diff --git a/deploy/self-hosting/docker-compose.yml b/deploy/self-hosting/docker-compose.yml
index 940dbb864..e187a6fbf 100644
--- a/deploy/self-hosting/docker-compose.yml
+++ b/deploy/self-hosting/docker-compose.yml
@@ -120,6 +120,31 @@ services:
image: postgres:16-alpine
restart: unless-stopped
networks: [fluxer]
+ command: >
+ postgres
+ -c max_connections=150
+ -c shared_buffers=512MB
+ -c effective_cache_size=2GB
+ -c work_mem=8MB
+ -c maintenance_work_mem=256MB
+ -c autovacuum_work_mem=128MB
+ -c random_page_cost=1.1
+ -c effective_io_concurrency=200
+ -c default_statistics_target=200
+ -c jit=off
+ -c min_wal_size=512MB
+ -c max_wal_size=2GB
+ -c checkpoint_completion_target=0.9
+ -c wal_buffers=16MB
+ -c wal_compression=zstd
+ -c bgwriter_delay=50ms
+ -c bgwriter_lru_maxpages=1000
+ -c autovacuum_vacuum_scale_factor=0.05
+ -c autovacuum_analyze_scale_factor=0.02
+ -c autovacuum_vacuum_cost_limit=2000
+ -c track_io_timing=on
+ -c shared_preload_libraries=pg_stat_statements
+ shm_size: 256mb
environment:
POSTGRES_DB: fluxer
POSTGRES_USER: fluxer