mirror of
https://github.com/discourse/discourse.git
synced 2024-11-23 06:04:11 +08:00
30990006a9
This reduces chances of errors where consumers of strings mutate inputs and reduces memory usage of the app. Test suite passes now, but there may be some stuff left, so we will run a few sites on a branch prior to merging
22 lines
683 B
Ruby
22 lines
683 B
Ruby
# frozen_string_literal: true
|
|
|
|
if ENV['RAILS_ENV'] == 'production'
|
|
|
|
# First, you need to change these below to your situation.
|
|
APP_ROOT = '/home/discourse/discourse'
|
|
num_workers = ENV["NUM_WEBS"].to_i > 0 ? ENV["NUM_WEBS"].to_i : 4
|
|
|
|
# Second, you can choose how many threads that you are going to run at same time.
|
|
workers "#{num_workers}"
|
|
threads 8, 32
|
|
|
|
# Unless you know what you are changing, do not change them.
|
|
bind "unix://#{APP_ROOT}/tmp/sockets/puma.sock"
|
|
stdout_redirect "#{APP_ROOT}/log/puma.log", "#{APP_ROOT}/log/puma.err.log"
|
|
pidfile "#{APP_ROOT}/tmp/pids/puma.pid"
|
|
state_path "#{APP_ROOT}/tmp/pids/puma.state"
|
|
daemonize true
|
|
preload_app!
|
|
|
|
end
|