summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-19 07:30:42 +0000
committerDmitriy Zaporozhets <dmitriy.zaporozhets@gmail.com>2013-12-19 07:30:42 +0000
commit8fb9dccd3b6df116c5b449e21a3e24b1114e9bf6 (patch)
treeaff8fff957f41a061d06a3ab910f2bd36a2ba48f
parent566b49624a230728a3a873ee1937f4b8d30ff8f5 (diff)
parent5e93494db2c3980055dee36412da34dd315713aa (diff)
downloadgitlab-ce-8fb9dccd3b6df116c5b449e21a3e24b1114e9bf6.tar.gz
Merge branch 'unicorn_worker_killer' of /home/git/repositories/gitlab/gitlabhq
-rw-r--r--Gemfile5
-rw-r--r--Gemfile.lock3
-rw-r--r--config.ru6
3 files changed, 13 insertions, 1 deletions
diff --git a/Gemfile b/Gemfile
index c3c90dd8c05..2019cae8f96 100644
--- a/Gemfile
+++ b/Gemfile
@@ -85,7 +85,10 @@ gem "github-markup", "~> 0.7.4", require: 'github/markup'
gem "asciidoctor"
# Application server
-gem "unicorn", '~> 4.6.3', group: :unicorn
+group :unicorn do
+ gem "unicorn", '~> 4.6.3'
+ gem 'unicorn-worker-killer'
+end
# State machine
gem "state_machine"
diff --git a/Gemfile.lock b/Gemfile.lock
index 6142d6ef8cf..8aad7c8c424 100644
--- a/Gemfile.lock
+++ b/Gemfile.lock
@@ -539,6 +539,8 @@ GEM
kgio (~> 2.6)
rack
raindrops (~> 0.7)
+ unicorn-worker-killer (0.4.2)
+ unicorn (~> 4)
virtus (1.0.1)
axiom-types (~> 0.0.5)
coercible (~> 1.0)
@@ -660,4 +662,5 @@ DEPENDENCIES
uglifier
underscore-rails (~> 1.4.4)
unicorn (~> 4.6.3)
+ unicorn-worker-killer
webmock
diff --git a/config.ru b/config.ru
index dfd2d862237..1edcd391e45 100644
--- a/config.ru
+++ b/config.ru
@@ -1,5 +1,11 @@
# This file is used by Rack-based servers to start the application.
+# Unicorn self-process killer
+require 'unicorn/worker_killer'
+
+# # Max memory size (RSS) per worker
+use Unicorn::WorkerKiller::Oom, (200 * (1 << 20)), (250 * (1 << 20))
+
require ::File.expand_path('../config/environment', __FILE__)
map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do