puma/puma

Starting puma with rails s -d does not use config/puma.rb

Closed this issue · 5 comments

Steps to reproduce

  1. Create rails app with puma gem
  2. Create config/puma.rb with following settings:
workers 2
threads 4,16
preload_app!
  1. Start server with rails s

Output is as expected:

...
Puma starting in cluster mode...
* Version 3.8.2 (ruby 2.3.3-p222), codename: Sassy Salamander
* Min threads: 4, max threads: 16
* Environment: development
* Process workers: 2
* Preloading application
* Listening on tcp://localhost:3000
Use Ctrl-C to stop
- Worker 0 (pid: NNNN) booted, phase: 0
- Worker 1 (pid: NNNN) booted, phase: 0

Also htop shows puma running with 2 child processes each containing 4 threads each as expected.

  1. Stop server and start it again with rails s -d

Expected behavior

Either the output or the log files should contain the same output that the configured processes/threads have been started or htop should show the same process structure as when started without -d.

Actual behavior

The output is not shown. Also htop does not show the expected process structure. Instead it shows the standard process and thread info I see when I start rails server with puma without having any config/puma.rb - just one process, no child processes no threads started apart from the standard ones.

System configuration

Ubuntu 16.04 LTS x64

Ruby version: ruby 2.3.3p222
Rails version: rails 4.2.8

As of 2014, there is no ability to use a config file via rails server. You need to use puma directly see also: #512 (comment)

^^^ What he said. Please use puma -d.

@nateberkopec You just made me cry.

Just came across this while upgrading a rails-4.2 app to rails-5.0. Rails-5.0 uses Puma for development by default instead of WebRick. It also seems that rails s will correctly read config/puma.rb (tested with rails-5.0.6).

Also, the puma CLI reads config/puma.rb by default. Find some commentary on this from @schneems in Container-Ready Rails 5.

So whats the deal here? Puma gem can read the config but can't use it? Tested with rails@5.2.2 and puma@3.7. Running the rails s without -d it does use the config and when running it with -d the config is not applied.
Should this ticket reopened?