Skip to content

Commit 330ba1c

Browse files
committed
Update config for new tiler server
1 parent a085cfa commit 330ba1c

4 files changed

Lines changed: 23 additions & 23 deletions

File tree

hetzner/tiler/config/postgresql.production.conf

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,10 +10,10 @@ superuser_reserved_connections = 5 # Reserve connections for superusers
1010
#------------------------------------------------------------------------------
1111

1212
# - Memory Configuration -
13-
shared_buffers = 6GB # ~12% of 50GB container limit (lower to leave room for workers)
14-
work_mem = 256MB # Memory for each sort/hash operation; be cautious with many parallel queries
15-
maintenance_work_mem = 4GB # Larger memory for VACUUM / CREATE INDEX / ALTER
16-
effective_cache_size = 26GB # ~65% of 40GB container limit
13+
shared_buffers = 16GB # ~13% of 125GB RAM
14+
work_mem = 512MB # Memory for each sort/hash operation; be cautious with many parallel queries
15+
maintenance_work_mem = 8GB # Larger memory for VACUUM / CREATE INDEX / ALTER / REFRESH
16+
effective_cache_size = 80GB # ~65% of 125GB RAM
1717

1818
# - Disk Optimization for SSD (if using SSD) -
1919
random_page_cost = 1.0 # Lower cost for random I/O on SSD
@@ -32,7 +32,7 @@ synchronous_commit = off # Improves write performance, risk of
3232
#------------------------------------------------------------------------------
3333
# AUTOVACUUM SETTINGS
3434
#------------------------------------------------------------------------------
35-
autovacuum_max_workers = 6 # More parallel vacuum workers for busy systems
35+
autovacuum_max_workers = 8 # More parallel vacuum workers for busy systems
3636
autovacuum_naptime = 30s # How often the autovacuum daemon checks for work
3737
autovacuum_vacuum_cost_limit = -1 # Let PostgreSQL adjust vacuum cost dynamically
3838

@@ -42,9 +42,9 @@ autovacuum_vacuum_cost_limit = -1 # Let PostgreSQL adjust vacuum cost d
4242
effective_io_concurrency = 300 # For SSD; helps the planner estimate IO concurrency
4343
parallel_tuple_cost = 0.001 # Lower cost to encourage parallelization
4444
parallel_setup_cost = 100 # Lower to encourage more parallel plans
45-
max_worker_processes = 25 # Match 25 CPUs container limit
46-
max_parallel_workers_per_gather = 6 # Max workers that can help a single query
47-
max_parallel_workers = 25 # Total number of parallel workers across all queries
45+
max_worker_processes = 36 # Match 36 CPUs
46+
max_parallel_workers_per_gather = 8 # Max workers that can help a single query
47+
max_parallel_workers = 36 # Total number of parallel workers across all queries
4848

4949
#------------------------------------------------------------------------------
5050
# LOGGING

hetzner/tiler/config/postgresql.staging.conf

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ superuser_reserved_connections = 2 # Reserve a few connections for superus
1111
#------------------------------------------------------------------------------
1212

1313
# - Memory Configuration -
14-
shared_buffers = 1GB # ~25% of total memory for PostgreSQL caching
15-
work_mem = 32MB # Lower memory per query to fit within 4GB RAM
16-
maintenance_work_mem = 256MB # Allocate memory for maintenance tasks like VACUUM
17-
effective_cache_size = 2GB # 50% of total memory for query planner caching
14+
shared_buffers = 4GB # Conservative, shares server with production
15+
work_mem = 256MB # Enough for import sorting
16+
maintenance_work_mem = 4GB # For CREATE INDEX during import
17+
effective_cache_size = 16GB # Conservative estimate sharing with production
1818

1919
# - Disk Optimization for SSD -
2020
random_page_cost = 1.0 # Optimize for SSD storage
@@ -35,20 +35,20 @@ synchronous_commit = off # Improve performance by reducing commi
3535
# AUTOVACUUM SETTINGS
3636
#------------------------------------------------------------------------------
3737

38-
autovacuum_max_workers = 2 # Limit autovacuum workers due to lower memory
38+
autovacuum_max_workers = 3 # Conservative, shares server with production
3939
autovacuum_naptime = 1min # Run autovacuum more frequently
4040
autovacuum_vacuum_cost_limit = -1 # Allow PostgreSQL to auto-adjust vacuum cost
4141

4242
#------------------------------------------------------------------------------
4343
# QUERY TUNING
4444
#------------------------------------------------------------------------------
4545

46-
effective_io_concurrency = 100 # Reduce IO concurrency to fit within staging constraints
46+
effective_io_concurrency = 300 # For SSD
4747
parallel_tuple_cost = 0.001 # Encourage parallel execution
4848
parallel_setup_cost = 100 # Lower parallel setup cost
49-
max_worker_processes = 4 # Limit worker processes to available CPU cores
50-
max_parallel_workers_per_gather = 4 # Allow more per-query parallel workers
51-
max_parallel_workers = 4 # Total parallel workers for staging
49+
max_worker_processes = 6 # Conservative, shares server with production
50+
max_parallel_workers_per_gather = 4 # Max workers per query
51+
max_parallel_workers = 6 # Total parallel workers
5252

5353
#------------------------------------------------------------------------------
5454
# LOGGING

hetzner/tiler/tiler.production.yml

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,9 +10,9 @@ services:
1010
- "54329:5432"
1111
env_file:
1212
- .env.tiler
13-
mem_limit: 50G
14-
cpus: "25.0"
15-
shm_size: 12g
13+
mem_limit: 100G
14+
cpus: "30.0"
15+
shm_size: 16g
1616
networks:
1717
- ohm_network
1818

images/tiler-imposm/scripts/setup_imposm_role.sh

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,9 +20,9 @@ END
2020
ALTER ROLE imposm SUPERUSER;
2121
2222
-- Session-level parameters (only apply to imposm connections, not Tegola)
23-
ALTER ROLE imposm IN DATABASE $POSTGRES_DB SET work_mem = '${IMPOSM_WORK_MEM:-1GB}';
24-
ALTER ROLE imposm IN DATABASE $POSTGRES_DB SET maintenance_work_mem = '${IMPOSM_MAINTENANCE_WORK_MEM:-10GB}';
25-
ALTER ROLE imposm IN DATABASE $POSTGRES_DB SET temp_buffers = '${IMPOSM_TEMP_BUFFERS:-64MB}';
23+
ALTER ROLE imposm IN DATABASE $POSTGRES_DB SET work_mem = '${IMPOSM_WORK_MEM:-4GB}';
24+
ALTER ROLE imposm IN DATABASE $POSTGRES_DB SET maintenance_work_mem = '${IMPOSM_MAINTENANCE_WORK_MEM:-24GB}';
25+
ALTER ROLE imposm IN DATABASE $POSTGRES_DB SET temp_buffers = '${IMPOSM_TEMP_BUFFERS:-256MB}';
2626
EOSQL
2727

2828
log_message "Imposm role setup complete."

0 commit comments

Comments
 (0)