GItLab steht Donnerstag zwischen 12:30 und 14:30 Uhr aufgrund von Wartungsarbeiten nicht zur Verfügung.

config.ru 924 Bytes
Newer Older
gitlabhq's avatar
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'] || 400 * 1 << 20).to_i
    max = (ENV['GITLAB_UNICORN_MEMORY_MAX'] || 650 * 1 << 20).to_i
12

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

  # Monkey patch for fixing Rack 2.0.6 bug:
  # https://gitlab.com/gitlab-org/gitlab-ee/issues/8539
  Unicorn::StreamInput.send(:public, :eof?) # rubocop:disable GitlabSecurity/PublicSend
20
end
21

22
require ::File.expand_path('../config/environment', __FILE__)
23

24 25 26 27 28
warmup do |app|
  client = Rack::MockRequest.new(app)
  client.get('/')
end

29
map ENV['RAILS_RELATIVE_URL_ROOT'] || "/" do
Lin Jen-Shin's avatar
Lin Jen-Shin committed
30
  use Gitlab::Middleware::ReleaseEnv
31 32
  run Gitlab::Application
end