diff --git a/CHANGELOG.md b/CHANGELOG.md index 6f1c976..156fc50 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,6 +7,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## 🚀 Features +- Optimise postgres config - Cardano's ipc socket file is now stored in a docker volume so when stale can be recreated on all OSes. - `cardano-cli.sh`, `midnight-node.sh` and `midnight-shell.sh` execute within the running container. - Switch networks by altering CFG_PRESET only diff --git a/compose-partner-chains.yml b/compose-partner-chains.yml index 4b73f4b..b99ccaa 100644 --- a/compose-partner-chains.yml +++ b/compose-partner-chains.yml @@ -44,6 +44,8 @@ services: - POSTGRES_USER=${POSTGRES_USER} volumes: - postgres-data:/var/lib/postgresql/data + - ./postgresql.conf:/etc/postgresql.conf + command: postgres -c config_file=/etc/postgresql.conf -c listen_addresses='*' ports: - "${POSTGRES_PORT}:${POSTGRES_PORT}" healthcheck: diff --git a/postgresql.conf b/postgresql.conf new file mode 100644 index 0000000..22fbcb3 --- /dev/null +++ b/postgresql.conf @@ -0,0 +1,24 @@ +# Tuned from https://pgtune.leopard.in.ua/?dbVersion=15&osType=linux&dbType=oltp&cpuNum=1&totalMemory=1&totalMemoryUnit=GB&connectionNum=20&hdType=ssd +# (Please regenerate when altering postgres versions.) +# +# DB Version: 15 +# OS Type: linux +# DB Type: oltp +# Total Memory (RAM): 3 GB +# CPUs num: 1 +# Connections num: 20 +# Data Storage: ssd + +max_connections = 20 +shared_buffers = 768MB +effective_cache_size = 2304MB +maintenance_work_mem = 192MB +checkpoint_completion_target = 0.9 +wal_buffers = 16MB +default_statistics_target = 100 +random_page_cost = 1.1 +effective_io_concurrency = 200 +work_mem = 28086kB +huge_pages = off +min_wal_size = 2GB +max_wal_size = 8GB