Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Jade Rubick
committed
Sep 26, 2011
1 parent
1445bc6
commit 3c1edf3
Showing
1 changed file
with
28 additions
and
4 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,34 @@ | ||
app_path = "/web_apps/rails_pet_clinic" | ||
app_path = "/web_apps/rails_pet_clinic/" | ||
|
||
working_directory app_path | ||
listen "/tmp/rails_pet_clinic.socket", :backlog => 64 | ||
user 'www-data', 'www-data' | ||
|
||
worker_processes 3 | ||
pid "/tmp/unicorn.pid" | ||
stdout_path ="#{app_path}/log/unicorn.stdout.log" | ||
stderr_path ="#{app_path}/log/unicorn.stderr.log" | ||
|
||
|
||
stderr_path "#{app_path}/log/unicorn.stderr.log" | ||
stdout_path "#{app_path}/log/unicorn.stdout.log" | ||
|
||
pid "#{app_path}/pids/unicorn.pid" | ||
stdout_path ="/tmp/unicorn.stdout.log" | ||
stderr_path ="/tmp/unicorn.stderr.log" | ||
|
||
|
||
preload_app true | ||
timeout 30 | ||
|
||
before_fork do |server, worker| | ||
# This option works in together with preload_app true setting | ||
# What is does is prevent the master process from holding | ||
# the database connection | ||
defined?(ActiveRecord::Base) and | ||
ActiveRecord::Base.connection.disconnect! | ||
end | ||
|
||
after_fork do |server, worker| | ||
# Here we are establishing the connection after forking worker | ||
# processes | ||
defined?(ActiveRecord::Base) and | ||
ActiveRecord::Base.establish_connection | ||
end |