config.ru 600 Bytes
Newer Older
Benjamin Neff's avatar
Benjamin Neff committed
1
#   Copyright (c) 2010-2011, Diaspora Inc.  This file is
Raphael's avatar
Raphael committed
2
#   licensed under the Affero General Public License version 3 or later.  See
Raphael's avatar
Raphael committed
3
#   the COPYRIGHT file.
4

5 6
# This file is used by Rack-based servers to start the application.

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

Benjamin Neff's avatar
Benjamin Neff committed
9
# Kill unicorn workers really aggressively (at 300mb)
10
if defined?(Unicorn)
11 12 13 14 15
  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
16
end
17
use Rack::Deflater
David McMullin's avatar
David McMullin committed
18

19
run Diaspora::Application