Permalink
Browse files

unicorn configuration

  • Loading branch information...
1 parent 7ff9ee4 commit 123f574b2c21b321da6afee21184f4ffdf3a75f0 Dhruv Bansal committed Aug 31, 2012
Showing with 23 additions and 1 deletion.
  1. +2 −1 .gitignore
  2. 0 log/.gitkeep
  3. 0 tmp/.gitkeep
  4. +21 −0 unicorn-conf.example.rb
View
@@ -1,2 +1,3 @@
settings.yml
-db/*
+db/*
+unicorn-conf.rb
View
No changes.
View
No changes.
View
@@ -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.