mirror of
https://github.com/discourse/discourse.git
synced 2024-11-25 09:42:07 +08:00
configurable worker process count for unicorn
This commit is contained in:
parent
a84997ebc7
commit
ef2b8cbe5d
|
@ -3,7 +3,7 @@
|
|||
discourse_path = File.expand_path(File.expand_path(File.dirname(__FILE__)) + "/../")
|
||||
|
||||
# tune down if not enough ram
|
||||
worker_processes 3
|
||||
worker_processes (ENV["UNICORN_WORKERS"] || 3).to_i
|
||||
|
||||
working_directory discourse_path
|
||||
|
||||
|
@ -41,14 +41,6 @@ before_fork do |server, worker|
|
|||
I18n.t(:posts)
|
||||
# get rid of rubbish so we don't share it
|
||||
GC.start
|
||||
|
||||
Thread.new do
|
||||
# sleep a bit, on startup unicorn kills all its children
|
||||
# so sidestep it
|
||||
sleep 10
|
||||
require 'demon/sidekiq'
|
||||
Demon::Sidekiq.start(1)
|
||||
end
|
||||
end
|
||||
|
||||
ActiveRecord::Base.connection.disconnect!
|
||||
|
|
Loading…
Reference in New Issue
Block a user