]> git.openstreetmap.org Git - chef.git/blobdiff - cookbooks/tile/recipes/default.rb
Increase file descriptor limit for renderd
[chef.git] / cookbooks / tile / recipes / default.rb
index 57ee431b085ac6deb617204ded22c64b558b58e9..154ce68fd50facaae76a71f654e78c0a265054f7 100644 (file)
@@ -23,6 +23,7 @@ include_recipe "git"
 include_recipe "munin"
 include_recipe "nodejs"
 include_recipe "postgresql"
+include_recipe "prometheus"
 include_recipe "python"
 include_recipe "tools"
 
@@ -45,7 +46,13 @@ ssl_certificate node[:fqdn] do
   notifies :reload, "service[apache2]"
 end
 
+remote_file "#{Chef::Config[:file_cache_path]}/fastly-ip-list.json" do
+  source "https://api.fastly.com/public-ip-list"
+  compile_time true
+end
+
 tilecaches = search(:node, "roles:tilecache").sort_by { |n| n[:hostname] }
+fastlyips = JSON.parse(IO.read("#{Chef::Config[:file_cache_path]}/fastly-ip-list.json"))
 
 apache_site "default" do
   action [:disable]
@@ -53,7 +60,7 @@ end
 
 apache_site "tile.openstreetmap.org" do
   template "apache.erb"
-  variables :caches => tilecaches
+  variables :caches => tilecaches, :fastly => fastlyips["addresses"]
 end
 
 template "/etc/logrotate.d/apache2" do
@@ -79,6 +86,7 @@ systemd_service "renderd" do
   exec_start "/usr/bin/renderd -f"
   runtime_directory "renderd"
   standard_error "null"
+  limit_nofile 4096
   private_tmp true
   private_devices true
   private_network true
@@ -601,3 +609,11 @@ munin_plugin "renderd_zoom"
 munin_plugin "renderd_zoom_time"
 
 munin_plugin "replication_delay"
+
+prometheus_collector "modtile" do
+  interval "1m"
+end
+
+prometheus_collector "renderd" do
+  interval "1m"
+end