projects
/
chef.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (from parent 1:
628e99e
)
Correct idle time test
author
Tom Hughes
<tom@compton.nu>
Thu, 16 Apr 2015 13:57:11 +0000
(14:57 +0100)
committer
Tom Hughes
<tom@compton.nu>
Thu, 16 Apr 2015 13:57:11 +0000
(14:57 +0100)
cookbooks/tile/templates/default/export.erb
patch
|
blob
|
history
diff --git
a/cookbooks/tile/templates/default/export.erb
b/cookbooks/tile/templates/default/export.erb
index 921361563cc56201f9ba68cabc0850670720858c..97aa161f66a06596ceed18dfdc45fd5892add5eb 100644
(file)
--- 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
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.")
# 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.")