Skip to content

Commit b6bf5d4

Browse files
committed
vectortile: Set saner thread numbers
The parallelism of tile rendering was incorrectly set to 4. This sets it to a saner limit, as well as limits the CPUs used by serving.
1 parent 332e5e0 commit b6bf5d4

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed
+3-3
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
default[:vectortile][:database][:cluster] = "16/main"
22
default[:vectortile][:database][:postgis] = "3"
33
default[:vectortile][:database][:nodes_store] = :flat
4-
default[:vectortile][:serve][:threads] = node.cpu_cores
4+
default[:vectortile][:serve][:threads] = (node.cpu_cores * 0.5).ceil
55
default[:vectortile][:serve][:mode] = :live
66
default[:vectortile][:replication][:url] = "https://osm-planet-eu-central-1.s3.dualstack.eu-central-1.amazonaws.com/planet/replication/minute"
77
default[:vectortile][:replication][:status] = :enabled
88
default[:vectortile][:replication][:tileupdate] = :enabled
9-
default[:vectortile][:replication][:threads] = node.cpu_cores
9+
default[:vectortile][:replication][:threads] = (node.cpu_cores * 0.5).ceil
1010

1111
default[:postgresql][:versions] |= [node[:vectortile][:database][:cluster].split("/").first]
1212
default[:postgresql][:monitor_database] = "tiles"
1313
# As an absolute worst case, the server might have the serving, update, and a manual generation process going on.
14-
default[:postgresql][:settings][:defaults][:max_connections] = (node.cpu_cores * 6 + 20).to_s
14+
default[:postgresql][:settings][:defaults][:max_connections] = (node[:vectortile][:serve][:threads] * 2 + node[:vectortile][:replication][:threads] * 2 + node.cpu_cores * 2 + 20).to_s
1515
default[:accounts][:users][:tileupdate][:status] = :role
1616
default[:accounts][:users][:tilekiln][:status] = :role

cookbooks/vectortile/recipes/default.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -258,7 +258,7 @@
258258
owner "root"
259259
group "root"
260260
mode "755"
261-
variables :tilekiln_bin => "#{tilekiln_directory}/bin/tilekiln", :source_database => "spirit", :storage_database => "tiles", :config_path => "#{shortbread_config}", :tiles_file => "/srv/vector.openstreetmap.org/data/tiles.txt", :update_threads => 4
261+
variables :tilekiln_bin => "#{tilekiln_directory}/bin/tilekiln", :source_database => "spirit", :storage_database => "tiles", :config_path => "#{shortbread_config}", :tiles_file => "/srv/vector.openstreetmap.org/data/tiles.txt"
262262
end
263263

264264
systemd_service "replicate" do

0 commit comments

Comments
 (0)