Puma5 has a new fork_worker option.
https://github.com/puma/puma/blob/master/5.0-Upgrade.md https://github.com/puma/puma/blob/master/docs/fork_worker.md
The docs mention:
Similar to the preload_app! option, the fork_worker option allows your application to be initialized only once for copy-on-write memory savings, and it has two additional advantages...
I'm confused if this means it's an alternative to preload_app!
, or if it's meant to be used in conjunction with preload_app!
.
If I already was using preload_app!
, and want to try the new experimental fork_worker
option, should I have both preload_app!
and fork_worker
in my puma config file, does that make sense? Or it should it be one or the other but not both?
If you check the Limitations, you will read the following:
Not compatible with the preload_app! option
Interestingly enough, the commit was added seven days after you asked the question!
Although this has been answered on the doc itself and by now you've probably found out yourself, it feels better to see the question answered here also.