0

I read this article, but it does not talk about Rails 5.

https://devcenter.heroku.com/articles/ruby-default-web-server

It is related to the following warning from heroku-cli.

WARNING:
No Procfile detected, using the default web server.
We recommend explicitly declaring how to boot your server process via a Procfile.

I am concerned about performances, but I read that my Puma Server on Heroku uses 5 threads, but there is no information about workers and I am wondering if I should do this setting from Deploying Rails Application with Puma also with Rails 5.

May 09 10:35:45 growstartups app/web.1: => Booting Puma 
May 09 10:35:45 growstartups app/web.1: => Rails 5.0.2 application starting in production on http://0.0.0.0:21348 
May 09 10:35:45 growstartups app/web.1: => Run `rails server -h` for more startup options 
May 09 10:35:45 growstartups app/web.1: Puma starting in single mode... 
May 09 10:35:45 growstartups app/web.1: * Version 3.8.2 (ruby 2.3.3-p222), codename: Sassy Salamander 
May 09 10:35:45 growstartups app/web.1: * Min threads: 5, max threads: 5 
May 09 10:35:45 growstartups app/web.1: * Environment: production 
May 09 10:35:45 growstartups app/web.1: * Listening on tcp://0.0.0.0:21348 

Thanks a lot Best Regards Fabrizio Bertoglio

Fabrizio Bertoglio
  • 5,890
  • 4
  • 16
  • 57

1 Answers1

1

I will be removing the comments from the puma.rb configuration file

workers ENV.fetch("WEB_CONCURRENCY") { 2 }
preload_app!
 on_worker_boot do
   ActiveRecord::Base.establish_connection if defined?(ActiveRecord)
end

I would like this settings to work only in production.

How do I use puma's configuration file?

Hear I found the solution. So I created a separate file in config/puma/production.rbwhich will have:

environment ENV.fetch("RAILS_ENV") { "production" }

Pushed to heroku and it works. I don't like to use workers in development as they time out when I debug..

Thanks Fabrizio

Community
  • 1
  • 1
Fabrizio Bertoglio
  • 5,890
  • 4
  • 16
  • 57