nodejs_package "carto"
+lowzoom_threads = [node.cpu_cores - 1, node[:memory][:total].to_f / 4194304].min.floor
+
systemd_service "update-lowzoom@" do
description "Low zoom tile update service for %i layer"
user "tile"
owner "root"
group "root"
mode "755"
- variables :style => name
+ variables :style => name, :threads => lowzoom_threads
end
service "update-lowzoom@#{name}" do
owner "root"
group "root"
mode "755"
+ variables :threads => lowzoom_threads
end
systemd_service "render-lowzoom" do
--timestamp=${timestamp} \
--tile-dir=/srv/tile.openstreetmap.org/tiles \
--socket=/var/run/renderd/renderd.sock \
- --num-threads=<%= node.cpu_cores - 1 %> \
+ --num-threads=<%= @threads %> \
--map="<%= style %>" \
--max-load=<%= node.cpu_cores - 1 %> \
--min-zoom=0 --max-zoom=12
--timestamp=$(stat -c %Y "/srv/tile.openstreetmap.org/styles/<%= @style %>/project.xml") \
--tile-dir=/srv/tile.openstreetmap.org/tiles \
--socket=/var/run/renderd/renderd.sock \
- --num-threads=<%= node.cpu_cores - 1 %> \
+ --num-threads=<%= @threads %> \
--map="<%= @style %>" \
--max-load=<%= node.cpu_cores - 1 %> \
--min-zoom=0 --max-zoom=12