Sha256: dbbfe09417dcb2ea6430692e2f8b7af316eb4368f027d79c595d4d5858b75b18

Contents?: true

Size: 629 Bytes

Versions: 1

Compression:

Stored size: 629 Bytes

Contents

God.watch do |w|
  w.name = "nginx"
  w.group = 'web'

  w.start = "/etc/init.d/nginx start"
  w.stop = "/etc/init.d/nginx stop"
  w.restart = "/etc/init.d/nginx restart"
  w.pid_file = "/var/run/nginx.pid"  
  w.autostart = false

  default_configurations(w)

  restart_if_resource_hog(w, :memory_usage => 250.megabytes) do |restart|
    restart.condition(:http_response_code) do |c|
      c.host = '127.0.0.1'
      c.port = in_role?(:proxy) ? 81 : 80
      c.path = '/nginx_status'
      c.code_is_not = 200
      c.timeout = 5.seconds
      c.times = [3, 5] # 3 out of 5 intervals
    end
  end
  
  monitor_lifecycle(w)
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
pauldowman-ec2onrails-0.9.10.1 server/files/etc/god/web.god