diff options
author | Ben Kochie <bjk@gitlab.com> | 2017-09-11 20:06:47 +0200 |
---|---|---|
committer | Ben Kochie <bjk@gitlab.com> | 2017-09-11 20:06:47 +0200 |
commit | dd105a917a4df2670fea6743168ab813bc34cd02 (patch) | |
tree | 6eaef9bc5a2eebf97b853546b2c561131e646047 | |
parent | ce14fae5d43247a838debeb5dda7871845d127c8 (diff) | |
download | gitlab-ce-dd105a917a4df2670fea6743168ab813bc34cd02.tar.gz |
Add unicorn-soft-timeoutbjk/unicorn-soft-timeout
* Add the `unicorn-soft-timeout` gem to `SIGQUIT` rather than `SIGKILL` on timeout.
* Configure to 55 seconds by default (60 seconds is default for `SIGKILL`).
-rw-r--r-- | Gemfile | 1 | ||||
-rw-r--r-- | config.ru | 4 |
2 files changed, 5 insertions, 0 deletions
@@ -137,6 +137,7 @@ gem 'diffy', '~> 3.1.0' group :unicorn do gem 'unicorn', '~> 5.1.0' gem 'unicorn-worker-killer', '~> 0.4.4' + gem 'unicorn-soft-timeout', '~> 0.2.0' end # State machine diff --git a/config.ru b/config.ru index 065ce59932f..e0b21ac66e8 100644 --- a/config.ru +++ b/config.ru @@ -2,6 +2,7 @@ if defined?(Unicorn) require 'unicorn' + require 'unicorn/soft_timeout' if ENV['RAILS_ENV'] == 'production' || ENV['RAILS_ENV'] == 'staging' # Unicorn self-process killer @@ -12,6 +13,9 @@ if defined?(Unicorn) # Max memory size (RSS) per worker use Unicorn::WorkerKiller::Oom, min, max + + soft_timeout = (ENV['GITLAB_UNICORN_SOFT_TIMEOUT'] || 55).to_i + use Unicorn::SoftTimeout soft_timeout end end |