-
Notifications
You must be signed in to change notification settings - Fork 107
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
Allow puma config to overwrite threads and workers #256
Conversation
I don't think it should matter when in the cli you use the
That's intentional because it would be really confusing if someone was running:
And it booted on a different port. If you want the values in the config to take precedent, don't provide them via to the We could make this more clear perhaps. For example a warning:
Though this is the first time i've seen this come up. It's not something I would add at this point, but might take a PR if it wasn't too massive. |
Thanks @schneems. I think the challenge here is that Upon reflection, I think the best course of action is to conditionally add WORKERS_ARG=$([ -z "$WORKERS" ] || echo "-w $WORKERS")
THREADS_ARG=$([ -z "$THREADS" ] || echo "-t 0:$THREADS")
CONFIG_ARG=$([ -z "$CONFIG" ] || echo "-C $CONFIG")
puma $WORKERS_ARG $THREADS_ARG $CONFIG_ARG That means leaning into the puma defaults rather than trying to explicitly set them ourselves. Lines 287 to 291 in fca1942
Then if you provide all 3 (via |
@nonrational I agree that ideally puma-dev should only supply the workers and threads flags if they have been explicitly defined via environment variables. |
If @schneems agrees with the suggested solution by @nonrational, I can update my pull request with that approach. |
Only took 18 months, but I've implemented this approach in #302. |
@nonrational Let's reopen this until we've got a fix merged. |
I've opened #307 to track this issue. |
Currently when using the following puma config file, the
threads
andworkers
options are ignored because the-w
and-t
flags appear after the-C
flag and will override the workers and threads settings.The change in this PR allows the puma config file to be authoritative.