Sha256: d1b9b98e26f02acb77ff4b5f83ef2e2d47f19a2718c6d744d0131b44c5af54d8

Contents?: true

Size: 1.22 KB

Versions: 2

Compression:

Stored size: 1.22 KB

Contents

<% application = fetch(:application) %>
set mail-format { subject: <%= "#{fetch(:full_app_name)} - #{fetch(:rails_env)}" %> $SERVICE $EVENT at $DATE }

check process unicorn_<%=application%>
  with pidfile <%= current_path %>/tmp/pids/unicorn.pid
  start program = "/etc/init.d/unicorn_<%= application %>_<%= fetch(:rails_env)%> start"
  stop program = "/etc/init.d/unicorn_<%= application %>_<%= fetch(:rails_env)%> stop"
  if mem is greater than 300.0 MB for 1 cycles then restart       # eating up memory?
  if cpu is greater than 50% for 2 cycles then alert                  # send an email to admin
  if cpu is greater than 80% for 30 cycles then restart                # hung process?
  group unicorn

<% (0..(fetch(:unicorn_worker_count) -1)).each do |worker| %>
  check process unicorn_<%= application %>_worker_<%= (5000 + worker).to_s %>
    with pidfile <%= current_path %>/tmp/pids/unicorn.<%= (5000 + worker).to_s %>.pid
    start program = "/bin/true"
    stop program = "/etc/init.d/unicorn_<%= application %>_<%= fetch(:rails_env)%> kill_worker <%= (5000 + worker).to_s %>"
    if mem is greater than 350.0 MB for 1 cycles then restart
    if cpu is greater than 80% for 30 cycles then restart

    group unicorn_workers
<% end %>

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
capistrano-cookbook-0.2.1 lib/capistrano/cookbook/templates/monit.erb
capistrano-cookbook-0.2.0 lib/capistrano/cookbook/templates/monit.erb