imagery: limit mapserv by CPU time
authorGrant Slater <git@firefishy.com>
Fri, 21 Dec 2018 12:53:24 +0000 (12:53 +0000)
committerGrant Slater <git@firefishy.com>
Fri, 21 Dec 2018 12:53:27 +0000 (12:53 +0000)
Use CPU time as a poor mans process limit, to kill process before it has leaked
too much memory. Memory limits do not seem to kill the process.

cookbooks/imagery/resources/site.rb

index 16e48d3..86c70c3 100644 (file)
@@ -106,8 +106,8 @@ action :create do
                   "MS_ERRORFILE" => "stderr",
                   "GDAL_CACHEMAX" => "512"
       limit_nofile 16384
-      limit_as "1G"
-      memory_max "2G"
+      limit_cpu: 60
+      memory_max "4G"
       user "imagery"
       group "imagery"
       exec_start_pre "/bin/rm -f /run/mapserver-fastcgi/layer-#{new_resource.site}-#{index}.socket"