Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
obfuscoder opened this issue Mar 23, 2017 · 5 comments
Closed

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

obfuscoder opened this issue Mar 23, 2017 · 5 comments

Comments

@obfuscoder
Copy link

@obfuscoder obfuscoder commented Mar 23, 2017

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

@pedros007

This comment has been minimized.

Copy link

@pedros007 pedros007 commented Mar 30, 2017

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)

@nateberkopec

This comment has been minimized.

Copy link
Member

@nateberkopec nateberkopec commented May 12, 2017

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

@ammarshah

This comment has been minimized.

Copy link

@ammarshah ammarshah commented Dec 10, 2017

@nateberkopec You just made me cry.

@pedros007

This comment has been minimized.

Copy link

@pedros007 pedros007 commented Mar 29, 2018

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.

@dennym

This comment has been minimized.

Copy link

@dennym dennym commented Aug 9, 2019

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.