I am running a small Rails application on Heroku with one dinosaur and several Puma employees.
Puma docs say:
The general rule is to use preload_app when your employees die often and require a quick start. If you have a lot of workers, you should probably not use preload_app.
This suggests that I should not use preload_app! in my config/puma.rb However, I have a few unanswered questions:
- When do my workers die? Will they be received and re-forked after a certain number of requests? How can I control this?
- How do I know if my employees need a quick start?
Clearly, preload_app! should save resources when using many workers, but I see no shortage of its use even with a small number of workers.
Heroku's recommended configuration for a "simple Rails application" includes preload_app! but they do not offer any indication when not to use it.
When preload_app! not to use and why? (Ignoring the issue with a phased restart.)
ruby-on-rails heroku preload puma
Max wallace
source share