Skip to content

Commit 4922b4f

Browse files
committed
Exclude tags that is not used in tiler
1 parent 63dd758 commit 4922b4f

3 files changed

Lines changed: 210 additions & 2 deletions

File tree

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,95 @@
1+
#------------------------------------------------------------------------------
2+
# PostgreSQL configuration optimized for IMPOSM imports/updates
3+
# Use this config when running imposm (heavy writes, large relations)
4+
# Switch back to postgresql.production.conf for normal Tegola serving
5+
#------------------------------------------------------------------------------
6+
7+
#------------------------------------------------------------------------------
8+
# CONNECTIONS AND AUTHENTICATION
9+
#------------------------------------------------------------------------------
10+
listen_addresses = '*'
11+
max_connections = 50 # Fewer connections, imposm only needs a few
12+
superuser_reserved_connections = 3
13+
14+
#------------------------------------------------------------------------------
15+
# RESOURCE USAGE
16+
#------------------------------------------------------------------------------
17+
18+
# - Memory Configuration -
19+
shared_buffers = 14GB # ~25% of total 55GB
20+
work_mem = 512MB # More memory per operation for large geometries
21+
maintenance_work_mem = 8GB # Double for heavy index/vacuum operations during import
22+
effective_cache_size = 40GB # More cache since fewer connections compete
23+
temp_buffers = 256MB # More temp buffer space for large sorts
24+
25+
# - Disk Optimization for SSD -
26+
random_page_cost = 1.0
27+
seq_page_cost = 1.0
28+
29+
#------------------------------------------------------------------------------
30+
# WRITE-AHEAD LOG (WAL) - Optimized for heavy writes
31+
#------------------------------------------------------------------------------
32+
wal_level = minimal # Minimal WAL since no replication during import
33+
max_wal_senders = 0 # No replication slots needed
34+
checkpoint_timeout = 30min # Less frequent checkpoints during heavy writes
35+
max_wal_size = 16GB # Much larger WAL before forcing checkpoint
36+
min_wal_size = 2GB # Keep more WAL files ready
37+
wal_compression = lz4
38+
synchronous_commit = off # Faster writes
39+
wal_buffers = 256MB # Larger WAL buffer for write-heavy workload
40+
full_page_writes = off # Faster writes (safe if using filesystem snapshots or ok with re-import)
41+
42+
#------------------------------------------------------------------------------
43+
# AUTOVACUUM - Reduced during import
44+
#------------------------------------------------------------------------------
45+
autovacuum = on
46+
autovacuum_max_workers = 3 # Fewer workers, less competition with imposm
47+
autovacuum_naptime = 120s # Check less frequently during import
48+
autovacuum_vacuum_cost_limit = 1000 # Less aggressive vacuum
49+
50+
#------------------------------------------------------------------------------
51+
# QUERY TUNING
52+
#------------------------------------------------------------------------------
53+
effective_io_concurrency = 300
54+
parallel_tuple_cost = 0.001
55+
parallel_setup_cost = 100
56+
max_worker_processes = 28
57+
max_parallel_workers_per_gather = 4 # Fewer parallel workers per query, more for writes
58+
max_parallel_workers = 28
59+
max_parallel_maintenance_workers = 8 # More workers for CREATE INDEX after import
60+
61+
#------------------------------------------------------------------------------
62+
# LOGGING - Enable minimal logging to track slow imports
63+
#------------------------------------------------------------------------------
64+
logging_collector = off
65+
log_statement = 'none'
66+
log_duration = off
67+
log_min_duration_statement = 300000 # Log queries taking more than 5 minutes
68+
log_error_verbosity = default # More detail for debugging import issues
69+
log_autovacuum_min_duration = -1
70+
log_connections = off
71+
log_disconnections = off
72+
log_lock_waits = on # Log lock waits to detect contention
73+
log_temp_files = 0 # Log all temp file usage (sign of memory pressure)
74+
log_checkpoints = on # Log checkpoints to monitor write pressure
75+
log_replication_commands = off
76+
log_directory = '/dev/null'
77+
78+
#------------------------------------------------------------------------------
79+
# CLIENT CONNECTION DEFAULTS - No timeouts for large imports
80+
#------------------------------------------------------------------------------
81+
statement_timeout = 0 # NO timeout - large relations can take very long
82+
lock_timeout = 3600000 # 1 hour lock timeout
83+
idle_in_transaction_session_timeout = 3600000 # 1 hour idle timeout
84+
85+
#------------------------------------------------------------------------------
86+
# LOCALE AND TIMING
87+
#------------------------------------------------------------------------------
88+
datestyle = 'iso, mdy'
89+
timezone = 'Etc/UTC'
90+
lc_messages = 'en_US.utf8'
91+
lc_monetary = 'en_US.utf8'
92+
lc_numeric = 'en_US.utf8'
93+
lc_time = 'en_US.utf8'
94+
95+
default_text_search_config = 'pg_catalog.english'

