forked from ForSetGeorgia/Georgian-Election-Data
-
Notifications
You must be signed in to change notification settings - Fork 0
/
config.ru
29 lines (19 loc) · 895 Bytes
/
config.ru
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# This file is used by Rack-based servers to start the application.
# --- Start of unicorn worker killer code ---
if ENV['RAILS_ENV'] == 'production'
require 'unicorn/worker_killer'
# if ENV variables do not exist, give a defualt value
request_min = Integer(ENV['UNICORN_REQUEST_MIN'] || 200)
request_max = Integer(ENV['UNICORN_REQUEST_MAX'] || 300)
memory_min = Integer(ENV['UNICORN_MEMORY_MIN'] || 250)
memory_max = Integer(ENV['UNICORN_MEMORY_MIN'] || 300)
# Max requests per worker
use Unicorn::WorkerKiller::MaxRequests, request_min, request_max, true
# Max memory size (RSS) per worker
oom_min = (memory_min) * (1024**2)
oom_max = (memory_max) * (1024**2)
use Unicorn::WorkerKiller::Oom, oom_min, oom_max, 16, true
end
# --- End of unicorn worker killer code ---
require ::File.expand_path('../config/environment', __FILE__)
run ElectionMap::Application