config.ru 759 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 8
require ::File.expand_path("../config/environment",  __FILE__)
require ::File.expand_path("../lib/rack/internet_explorer_version", __FILE__)
9

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

22
run Diaspora::Application