capistrano-generals 0.1.8 → 0.1.10

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 4f319507d8d54947688101b09464b1e48dd42500
4
- data.tar.gz: adf969db6612469cb8f2679ed160ca88b175ca71
3
+ metadata.gz: 444259204853e083167932e870acd97c4360b00f
4
+ data.tar.gz: 78e81b15e2799d8e9328853fbf2859969ba821af
5
5
  SHA512:
6
- metadata.gz: 7c0b23afa9b7f34465406cbd17411a526daa0fa058419d6ce00b8ceb0382984356bee6c6f9ae4f25baba9fb6032c3b9d9a4a423dfa8700cd55bf72110f16431b
7
- data.tar.gz: 4dd2891487c2f5fe7e4006116c59a2d18f638454b9aafb30520d1c3c83f3d79db47a1a26d649987937357431b33a0a1fe5e069557412d87e06da960a37bbdec7
6
+ metadata.gz: e37ebac2df3d7812a98a550f8699a917cbc1e214406b7171f4613dda1c2378a4434eeb869ec8527f721ef0c027a1d7d532676744d42e5c585e955abe3e012e3c
7
+ data.tar.gz: 57657a23a0a7c8c4d2a9d2d20621513c48083fb5c0ce8da6121b66a11eea9c85766c5d58f161fcb84c435e24b357f7b396dc0a88b1ad9aa4ae61f9486f47a2e0
@@ -1,5 +1,5 @@
1
1
  module Capistrano
2
2
  module Generals
3
- VERSION = "0.1.8"
3
+ VERSION = "0.1.10"
4
4
  end
5
5
  end
@@ -19,6 +19,8 @@ namespace :load do
19
19
  set :nginx_resolver, '8.8.4.4 8.8.8.8 valid=300s'
20
20
  set :nginx_resolver_timeout, '10s'
21
21
  set :nginx_custom_block, ''
22
+ set :nginx_max_body_size, '4G'
23
+ set :nginx_keep_alive_timeout, '10'
22
24
 
23
25
  # Nginx ssl settings
24
26
  set :nginx_use_ssl, false
@@ -28,7 +30,8 @@ namespace :load do
28
30
  set :nginx_ssl_session_cache, 'shared:SSL:10m'
29
31
 
30
32
  # Nginx caching settings
31
- set :cache_static_files, true
33
+ set :cache_all_static_files, false
34
+ set :cache_assets_folder, true
32
35
  set :cache_custom, ''
33
36
  set :cache_custom_expire, 'max'
34
37
 
@@ -68,6 +71,12 @@ namespace :load do
68
71
  set :puma_env, ''
69
72
  set :puma_app_env, -> { fetch(:rails_env) || fetch(:rack_env) || fetch(:stage) }
70
73
 
74
+ # Puma Worker Killer settings
75
+ set :puma_worker_killer_ram, 512 # mb
76
+ set :puma_worker_killer_frequency, 10 #seconds
77
+ set :puma_worker_killer_percent_usage, 0.99 # percent of RAM to use
78
+ set :puma_worker_killer_rolling_restart_frequency, 6*3600 # 6 hours in seconds
79
+
71
80
  # General Sidekiq settings
72
81
  set :sidekiq_workers, 3
73
82
  set :sidekiq_user, -> { fetch(:deploy_user) }
@@ -41,8 +41,8 @@ server {
41
41
 
42
42
  <%= fetch(:nginx_custom_block) %>
43
43
 
44
- client_max_body_size 4G;
45
- keepalive_timeout 10;
44
+ client_max_body_size <%= fetch(:nginx_max_body_size) %>;
45
+ keepalive_timeout <%= fetch(:nginx_keep_alive_timeout) %>;
46
46
 
47
47
  error_page 500 502 504 /500.html;
48
48
 
@@ -117,13 +117,20 @@ server {
117
117
  }
118
118
  <% end %>
119
119
 
120
- <% if fetch(:cache_static_files) %>
120
+ <% if fetch(:cache_all_static_files) %>
121
121
  location ~* \.(?:jpg|jpeg|gif|png|ico|cur|gz|svg|svgz|mp4|ogg|ogv|webm|htc|css|js)$ {
122
122
  expires max;
123
123
  add_header Cache-Control public;
124
124
  }
125
125
  <% end %>
126
126
 
127
+ <% if fetch(:cache_assets_folder) %>
128
+ location ~* ^/assets/ {
129
+ expires max;
130
+ add_header Cache-Control public;
131
+ }
132
+ <% end %>
133
+
127
134
  <% if fetch(:cache_custom).length > 0 %>
128
135
  location <%= fetch(:cache_custom) %> {
129
136
  expires <%= fetch(:cache_custom_expire) %>;
@@ -22,3 +22,15 @@ on_worker_boot do
22
22
  end
23
23
  end
24
24
  end
25
+
26
+ before_fork do
27
+ if defined? PumaWorkerKiller
28
+ PumaWorkerKiller.config do |config|
29
+ config.ram = <%= fetch(:puma_worker_killer_ram) %>
30
+ config.frequency = <%= fetch(:puma_worker_killer_frequency) %>
31
+ config.percent_usage = <%= fetch(:puma_worker_killer_percent_usage) %>
32
+ config.rolling_restart_frequency = <%= fetch(:puma_worker_killer_rolling_restart_frequency) %>
33
+ end
34
+ PumaWorkerKiller.start
35
+ end
36
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: capistrano-generals
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.10
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stef Schenkelaars
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-23 00:00:00.000000000 Z
11
+ date: 2016-04-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: capistrano
@@ -113,7 +113,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
113
113
  version: '0'
114
114
  requirements: []
115
115
  rubyforge_project:
116
- rubygems_version: 2.4.8
116
+ rubygems_version: 2.5.1
117
117
  signing_key:
118
118
  specification_version: 4
119
119
  summary: Some general capistrano tasks which are commonly used