From: Tom Hughes Date: Sat, 14 Mar 2015 15:29:46 +0000 (+0000) Subject: Switch to generating munin graphs on demand X-Git-Url: https://git.openstreetmap.org./chef.git/commitdiff_plain/18d192a0b455a06baa03b76f87f4e97cad6c1a3f?ds=sidebyside Switch to generating munin graphs on demand --- diff --git a/cookbooks/munin/recipes/server.rb b/cookbooks/munin/recipes/server.rb index 3e72ea160..84c739e49 100644 --- a/cookbooks/munin/recipes/server.rb +++ b/cookbooks/munin/recipes/server.rb @@ -21,6 +21,7 @@ include_recipe "apache" package "munin" package "rrdcached" +package "libcgi-fast-perl" template "/etc/default/rrdcached" do source "rrdcached.erb" @@ -62,6 +63,9 @@ template "/etc/munin/munin.conf" do variables :expiry_time => expiry_time, :clients => clients, :frontends => frontends, :backends => backends, :tilecaches => tilecaches, :renderers => renderers end +apache_module "fcgid" +apache_module "rewrite" + apache_site "munin.openstreetmap.org" do template "apache.erb" end diff --git a/cookbooks/munin/templates/default/apache.erb b/cookbooks/munin/templates/default/apache.erb index 59598acab..aaf8b5c90 100644 --- a/cookbooks/munin/templates/default/apache.erb +++ b/cookbooks/munin/templates/default/apache.erb @@ -9,8 +9,18 @@ ErrorLog /var/log/apache2/munin.openstreetmap.org-error.log DocumentRoot /var/cache/munin/www + ScriptAlias /munin-cgi/ /usr/lib/munin/cgi/ + + RewriteEngine on + RewriteRule ^(/.*\.html)?$ /munin-cgi/munin-cgi-html/$1 [PT] Require all granted + + + Options +ExecCGI + SetHandler fcgid-script + Require all granted + diff --git a/cookbooks/munin/templates/default/munin.conf.erb b/cookbooks/munin/templates/default/munin.conf.erb index 71484c237..c560717a0 100644 --- a/cookbooks/munin/templates/default/munin.conf.erb +++ b/cookbooks/munin/templates/default/munin.conf.erb @@ -3,6 +3,14 @@ # Set maximum number of update processes to run at once max_processes 64 +# Maximum number of graphs to generate at once +max_graph_jobs 24 +max_cgi_graph_jobs 24 + +# Render pages and graphs on demand +html_strategy cgi +graph_strategy cgi + # Use rrdcached rrdcached_socket /var/run/rrdcached.sock