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
Docs improvement (or fork_worker not working?): trying to understand fork_worker
, preload_app!
and Phased restarts working together
#2466
Comments
According to https://github.com/puma/puma/blob/v5.0.4/docs/fork_worker.md it is |
So
(without |
Does that resolve the issue for you @feliperaul? |
I'll close this one as I think the docs now cover the issue, let us know if you think there's something still missing @feliperaul |
If you configure both I think documentating "they are incompatible" isn't enough; I think if you configure incompatibly you should at least get a warning on boot, if not an error, no? |
@jrochkind I agree, that sounds more clear to me. There was more discussion around the these config options in #2483. Perhaps that's a better place to continue the discussion. |
I'm on Puma 5.0.3 and willing to issue a pull request to improve Puma's documentation regarding these points, but first I'd love some help better understanding them.
On the 5.0 upgrade guide, it states this:
However, If I have both these options in my
puma.rb
config file:When I issue a
kill -USR1 $(cat /var/www/shared/tmp/pids/puma.pid)
, I get a* phased-restart called but not available, restarting normally.
in the logs, and it doesn't do a phased restart.Moving on in my experimentation and removing the
preload_app!
from the config file, the docs state here that This allows a phased restart to complete as quickly as a hot restart (SIGUSR2 or pumactl restart), while still minimizing downtime by staggering the restart across cluster workers.However, I timed
kill -USR1 $(cat /var/www/shared/tmp/pids/puma.pid)
, and found out that:fork_worker
in the config filefork_worker
in the config fileJust as a side note, a simple
systemctl restart puma.service
is taking around 6 seconds to do a hot restart (so, not phased, killing all workers at once).There's also no indication in the puma stdout.log that a phased restart with
fork_worker
is being performed (I couldn't find any code to log so, maybe that would be useful so we can be sure that the option is in effect). Am I missing something?If it's of interest, here's my systemd service, and we use socket activation:
The text was updated successfully, but these errors were encountered: