Commit 3ba36df6c461bccd9f4426bc68f1678a57efe2e4
1 parent
624ba477
Exists in
master
and in
4 other branches
remove unicorn config since we use puma now
Showing
1 changed file
with
0 additions
and
68 deletions
Show diff stats
config/unicorn.rb.example
... | ... | @@ -1,68 +0,0 @@ |
1 | -# uncomment and customize to run in non-root path | |
2 | -# note that config/gitlab.yml web path should also be changed | |
3 | -# ENV['RAILS_RELATIVE_URL_ROOT'] = "/gitlab" | |
4 | - | |
5 | -app_dir = File.expand_path '../../', __FILE__ | |
6 | -worker_processes 2 | |
7 | -working_directory app_dir | |
8 | - | |
9 | -# Load app into the master before forking workers for super-fast | |
10 | -# worker spawn times | |
11 | -preload_app true | |
12 | - | |
13 | -# nuke workers after 30 seconds (60 is the default) | |
14 | -timeout 30 | |
15 | - | |
16 | -# listen on a Unix domain socket and/or a TCP port, | |
17 | - | |
18 | -#listen 8080 # listen to port 8080 on all TCP interfaces | |
19 | -#listen "127.0.0.1:8080" # listen to port 8080 on the loopback interface | |
20 | -listen "#{app_dir}/tmp/sockets/gitlab.socket" | |
21 | - | |
22 | -pid "#{app_dir}/tmp/pids/unicorn.pid" | |
23 | -stderr_path "#{app_dir}/log/unicorn.stderr.log" | |
24 | -stdout_path "#{app_dir}/log/unicorn.stdout.log" | |
25 | - | |
26 | -# http://www.rubyenterpriseedition.com/faq.html#adapt_apps_for_cow | |
27 | -if GC.respond_to?(:copy_on_write_friendly=) | |
28 | - GC.copy_on_write_friendly = true | |
29 | -end | |
30 | - | |
31 | - | |
32 | -before_fork do |server, worker| | |
33 | - # the following is highly recommended for Rails + "preload_app true" | |
34 | - # as there's no need for the master process to hold a connection | |
35 | - defined?(ActiveRecord::Base) and ActiveRecord::Base.connection.disconnect! | |
36 | - | |
37 | - ## | |
38 | - # When sent a USR2, Unicorn will suffix its pidfile with .oldbin and | |
39 | - # immediately start loading up a new version of itself (loaded with a new | |
40 | - # version of our app). When this new Unicorn is completely loaded | |
41 | - # it will begin spawning workers. The first worker spawned will check to | |
42 | - # see if an .oldbin pidfile exists. If so, this means we've just booted up | |
43 | - # a new Unicorn and need to tell the old one that it can now die. To do so | |
44 | - # we send it a QUIT. | |
45 | - # | |
46 | - # Using this method we get 0 downtime deploys. | |
47 | - | |
48 | - old_pid = "#{server.config[:pid]}.oldbin" | |
49 | - | |
50 | - if File.exists?(old_pid) && server.pid != old_pid | |
51 | - begin | |
52 | - sig = (worker.nr + 1) >= server.worker_processes ? :QUIT : :TTOU | |
53 | - Process.kill(sig, File.read(old_pid).to_i) | |
54 | - rescue Errno::ENOENT, Errno::ESRCH | |
55 | - # someone else did our job for us | |
56 | - end | |
57 | - end | |
58 | -end | |
59 | - | |
60 | -after_fork do |server, worker| | |
61 | - # Unicorn master loads the app then forks off workers - because of the way | |
62 | - # Unix forking works, we need to make sure we aren't using any of the parent's | |
63 | - # sockets, e.g. db connection | |
64 | - | |
65 | - defined?(ActiveRecord::Base) and ActiveRecord::Base.establish_connection | |
66 | - # Redis and Memcached would go here but their connections are established | |
67 | - # on demand, so the master never opens a socket | |
68 | -end |