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

Optionally, remove master process or allow it to take requests #2215

Open
nateberkopec opened this issue Apr 2, 2020 · 2 comments
Open

Optionally, remove master process or allow it to take requests #2215

nateberkopec opened this issue Apr 2, 2020 · 2 comments
Labels

Comments

@nateberkopec
Copy link
Member

The master process takes up a lot of memory in constrained environments, like Heroku or small VPSes. We could let the master process take requests. This "dirties" the master, but we could figure out a way to deal with that. For some people, an extra Puma process would be worth the tradeoff of any additional complications.

Thoughts:

  • We'd have to shut down the threadpool before forking.
  • Rails will take care of disconnecting itself from ActiveRecord I think.
  • What other "dirty" state should we think about and try to clean up before fork?
@wjordan
Copy link
Contributor

wjordan commented Apr 29, 2020

The master process takes up a lot of memory in constrained environments

Is this only an issue when preload_app is enabled and the master process loads the application code, or is the Puma code itself also taking up a lot of memory? If the preloaded app is the main issue, this could be fixed by the fork_worker option (#2099) which avoids preloading the app in the master process.

@nateberkopec
Copy link
Member Author

Is this only an issue when preload_app is enabled and the master process loads the application code

Purely this case.

I don't remember - does #2099 still create a master?

@nateberkopec nateberkopec changed the title Dirty master process Remove master process or allow it to take requests May 11, 2020
@nateberkopec nateberkopec changed the title Remove master process or allow it to take requests Optionally, remove master process or allow it to take requests May 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants