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
Print warning when running one-worker cluster #2565
Print warning when running one-worker cluster #2565
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it would be good to be able to silence the warning, as outlined in #2534, there might be users who really want to run Puma this way.
A test would also be good, so future refactoring can be done with confidence. Looks like |
@dentarg Thanks for taking a look! What would be the preferred way to suppress this warning? Via an environment variable? A new configuration option? |
I would go for environment variable |
Env variable seems like the wrong choice @dentarg - wouldnt you want this warning to be supressed "for all time"? Env variables mean that other devs in dev environments, for example, would have to also have the env variable set. |
@nateberkopec you're right, that makes sense. I was thinking of other types of software where ENVs is often used to hide warnings. I guess an ENV is good if you're in a situation where you can't change the config for some reason but you have control over the environment. (Might not be a common thing with this case) |
In that case then should this be implemented as a new method in One potential issue with adding it as a new keyword argument to |
Sounds good to me 👍 The warning could inform about this setting |
Running Puma in cluster-mode is likely a misconfiguration in most scenarios. Cluster mode has some overhead of running an addtional 'control' process in order to manage the cluster. If only running a single worker it is likely not worth paying that overhead vs running in single mode with additional threads instead. There are some scenarios where running cluster mode with a single worker may still be warranted and valid under certain deployment scenarios, see the linked issue for details. From experience at work, we were able to migrate our Rails applications from single worker cluster to single-mode and saw a reduction of RAM usage of around ~15%. Closes #2534
I'm not sure that the failing test is related to these changes, seems like a flake! |
* Print warning when running one-worker cluster Running Puma in cluster-mode is likely a misconfiguration in most scenarios. Cluster mode has some overhead of running an addtional 'control' process in order to manage the cluster. If only running a single worker it is likely not worth paying that overhead vs running in single mode with additional threads instead. There are some scenarios where running cluster mode with a single worker may still be warranted and valid under certain deployment scenarios, see the linked issue for details. From experience at work, we were able to migrate our Rails applications from single worker cluster to single-mode and saw a reduction of RAM usage of around ~15%. Closes puma#2534 * Remove link to issue * Add #silence_single_worker_warning option * Test single_worker_warning
Running Puma in cluster-mode is likely a misconfiguration in most
scenarios.
Cluster mode has some overhead of running an addtional 'control' process
in order to manage the cluster. If only running a single worker it is
likely not worth paying that overhead vs running in single mode with
additional threads instead.
There are some scenarios where running cluster mode with a single worker
may still be warranted and valid under certain deployment scenarios, see
the linked issue for details.
From experience at work, we were able to migrate our Rails applications
from single worker cluster to single-mode and saw a reduction of RAM
usage of around ~15%.
Closes #2534
Your checklist for this pull request
[changelog skip]
or[ci skip]
to the pull request title.[ci skip]
to the title of the PR.#issue
" to the PR description or my commit messages.