Skip to content

Commit

Permalink
unicorn configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
Dhruv Bansal committed Aug 31, 2012
1 parent 7ff9ee4 commit 123f574
Show file tree
Hide file tree
Showing 4 changed files with 23 additions and 1 deletion.
3 changes: 2 additions & 1 deletion .gitignore
@@ -1,2 +1,3 @@
settings.yml
db/*
db/*
unicorn-conf.rb
Empty file added log/.gitkeep
Empty file.
Empty file added tmp/.gitkeep
Empty file.
21 changes: 21 additions & 0 deletions unicorn-conf.example.rb
@@ -0,0 +1,21 @@
#!/usr/bin/env ruby
worker_processes 1
preload_app true
stderr_path 'log/unicorn.stderr.log'
stdout_path 'log/unicorn.stdout.log'

# # REE
GC.copy_on_write_friendly = true if GC.respond_to?(:copy_on_write_friendly=)

timeout 80
working_directory ''
listen 'tmp/unicorn.sock', :backlog => 64
pid 'tmp/unicorn.pid'

after_fork do |server, worker|
# per-process listener ports for debugging/admin/migrations
addr = "0.0.0.0:#{3000 + worker.nr}"
# keep trying to connect to port, wait 5s in between (an older daemon might
# still be quitting and won the port).
server.listen(addr, :tries => -1, :delay => 5, :backlog => 64) # , :tcp_nopush => true
end

0 comments on commit 123f574

Please sign in to comment.