]> git.openstreetmap.org Git - chef.git/commitdiff
put nominatim's php-fpm config under chef control
authorSarah Hoffmann <lonvia@denofr.de>
Mon, 1 Jul 2013 17:43:53 +0000 (19:43 +0200)
committerSarah Hoffmann <lonvia@denofr.de>
Mon, 1 Jul 2013 17:43:53 +0000 (19:43 +0200)
cookbooks/nominatim/recipes/default.rb
cookbooks/nominatim/templates/default/fpm.conf.erb [new file with mode: 0644]

index d15f3284f1a92bfe9917a5e38c55602336164b83..0d653c6381a37f99ba1ff20b8d8e1dd823b8f310 100644 (file)
@@ -39,6 +39,24 @@ apache_site "nominatim.openstreetmap.org" do
   directory "/home/lonvia/nominatim"
 end
 
+template "/etc/php5/fpm/pool.d/www.conf" do
+  source "fpm.conf.erb"
+  owner "root"
+  group "root"
+  mode 0644
+  variables :name => "www", :pm => "dynamic", :max_children => "50"
+  notifies :reload, resources(:service => "php5-fpm")
+end
+
+template "/etc/php5/fpm/pool.d/bulk.conf" do
+  source "fpm.conf.erb"
+  owner "root"
+  group "root"
+  mode 0644
+  variables :name => "bulk", :pm => "static", :max_children => "7"
+  notifies :reload, resources(:service => "php5-fpm")
+end
+
 postgresql_user "tomh" do
   cluster "9.1/main"
   superuser true
diff --git a/cookbooks/nominatim/templates/default/fpm.conf.erb b/cookbooks/nominatim/templates/default/fpm.conf.erb
new file mode 100644 (file)
index 0000000..78b1c01
--- /dev/null
@@ -0,0 +1,16 @@
+; DO NOT EDIT - This file is being maintained by Chef
+
+[<%= @name %>]
+listen = /var/run/php5-fpm-<%= @name %>.sock
+
+user = www-data
+group = www-data
+
+pm = <%= @pm %>
+pm.max_children = <%= @max_children %>
+pm.start_servers = 20
+pm.min_spare_servers = 20
+pm.max_spare_servers = 30
+pm.max_requests = 1000000
+
+security.limit_extensions = .php .phpx .phpj