File: thin-farm.eye

package info (click to toggle)
ruby-eye 0.7-5.1
  • links: PTS, VCS
  • area: main
  • in suites: bookworm
  • size: 672 kB
  • sloc: ruby: 5,003; makefile: 3
file content (30 lines) | stat: -rw-r--r-- 713 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
RUBY = 'ruby'
BUNDLE = 'bundle'

Eye.load("process_thin.rb")

Eye.config do
  logger "/tmp/eye.log"
end

Eye.app 'thin-farm' do
  working_dir File.expand_path(File.join(File.dirname(__FILE__), %w[ processes ]))
  env "RAILS_ENV" => "production"

  # more about stop_on_delete: https://github.com/kostya/eye/wiki/About-stop_on_delete-=-true
  stop_on_delete true

  trigger :flapping, :times => 10, :within => 1.minute
  check :memory, :below => 60.megabytes, :every => 30.seconds, :times => 5
  start_timeout 30.seconds

  group :web do
    chain :action => :restart, :grace => 5.seconds
    chain :action => :start, :grace => 0.2.seconds

    (5555..5560).each do |port|
      thin self, port
    end
  end

end