Commit 8fb9dccd3b6df116c5b449e21a3e24b1114e9bf6
Exists in
master
and in
4 other branches
Merge branch 'unicorn_worker_killer' of /home/git/repositories/gitlab/gitlabhq
Showing
3 changed files
with
13 additions
and
1 deletions
Show diff stats
Gemfile
| ... | ... | @@ -85,7 +85,10 @@ gem "github-markup", "~> 0.7.4", require: 'github/markup' |
| 85 | 85 | gem "asciidoctor" |
| 86 | 86 | |
| 87 | 87 | # Application server |
| 88 | -gem "unicorn", '~> 4.6.3', group: :unicorn | |
| 88 | +group :unicorn do | |
| 89 | + gem "unicorn", '~> 4.6.3' | |
| 90 | + gem 'unicorn-worker-killer' | |
| 91 | +end | |
| 89 | 92 | |
| 90 | 93 | # State machine |
| 91 | 94 | gem "state_machine" | ... | ... |
Gemfile.lock
| ... | ... | @@ -539,6 +539,8 @@ GEM |
| 539 | 539 | kgio (~> 2.6) |
| 540 | 540 | rack |
| 541 | 541 | raindrops (~> 0.7) |
| 542 | + unicorn-worker-killer (0.4.2) | |
| 543 | + unicorn (~> 4) | |
| 542 | 544 | virtus (1.0.1) |
| 543 | 545 | axiom-types (~> 0.0.5) |
| 544 | 546 | coercible (~> 1.0) |
| ... | ... | @@ -660,4 +662,5 @@ DEPENDENCIES |
| 660 | 662 | uglifier |
| 661 | 663 | underscore-rails (~> 1.4.4) |
| 662 | 664 | unicorn (~> 4.6.3) |
| 665 | + unicorn-worker-killer | |
| 663 | 666 | webmock | ... | ... |
config.ru
| 1 | 1 | # This file is used by Rack-based servers to start the application. |
| 2 | 2 | |
| 3 | +# Unicorn self-process killer | |
| 4 | +require 'unicorn/worker_killer' | |
| 5 | + | |
| 6 | +# # Max memory size (RSS) per worker | |
| 7 | +use Unicorn::WorkerKiller::Oom, (200 * (1 << 20)), (250 * (1 << 20)) | |
| 8 | + | |
| 3 | 9 | require ::File.expand_path('../config/environment', __FILE__) |
| 4 | 10 | |
| 5 | 11 | map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do | ... | ... |