diff --git a/Gemfile b/Gemfile index 0c63738..e0bb732 100644 --- a/Gemfile +++ b/Gemfile @@ -5,6 +5,5 @@ gem 'dotenv' gem 'faye' gem 'faye-redis' gem 'private_pub', '1.0.3' -gem 'thin' gem 'foreman' gem 'puma' diff --git a/Procfile b/Procfile index 8ee75af..3631537 100644 --- a/Procfile +++ b/Procfile @@ -1 +1 @@ -web: bundle exec rackup config.ru -s thin -E production -p $PORT +web: bundle exec rackup config.ru -s Puma -E production -p $PORT diff --git a/config.ru b/config.ru index 6fe1a68..73f4e5e 100644 --- a/config.ru +++ b/config.ru @@ -26,7 +26,6 @@ options = { } } -Faye::WebSocket.load_adapter('thin') run Faye::RackAdapter.new(options) require 'logger' diff --git a/config/puma.rb b/config/puma.rb index e69de29..f2da6c4 100644 --- a/config/puma.rb +++ b/config/puma.rb @@ -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'] || 3001 +environment ENV['RACK_ENV'] || 'development' diff --git a/x.run_local b/x.run_local index 5d28286..706576f 100755 --- a/x.run_local +++ b/x.run_local @@ -1 +1 @@ -bundle exec rackup config.ru -s thin -E production --host /tmp/pubsub.sock +bundle exec rackup config.ru -s Puma -E production --host /tmp/pubsub.sock