I'm using Puma on Heroku for my server. When i have the Puma gem installed my dev environment boots up with Puma as the server. I don't seem to be able to shut that off without pulling the pum gem from my gemfile.
I like the idea of using the save server in development as production but the puma server make it difficult to track my debug statements. Also i don't seem to have a way to change max threads, comes up as 16 in dev even though my puma.rb file sets it to 1.
Puma is the default server for Rails, included in the generated Gemfile.
Nginx is a web server and puma is an application server. Both have their advantages, and you need both.
Puma is a webserver that competes with Unicorn and allows you to handle concurrent requests. Puma uses threads, in addition to worker processes, to make more use of available CPU. You can only utilize threads in Puma if your entire code-base is thread safe.
You can only utilize threads in Puma if your entire code-base is thread safe. Otherwise, you can still use Puma, but must only scale-out through worker processes. This guide will walk you through deploying a new Rails application to Heroku using the Puma web server. For basic Rails setup, see Getting Started with Rails.
Set Puma as the server for your web process in the Procfile of your application. You can set most values inline: web: bundle exec puma -t 5:5 -p $ {PORT:-3000} -e $ {RACK_ENV:-development} Make sure the Procfile is appropriately capitalized and checked into git. Create a configuration file for Puma at config/puma.rb or at a path of your choosing.
Now the production environment of your Rails application is accessible via your server’s public IP address or FQDN. To access the Tasks controller that we created earlier, visit your application server in a web browser:
To test out if your application works, you can run the production environment, and bind it to the public IP address of your server (substitute your server’s public IP address): Now visit this URL in a web browser: If it’s working properly, you should see this page: Go back to your Rails server, and press Ctrl-c to stop the application.
Just use puma in production mode. In your gemfile change gem 'puma'
with
#Gemfile
group :production do
gem 'puma'
end
and then run bundle install --without production
to install the gem .
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With