hetzner/tiler/tiler.production.yml

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ services:
44
image: ghcr.io/openhistoricalmap/tiler-db:0.0.1-0.dev.git.2166.hc55c4cd
55
volumes: !overwrite
66
- tiler_pgdata:/var/lib/postgresql/data
7-
- ./config/postgresql.production.conf:/etc/postgresql/postgresql.conf
7+
- ./config/${PG_CONFIG:-postgresql.production.conf}:/etc/postgresql/postgresql.conf
88
ports:
99
- "54329:5432"
1010
env_file:
@@ -132,6 +132,27 @@ services:
132132
- .env.tiler
133133
networks:
134134
- ohm_network
135+
136+
tiler_pipeline_monitor:
137+
container_name: tiler_pipeline_monitor
138+
image: ghcr.io/openhistoricalmap/tiler-pipeline-monitor:0.0.1
139+
ports:
140+
- "8001:8001"
141+
environment:
142+
- CHECK_INTERVAL=300
143+
- REPLICATION_LAG_THRESHOLD=600
144+
- MV_REFRESH_THRESHOLD=600
145+
- IMPOSM_IMPORT_MAX_AGE=900
146+
env_file:
147+
- .env.tiler
148+
restart: always
149+
healthcheck:
150+
test: ["CMD", "curl", "-f", "http://localhost:8001/health"]
151+
interval: 30s
152+
retries: 3
153+
timeout: 10s
154+
networks:
155+
- ohm_network
135156

136157
volumes:
137158
tiler_pgdata:

images/tiler-imposm/config/imposm3.template.json

Lines changed: 93 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,99 @@
44
"exclude": [
55
"created_by",
66
"source",
7-
"source:datetime"
7+
"source:*",
8+
"source_ref",
9+
"note",
10+
"note:*",
11+
"fixme",
12+
"fixme:*",
13+
"FIXME",
14+
"todo",
15+
"description",
16+
"description:*",
17+
"comment",
18+
"wikimedia_commons",
19+
"image",
20+
"image:*",
21+
"website",
22+
"url",
23+
"email",
24+
"phone",
25+
"fax",
26+
"contact:*",
27+
"opening_hours",
28+
"opening_hours:*",
29+
"addr:*",
30+
"is_in",
31+
"is_in:*",
32+
"attribution",
33+
"license",
34+
35+
"tiger:*",
36+
"gnis:*",
37+
"NHD:*",
38+
"nhd:*",
39+
"NHDPlus:*",
40+
"ref:*",
41+
"nysgissam:*",
42+
"nypl:*",
43+
"nygisid",
44+
"bkln:*",
45+
"base_bbl",
46+
"yh:*",
47+
"nl_ahcb:*",
48+
"ign:*",
49+
"istatcom:*",
50+
"hf:*",
51+
"gvr:*",
52+
"LINZ:*",
53+
"TMC:*",
54+
"NJDOT_*",
55+
"A45_*",
56+
"ANR",
57+
"FIPS",
58+
"EDGE_ID",
59+
"OBJECTID",
60+
"GlobalID",
61+
"GLOBALID",
62+
"HFCS",
63+
"zhb_code",
64+
65+
"import",
66+
"import:*",
67+
"import_uuid",
68+
"import_edge_id",
69+
"converted_by",
70+
"upload",
71+
"pre_download",
72+
"dataset",
73+
"odbl",
74+
"odbl:note",
75+
"history",
76+
77+
"roof:*",
78+
"building:levels",
79+
"building:part",
80+
"building:material",
81+
"building:colour",
82+
"generator:*",
83+
"tactile_paving",
84+
"crossing:markings",
85+
"crossing:island",
86+
"crossing:barrier",
87+
"traffic_sign",
88+
"traffic_sign:*",
89+
"traffic_signals",
90+
"traffic_signals:*",
91+
"button_operated",
92+
"sidewalk",
93+
"sidewalk:*",
94+
"parking",
95+
"parking:*",
96+
"lit",
97+
"smoothness",
98+
"direction",
99+
"ele"
8100
]
9101
},
10102
"generalized_tables": {},

0 commit comments

Comments
 (0)