Skip to content

Commit

Permalink
[zomekiv3-sqr:00410] Add unicorn-worker-killer
Browse files Browse the repository at this point in the history
  • Loading branch information
kanety committed Jan 17, 2017
1 parent 8bcd362 commit 5d92222
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions Gemfile
Expand Up @@ -9,6 +9,7 @@ gem 'pg', '~> 0.15'
#gem 'puma', '~> 3.0'
# Use Unicorn as the app server
gem 'unicorn'
gem 'unicorn-worker-killer', '~> 0.4.4'
# Use SCSS for stylesheets
gem 'sass-rails', '~> 5.0'
# Use Uglifier as compressor for JavaScript assets
Expand Down
5 changes: 5 additions & 0 deletions Gemfile.lock
Expand Up @@ -93,6 +93,7 @@ GEM
garb (0.9.8)
activesupport (>= 2.2)
multi_json (>= 1.3)
get_process_mem (0.2.1)
globalid (0.3.7)
activesupport (>= 4.1.0)
google-oauth2-installed (0.0.3)
Expand Down Expand Up @@ -303,6 +304,9 @@ GEM
unicorn (5.1.0)
kgio (~> 2.6)
raindrops (~> 0.7)
unicorn-worker-killer (0.4.4)
get_process_mem (~> 0)
unicorn (>= 4, < 6)
uniform_notifier (1.10.0)
web-console (2.3.0)
activemodel (>= 4.0)
Expand Down Expand Up @@ -368,6 +372,7 @@ DEPENDENCIES
tzinfo-data
uglifier (>= 1.3.0)
unicorn
unicorn-worker-killer (~> 0.4.4)
web-console (~> 2.0)
whenever
will_paginate (~> 3.1.3)
Expand Down
7 changes: 7 additions & 0 deletions config.ru
@@ -1,4 +1,11 @@
# This file is used by Rack-based servers to start the application.

# Unicorn self-process killer
require 'unicorn/worker_killer'
# Max requests per worker
use Unicorn::WorkerKiller::MaxRequests, 3072, 4096
# Max memory size (RSS) per worker
use Unicorn::WorkerKiller::Oom, (256*(1024**2)), (384*(1024**2))

require ::File.expand_path('../config/environment', __FILE__)
run ZomekiCMS::Application

0 comments on commit 5d92222

Please sign in to comment.