-
Notifications
You must be signed in to change notification settings - Fork 499
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Replace unicorn application server with the puma application server
unicorn 6.1.0 does not support rack 3, there doesnt seem to be progress towards releasing a fixed version. So switch to puma Fixes issue #569
- Loading branch information
Showing
8 changed files
with
75 additions
and
133 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
#Change to match your CPU core count | ||
# Check using this on the server => grep -c processor /proc/cpuinfo | ||
workers {{PUMA_WORKERS}} | ||
preload_app! | ||
|
||
# Min and Max threads per worker | ||
threads 1, 6 | ||
app_dir = File.expand_path("{{REDMINE_INSTALL_DIR}}") | ||
|
||
# Default to production | ||
rails_env = ENV['RAILS_ENV'] || 'production' | ||
environment rails_env | ||
|
||
# Set up socket location | ||
bind "unix://#{app_dir}/tmp/sockets/puma.sock" | ||
bind "tcp://0.0.0.0:8080" | ||
|
||
# Logging | ||
stdout_redirect "#{app_dir}/log/puma.stdout.log", "#{app_dir}/log/puma.stderr.log", true | ||
|
||
# Set master PID and state locations | ||
pidfile "#{app_dir}/tmp/pids/puma.pid" | ||
state_path "#{app_dir}/tmp/pids/puma.state" | ||
activate_control_app | ||
|
||
|
||
before_fork do |server, worker| | ||
require 'active_record' | ||
# the following is highly recomended for Rails + "preload_app true" | ||
# as there's no need for the master process to hold a connection | ||
defined?(ActiveRecord::Base) and | ||
ActiveRecord::Base.connection.disconnect! | ||
|
||
end | ||
|
||
on_worker_boot do | ||
require 'active_record' | ||
|
||
# the following is *required* for Rails + "preload_app true", | ||
ActiveRecord::Base.connection.disconnect! rescue ActiveRecord::ConnectionNotEstablished | ||
ActiveRecord::Base.establish_connection(YAML.load_file("#{app_dir}/config/database.yml")[rails_env]) | ||
|
||
# if preload_app is true, then you may also want to check and | ||
# restart any other shared sockets/descriptors such as Memcached, | ||
# and Redis. TokyoCabinet file handles are safe to reuse | ||
# between any number of forked children (assuming your kernel | ||
# correctly implements pread()/pwrite() system calls) | ||
end |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters