config.ru 631 Bytes
Newer Older
1 2
# frozen_string_literal: true

Benjamin Neff's avatar
Benjamin Neff committed
3
#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
Raphael's avatar
Raphael committed
4
#   licensed under the Affero General Public License version 3 or later.  See
Raphael's avatar
Raphael committed
5
#   the COPYRIGHT file.
6

7 8
# This file is used by Rack-based servers to start the application.

Benjamin Neff's avatar
Benjamin Neff committed
9
require ::File.expand_path("../config/environment",  __FILE__)
10

Benjamin Neff's avatar
Benjamin Neff committed
11
# Kill unicorn workers really aggressively (at 300mb)
12
if defined?(Unicorn)
13 14 15 16 17
  require "unicorn/worker_killer"
  oom_min = (280) * (1024**2)
  oom_max = (300) * (1024**2)
  # Max memory size (RSS) per worker
  use Unicorn::WorkerKiller::Oom, oom_min, oom_max
18
end
19
use Rack::Deflater
David McMullin's avatar
David McMullin committed
20

21
run Diaspora::Application