Skip to content

Instantly share code, notes, and snippets.

@halidaltuner
Created September 19, 2013 13:51
Show Gist options
  • Save halidaltuner/6623794 to your computer and use it in GitHub Desktop.
Save halidaltuner/6623794 to your computer and use it in GitHub Desktop.
unicorn example conf for redmine
worker_processes 4
working_directory "/usr/local/share/redmine"
listen "/usr/local/share/redmine/tmp/pids/.unicorn.sock", :backlog => 64
listen 8080, :tcp_nopush => true
timeout 30
pid "/usr/local/share/redmine/tmp/pids/unicorn.pid"
stderr_path "/usr/local/share/redmine/log/unicorn.stderr.log"
stdout_path "/usr/local/share/redmine/log/unicorn.stdout.log"
preload_app true
GC.respond_to?(:copy_on_write_friendly=) and
GC.copy_on_write_friendly = true
check_client_connection false
before_fork do |server, worker|
defined?(ActiveRecord::Base) and
ActiveRecord::Base.connection.disconnect!
end
after_fork do |server, worker|
defined?(ActiveRecord::Base) and
ActiveRecord::Base.establish_connection
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment