Created
December 17, 2008 19:25
-
-
Save slumos/37178 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#restart if memory or cpu is too high | |
w.transition(:up, :restart) do |on| | |
if type == :mongrel then | |
on.condition(:memory_usage) do |c| | |
c.above = 250.megabytes | |
c.times = [9,10] | |
end | |
on.condition(:memory_usage) do |c| | |
c.above = 300.megabytes | |
end | |
else | |
on.condition(:memory_usage) do |c| | |
c.above = 400.megabytes | |
c.times = [9, 10] | |
end | |
end | |
on.condition(:cpu_usage) do |c| | |
c.interval = 30 | |
c.above = 50.percent | |
c.times = 10 | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment