magic_recipes_two 0.0.74 → 0.0.75
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
OTE5YTljNzFlNTM1ZjBmY2VjOGQyMmYyNmMxMmExZmE1MDdhNjBmZg==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
YmFhMDM4NThhMTEyNTgwY2FmMDkyYjA5MDFlNDM0YjczYWYxZTQxZg==
|
7
7
|
SHA512:
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
OWFjMGVkOTBiZWEyYmM1NmY3MmMzNTYyYzIxOGY2NzEzOGQyZDQyYjI1NWU5
|
10
|
+
YjY1Mzk5Yjk5ODMyN2YwMzQ1ZDhiNDMzNGEzMjg2NjExZjM2M2YxZWI5ZjUz
|
11
|
+
OGJmYzg4MDEyZjU2OWYzMTljMTI5Nzk5MDgyMDViYjg0MmJkMWY=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
ZTE3NDI1YTEyZWFjYjJlYzgxNDMyNDU5NGE0M2ZhNjQzZWEzMTkzM2E5ZTRl
|
14
|
+
MzA3OTMzNzgxZDQ2MGFiNGFmZjk1NzQ2YTViMzdiMmZjZDA3MzEzOTdjZDhk
|
15
|
+
YjYwNzYwNzczMzIzNjk4NGEwZWJkMTUzYThmM2Y0Nzc5ZWE0NDc=
|
@@ -28,12 +28,12 @@ namespace :load do
|
|
28
28
|
set :postgresql_roles, -> { :db }
|
29
29
|
set :postgresql_pid, -> { "/var/run/postgresql/9.1-main.pid" }
|
30
30
|
## Additional stuff for thin (need secrets_key_base to be set)
|
31
|
-
set :monit_thin_with_secret, -> { false }
|
32
31
|
set :monit_thin_totalmem_mb, -> { 300 }
|
33
32
|
## Additional stuff for sidekiq (need secrets_key_base to be set)
|
34
|
-
set :monit_sidekiq_with_secret, -> { false }
|
35
33
|
set :monit_sidekiq_totalmem_mb, -> { 300 }
|
36
34
|
set :monit_sidekiq_timeout_sec, -> { 90 }
|
35
|
+
## Additional App helpers
|
36
|
+
set :monit_app_worker_command, -> { "cd #{ current_path } ; #{fetch(:rvm_path)}/bin/rvm #{fetch(:rvm_ruby_version)} do bundle exec MONIT_CMD" }
|
37
37
|
## WebClient
|
38
38
|
set :monit_http_client, -> { true }
|
39
39
|
set :monit_http_domain, -> { false }
|
@@ -168,6 +168,10 @@ def monit_config( name, destination = nil, role = nil )
|
|
168
168
|
execute :sudo, "chmod 600 #{destination}"
|
169
169
|
end
|
170
170
|
|
171
|
+
def monit_app_prefixed( cmd )
|
172
|
+
fetch(:monit_app_worker_command, "cd #{ current_path } ; bundle exec MONIT_CMD").to_s.gsub(/MONIT_CMD/, cmd)
|
173
|
+
end
|
174
|
+
|
171
175
|
|
172
176
|
namespace :deploy do
|
173
177
|
before :starting, :stop_monitoring do
|
@@ -27,16 +27,16 @@
|
|
27
27
|
%>
|
28
28
|
check process <%= sidekiq_service_name(idx) %>
|
29
29
|
with pidfile "<%= pid_file %>"
|
30
|
-
start program =
|
31
|
-
stop program = "
|
30
|
+
start program = <%= monit_app_prefixed("sidekiq #{ args.join(" ") }") %> with timeout <%= fetch(:monit_sidekiq_timeout_sec, 90) %> seconds
|
31
|
+
stop program = <%= monit_app_prefixed("sidekiqctl stop #{ pid_file }") %> with timeout <%= fetch(:monit_sidekiq_timeout_sec, 90) %> seconds
|
32
32
|
group sidekiq-<%= fetch(:sidekiq_monit_group, fetch(:application)) %>-<%= fetch(:stage) %>
|
33
33
|
# if does not exist then start # (default)
|
34
|
-
# if does not exist for 3 cycles then alert
|
35
|
-
if 3 restarts within 5 cycles then alert
|
36
34
|
if totalmem > <%= ( fetch( :monit_sidekiq_totalmem_mb, 300 ).to_i * 0.75 ).to_i %> MB then alert
|
37
35
|
if totalmem > <%= fetch( :monit_sidekiq_totalmem_mb, 300 ) %> MB for 2 cycles then restart
|
38
|
-
if
|
36
|
+
# if does not exist for 3 cycles then alert
|
39
37
|
# alert <%= fetch(:monit_mail_to) %> only on { pid }
|
38
|
+
if 3 restarts within 5 cycles then alert
|
39
|
+
if 3 restarts within 5 cycles then timeout
|
40
40
|
if 2 restarts within 3 cycles then alert
|
41
41
|
if changed pid 2 times within 10 cycles then alert
|
42
42
|
<% end %>
|
@@ -2,8 +2,8 @@
|
|
2
2
|
<% fetch(:app_instances, 1).times do |n| %>
|
3
3
|
check process <%= fetch(:application) %>_<%= fetch(:stage) %>_thin_<%= n %> with pidfile <%= deploy_to %>/shared/pids/thin_<%= fetch(:application) %>_<%= fetch(:stage) %>.<%= n %>.pid
|
4
4
|
group thin-<%= fetch(:application) %>-<%= fetch(:stage) %>
|
5
|
-
start program =
|
6
|
-
stop program = "
|
5
|
+
start program = <%= monit_app_prefixed("thin start -C config/thin_app_#{ fetch(:stage) }.yml -o #{ n }") %>
|
6
|
+
stop program = <%= monit_app_prefixed("thin stop -C config/thin_app_#{ fetch(:stage) }.yml -o #{ n }") %>
|
7
7
|
# if does not exist then start # (default)
|
8
8
|
# if does not exist for 3 cycles then alert
|
9
9
|
if 3 restarts within 5 cycles then alert
|