Skip to content

Commit 1130d6b

Browse files
committed
Update db connetion for tiler - new server
1 parent 090e198 commit 1130d6b

3 files changed

Lines changed: 11 additions & 11 deletions

File tree

hetzner/tiler/config/postgresql.production.conf

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# CONNECTIONS AND AUTHENTICATION
33
#------------------------------------------------------------------------------
44
listen_addresses = '*' # Allow connections from any network interface
5-
max_connections = 200 # Increase if you expect more concurrent connections
5+
max_connections = 300 # 4 Tegola replicas × 56 conn + refresh/imposm headroom
66
superuser_reserved_connections = 5 # Reserve connections for superusers
77

88
#------------------------------------------------------------------------------
@@ -11,7 +11,7 @@ superuser_reserved_connections = 5 # Reserve connections for superusers
1111

1212
# - Memory Configuration -
1313
shared_buffers = 16GB # ~13% of 125GB RAM
14-
work_mem = 512MB # Memory for each sort/hash operation; be cautious with many parallel queries
14+
work_mem = 256MB # Memory for each sort/hash operation; balanced for 300 max connections
1515
maintenance_work_mem = 8GB # Larger memory for VACUUM / CREATE INDEX / ALTER / REFRESH
1616
effective_cache_size = 80GB # ~65% of 125GB RAM
1717

images/tiler-imposm/scripts/refresh_mviews.sh

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,10 @@ source ./scripts/utils.sh
2020
# Usage:
2121
# refresh_mviews_group "WATER" 180 light "${water_views[@]}" &
2222
# ============================================================================
23-
LIGHT_WORK_MEM="${LIGHT_WORK_MEM:-64MB}"
24-
LIGHT_MAINT_MEM="${LIGHT_MAINT_MEM:-256MB}"
25-
HEAVY_WORK_MEM="${HEAVY_WORK_MEM:-512MB}"
26-
HEAVY_MAINT_MEM="${HEAVY_MAINT_MEM:-4GB}"
23+
LIGHT_WORK_MEM="${LIGHT_WORK_MEM:-256MB}"
24+
LIGHT_MAINT_MEM="${LIGHT_MAINT_MEM:-2GB}"
25+
HEAVY_WORK_MEM="${HEAVY_WORK_MEM:-1GB}"
26+
HEAVY_MAINT_MEM="${HEAVY_MAINT_MEM:-8GB}"
2727

2828
function refresh_mviews_group() {
2929
local group_name="$1"

images/tiler-server/config/config.template.toml

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ type = "prometheus"
2626
name = "ohm"
2727
type = "mvt_postgis"
2828
uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
29-
max_connections = 120
29+
max_connections = 30
3030
###### PROVIDERS_OSM
3131

3232
####################################
@@ -37,7 +37,7 @@ max_connections = 120
3737
name = "ohm_admin"
3838
type = "mvt_postgis"
3939
uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
40-
max_connections = 25
40+
max_connections = 8
4141
###### PROVIDERS_ADMIN_BOUNDARIES_AREAS
4242

4343
####################################
@@ -48,7 +48,7 @@ max_connections = 25
4848
name = "ohm_other_boundaries"
4949
type = "mvt_postgis"
5050
uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
51-
max_connections = 25
51+
max_connections = 8
5252
###### PROVIDERS_NON_ADMIN_BOUNDARIES_AREAS
5353

5454
####################################
@@ -58,7 +58,7 @@ max_connections = 25
5858
name = "ne"
5959
type = "mvt_postgis"
6060
uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
61-
max_connections = 25
61+
max_connections = 5
6262
###### Water lands ne
6363
[[providers.layers]]
6464
name = "ne_water_lakes_0-8"
@@ -74,7 +74,7 @@ max_connections = 25
7474
name = "osm_land"
7575
type = "mvt_postgis"
7676
uri = "postgresql://${POSTGRES_USER}:${POSTGRES_PASSWORD}@${POSTGRES_HOST}:${POSTGRES_PORT}/${POSTGRES_DB}"
77-
max_connections = 25
77+
max_connections = 5
7878
[[providers.layers]]
7979
name = "osm_land_0-2"
8080
geometry_fieldname = "geometry"

0 commit comments

Comments
 (0)