Skip to content

Commit

Permalink
Merge branch 'main' into feat/change-storage-pledge-mesurement-from-p…
Browse files Browse the repository at this point in the history
…b-to-pib
  • Loading branch information
marc-aurele-besner authored Nov 13, 2024
2 parents e8a303c + e6d133c commit 0c13103
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 0 deletions.
2 changes: 2 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -71,6 +71,7 @@ services:
volumes:
- postgres_db:/var/lib/postgresql/data
- ./indexers/db/docker-entrypoint-initdb.d/init-db.sql:/docker-entrypoint-initdb.d/init-db.sql
- ./indexers/db/postgresql.conf:/etc/postgresql/postgresql.conf
restart: unless-stopped
hostname: postgres
environment:
Expand All @@ -85,6 +86,7 @@ services:
interval: 5s
timeout: 5s
retries: 5
command: ["postgres", "-c", "config_file=/etc/postgresql/postgresql.conf"]

# Hasura GraphQL Engine
hasura:
Expand Down
52 changes: 52 additions & 0 deletions indexers/db/postgresql.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Logging (only enable for debugging, don't leave on as it will degrade performance)
# logging_collector = off
# log_destination = 'stderr'
# log_statement = 'all'
# log_min_duration_statement = 0
# log_line_prefix = '%t [%p]: [%l-1] user=%u,db=%d,app=%a,client=%h '
# log_connections = on
# log_disconnections = on
# log_duration = on

# Connection Settings
max_connections = 500
listen_addresses = '0.0.0.0'
port = 5432

# Memory Settings
shared_buffers = 8GB
effective_cache_size = 24GB
maintenance_work_mem = 2GB
work_mem = 20MB
wal_buffers = 64MB

# Checkpoint Settings
checkpoint_completion_target = 0.9
min_wal_size = 1GB
max_wal_size = 4GB

# Planner Settings
default_statistics_target = 200
random_page_cost = 1.1
effective_io_concurrency = 200

# Parallel Query Settings
max_worker_processes = 16
max_parallel_workers_per_gather = 4
max_parallel_workers = 16
max_parallel_maintenance_workers = 4

# WAL Settings
wal_writer_delay = 200ms
wal_writer_flush_after = 1MB

# Autovacuum Settings
autovacuum_max_workers = 6
autovacuum_naptime = 10s

# Logging and Monitoring
shared_preload_libraries = 'pg_stat_statements'
pg_stat_statements.track = all

# Locking Settings
deadlock_timeout = 1s

0 comments on commit 0c13103

Please sign in to comment.