From: Tom Hughes Date: Thu, 16 Apr 2015 13:57:11 +0000 (+0100) Subject: Correct idle time test X-Git-Url: https://git.openstreetmap.org/chef.git/commitdiff_plain/372c2f7170e0ba1fdeb35c019b86d425fe1629b7?hp=628e99e76f4f27bcb06684de9650b55267c95d69;ds=sidebyside Correct idle time test --- diff --git a/cookbooks/tile/templates/default/export.erb b/cookbooks/tile/templates/default/export.erb index 921361563..97aa161f6 100644 --- a/cookbooks/tile/templates/default/export.erb +++ b/cookbooks/tile/templates/default/export.erb @@ -61,7 +61,7 @@ cputimes = [float(n) for n in open("/proc/stat").readline().rstrip().split()[1:- idletime = cputimes[3] / sum(cputimes) # Process the request -if idletime < 20: +if idletime < 0.2: # Abort if the CPU idle time on the machine is too low print "Status: 503 Service Unavailable" output_error("The server is too busy at the moment. Please wait a few minutes before trying again.")