BigW Consortium Gitlab

config.ru 622 Bytes
Newer Older
gitlabhq committed
1 2
# This file is used by Rack-based servers to start the application.

3
if defined?(Unicorn)
4
  require 'unicorn'
5

6 7 8 9
  if ENV['RAILS_ENV'] == 'production' || ENV['RAILS_ENV'] == 'staging'
    # Unicorn self-process killer
    require 'unicorn/worker_killer'

10 11
    min = (ENV['GITLAB_UNICORN_MEMORY_MIN'] || 300 * 1 << 20).to_i
    max = (ENV['GITLAB_UNICORN_MEMORY_MAX'] || 350 * 1 << 20).to_i
12

13
    # Max memory size (RSS) per worker
14
    use Unicorn::WorkerKiller::Oom, min, max
15
  end
16
end
17

gitlabhq committed
18
require ::File.expand_path('../config/environment',  __FILE__)
19 20 21 22

map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do
  run Gitlab::Application
end