Sha256: 4f2d8d9926aea46a267ce99485e44e7de9b9d8a181aef3566d265d99ac35b4cf

Contents?: true

Size: 1.22 KB

Versions: 1

Compression:

Stored size: 1.22 KB

Contents

# Monit configuration for THIN :  <%= fetch(:application) %>  (<%= fetch(:stage) %>)
<%  fetch(:app_instances, 1).times do |n| %>
  check process <%= fetch(:application) %>_<%= fetch(:stage) %>_thin_<%= n %> with pidfile <%= deploy_to %>/shared/pids/thin_<%= fetch(:application) %>_<%= fetch(:stage) %>.<%= n %>.pid
    group thin-<%= fetch(:application) %>-<%= fetch(:stage) %>
    start program = "<%=   monit_app_prefixed("thin start -C config/thin_app_#{ fetch(:stage) }.yml -o #{ n }")    %>"
    stop program = "<%=    monit_app_prefixed("thin stop -C config/thin_app_#{ fetch(:stage) }.yml -o #{ n }")     %>"
    if does not exist for 3 cycles then start # (default)
    if does not exist for 3 cycles then <%= monit_alert %>
    if 3 restarts within 5 cycles then <%= monit_alert %>
    if mem > <%= ( fetch( :monit_thin_totalmem_mb, 300 ).to_i * 0.75 ).to_i %> MB then <%= monit_alert %>
    if mem > <%= fetch( :monit_thin_totalmem_mb, 300 ) %> MB for 2 cycles then restart
    if cpu > 50% then <%= monit_alert %>
    if cpu > 50% for 3 cycles then restart
    if 5 restarts within 5 cycles then timeout
    # alert <%= fetch(:monit_mail_to) %> only on { pid }
    if changed pid 2 times within 20 cycles then <%= monit_alert %>
<% end %>

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
magic_recipes_two-0.0.95 lib/generators/capistrano/magic_recipes/templates/monit/thin_sysd.erb