Permalink
Browse files

Add puma config. Remove unicorn config

  • Loading branch information...
1 parent 3f860e4 commit 21f8cd48d8c30e661d7a56219abd619f4848f591 @mscoutermarsh mscoutermarsh committed Oct 22, 2015
Showing with 10 additions and 22 deletions.
  1. +1 −1 Procfile
  2. +9 −0 config/puma.rb
  3. +0 −21 config/unicorn.rb
View
@@ -1 +1 @@
-web: bundle exec puma
+web: bundle exec puma -C config/puma.rb
View
@@ -0,0 +1,9 @@
+workers Integer(ENV['WEB_CONCURRENCY'] || 2)
+threads_count = Integer(ENV['MAX_THREADS'] || 5)
+threads threads_count, threads_count
+
+preload_app!
+
+rackup DefaultRackup
+port ENV['PORT'] || 3000
+environment ENV['RACK_ENV'] || 'development'
View
@@ -1,21 +0,0 @@
-worker_processes Integer(ENV['UNICORN_WORKERS'] || 4)
-timeout 30
-preload_app true
-listen(ENV['PORT'] || 3000, :backlog => Integer(ENV['UNICORN_BACKLOG'] || 200))
-
-before_fork do |server, worker|
- Signal.trap 'TERM' do
- puts 'Unicorn master intercepting TERM and sending myself QUIT instead'
- Process.kill 'QUIT', Process.pid
- end
-
- if defined?(Sequel::Model)
- Sequel::DATABASES.each{ |db| db.disconnect }
- end
-end
-
-after_fork do |server, worker|
- Signal.trap 'TERM' do
- puts 'Unicorn worker intercepting TERM and doing nothing. Wait for master to sent QUIT'
- end
-end

0 comments on commit 21f8cd4

Please sign in to comment.